If the micro:bit runs out of resources or detects a fault, it enters a 'panic' routine which displays a sad face on the micro:bit screen followed by a number eg 529.



In all cases, pressing the reset button on the back of the micro:bit will restart the program, which clears out the RAM memory and starts again.


Here is a list of errors with descriptions of what they mean and what you can do to fix them. We also document them all here individually on the support site:


Hardware errors (010-099)

                                                                                                                                       
Error number        What this means        
010        The micro:bit's I2C bus is not working. The device might be physically damaged.        
020        There is no free memory on the micro:bit. Your program might be too complex or contain a lot of large variables. Try reducing your code by making functions out of large sections.        
030        Corruption detected in the micro:bit heap space (memory allocated usually for the storage of variables). Try flashing a different .hex file to your device        
040        Your micro:bit can't execute your script properly. Flash a different .hex file to it, then try flashing and running your previous script again.        
042        Your micro:bit can't execute your script properly. Flash a different .hex file to it, then try flashing and running your previous script again.        
043        An error occurred with the micro:bit's radio component.        
050        An error occurred with the micro:bit's accelerometer component.        
051        An error occurred with the micro:bit's magnetometer component.        
090
A peripheral (e.g. SPI) has been initialised incorrectly. In MakeCode, ensure extension "start" or "init" blocks are included just once, inside "on start". Otherwise, please report this error to us.
098        Assertion failed. A MakeCode error occurs when the condition in an assert was false.


MakeCode Editor errors (800 - 989)

 

Error codes generated from the MakeCode Editor. In all these cases, please report the error to us, or if you are comfortable using Github, submit an issue on the code repository.

Garbage collector errors

Error number        What this means
840Allocation pointer is null or invalid.
841Garbage collection work queue error.
843VTable entry is not free.
844GC allocation failed for requested number of bytes.
846Invalid allocation thread.
848Allocation pointer beyond allocation header.
849Allocation pointer is null.
 

Program access errors

                                                                                                                         
Error number        What this means
901The type header for the object is not valid.
902The object data portion is greater than the length defined for it.
903An object reference was deleted and the object is no longer valid.
904The object size doesn’t match the size defined for the type.
905An object vtable is invalid or not initialized.
906An internal resource error.
907The specified device resource is not present.
909The argument value is out of range or the type or format is invalid.
927The program is incompatible with the micro:bit version you are using. You are trying to use a feature designed for micro:bit V2 on a micro:bit V1 or an extension that is only compatible with a micro:bit V1 board on a micro:bit V2.
928
The micro:bit data log is full. Clear the existing data or flash a new program to the micro:bit
 

JavaScript runtime codes

 

These occur for example when the static type of x is a class c, the dynamic type of x isn’t c, and you try to access a field on x or call a method on x, you will get one of the following codes, depending on the dynamic type of x.

                                                                                                           
Error number        What this means
980When value of x is undefined.
981When value of x is true or false.
982When x is a number.
983When x is a string.
984When x is an object of some type.
985When x is a function.
989When x is a null.


MicroPython OS Errors

We have published a list of MicroPython OSError codes and descriptions raised when a system operation causes a system-related error, including I/O failures such as “file not found” or “disk full”.


USB DAPLink errors (500 - 599)

Errors that begin with a indicate an error when flashing a file to the micro:bit via USB. Common errors are explained below. To clear the error, try to flash again. If the error persists, or if you see errors in the range 500-599 occurring often please report it to us.


Error numberWhat this means
502The micro:bit has experienced an internal error. This can occur during the drag and drop flash process. Try disconnecting and reconnecting the micro:bit to resolve the issue.
503An error occurred during the transfer. micro:bit has detected an inconsistency in the progress of the transfer. If it occurs frequently please report it to us.
504The transfer of the hex file to the micro:bit has timed out. This means that the flashing process has taken too long. This error might also occur if the file does not have the .hex extension. We are currently investigating this error, so if it occurs more than once please report it to us.
506The hex file is out of order. This means the code in the .hex file is in an order that the micro:bit did not expect. This might occur if you drag and drop a .hex file to the device before the previous one has finished flashing. Try disconnecting and reconnecting the micro:bit and flashing a different .hex.
521

The transfer of the hex file data arriving on the micro:bit is corrupted. It is a checksum failure in the hex file format that causes this error.

You may also find a FAIL.TXT file on your micro:bit with the wording :

error: The hex file cannot be decoded. Checksum calculation failure occurred.

type: transient, user


We are currently investigating an additional problem of users reporting failures to flash the micro:bit by copying files to the MICROBIT drive, see Error transferring the file to the micro:bit since Windows update in February 2023


528The micro:bit has detected an unsupported update. This can occur if you attempt to flash a firmware .hex file whilst in normal MICROBIT mode. Try flashing a file created in one of the online editors to resolve the issue.
529The micro:bit has detected an incompatible image. This can occur when you If you attempt to use an old .hex file with the latest micro:bit. Try updating the hex file in the editor in which it was created and downloading it again.

 


Keywords for search: sad face, error, error codes, panic code, 020 , 042 , 050 , 051 , 847 , 529 , 927, 502, 503, 528, 504, 521 daplink