Describe the bug
A project trained in micro:bit CreateAI works correctly when its exported HEX file is flashed directly to a micro:bit V2. The trained model recognizes all seven movement classes.
However, importing the same HEX file back into MakeCode displays:
Sorry, we couldn’t recognize this file.
The students followed the official CreateAI workflow correctly. The problem remains after importing the original sample JSON, retraining the model, exporting to MakeCode, and using “Download as File” again.
Technical inspection indicates that the MakeCode/PXT editable source embedded in Intel HEX record type 0x0E exceeds the 64 KiB boundary.
For the affected file:
- Actual LZMA-compressed embedded source:
74,688 bytes
- Length recorded in the embedded-source header:
9,152 bytes
- Difference: exactly
65,536 bytes
- Decompressed project size:
764,184 bytes
- The type-
0x0E address reaches 0xFFF0 and then wraps to 0x0000
This appears to be a 16-bit length or address overflow:
74,688 - 65,536 = 9,152
The executable firmware remains valid, so the HEX can still be flashed and run. However, MakeCode cannot reconstruct the editable project because the embedded compressed source is incomplete or overwritten after the address wrap.
The embedded project contains:
autogenerated.ts
dataset.json
main.blocks
main.ts
ml-metadata.json
pxt.json
_packaged-extensions.json
The largest embedded files are:
dataset.json: 551,230 bytes
_packaged-extensions.json: 161,986 bytes
autogenerated.ts: 10,498 bytes
We confirmed the suspected cause by recovering the complete wrapped source and creating an editable copy in which only the embedded dataset.json was replaced with {}. The separate CreateAI sample JSON was retained for future retraining.
After this change:
- Compressed embedded source decreased to
33,535 bytes
- No type-
0x0E address wrap occurred
- The trained model in
autogenerated.ts remained intact
- All seven ML event blocks remained intact
- The repaired HEX imported successfully into MakeCode
To Reproduce
- Open micro:bit CreateAI.
- Create seven movement classes.
- Record approximately 20–30 movement samples for each class.
- Train and test the model.
- Export the trained project to MakeCode.
- In MakeCode, use “Download as File” to save the project as a HEX file.
- Flash the HEX directly to a micro:bit V2 and confirm that the trained model works.
- Return to
https://makecode.microbit.org/.
- Select Import → Import File.
- Select the same downloaded HEX file.
- Click Continue.
- MakeCode reports that it cannot recognize the file.
The issue appears when the LZMA-compressed PXT embedded-source data exceeds 65,535 bytes.
Expected behavior
A HEX file generated through the official CreateAI and MakeCode workflow should remain importable into MakeCode.
If embedded editable-source data cannot exceed 64 KiB, CreateAI or MakeCode should detect this before export and do one of the following:
- Store
dataset.json separately instead of embedding it in the HEX
- Use an embedded-source format that supports data beyond the 64 KiB boundary
- Correctly encode and reconstruct multiple type-
0x0E sections
- Warn the user before downloading a file that cannot be reopened
- Provide a separate editable project-backup format
Students should not receive an apparently valid project file that runs on the micro:bit but cannot be reopened in MakeCode.
Screenshots
Attached screenshots show:
- MakeCode reporting that it cannot recognize the original CreateAI HEX file.
- The repaired project successfully opened in MakeCode with all seven ML event blocks visible.
The original failing HEX and repaired HEX can also be attached for comparison.
micro:bit version (please complete the following information):
- micro:bit V2
- The issue concerns CreateAI/MakeCode project export and import, rather than a hardware failure.
- The original HEX runs correctly when flashed to the micro:bit.
Desktop (please complete the following information):
- OS: Windows
- Browser: Google Chrome
- Browser version: Current installed version
- MakeCode target:
9.0.8
- PXT version:
13.0.5
- Project editor:
blocksprj
- Machine-learning extension:
pxt-microbit-ml v1.0.14
- MakeCode URL:
https://makecode.microbit.org/
Smartphone (please complete the following information):
- Device: Not applicable
- OS: Not applicable
- Browser: Not applicable
- Version: Not applicable
The problem was reproduced on a Windows desktop computer.
Additional context
This has caused repeated disruption in a classroom environment. Students successfully complete data collection and model training, download the project, and later discover that it cannot be reopened in MakeCode.
Because the same HEX still runs on the micro:bit, the downloaded file appears valid even though its editable project data cannot be recovered through the normal MakeCode interface.
The failure has occurred repeatedly and is not an isolated student error.
The original CreateAI project used seven movement classes with approximately 20–30 samples per class.
A separate sample JSON backup is available. Because it contains the students’ complete movement-training data, it is not being attached publicly, but it can be provided privately upon request.
Files available for reproduction:
- Original CreateAI HEX that runs on the micro:bit but cannot be imported into MakeCode
- Repaired MakeCode-importable HEX
- Original CreateAI sample JSON, available privately
- Screenshot of the MakeCode import error
- Screenshot of the repaired project opened successfully
- Technical comparison of the original and repaired type-
0x0E records
正手-刪減版-data-samples.json
Describe the bug
A project trained in micro:bit CreateAI works correctly when its exported HEX file is flashed directly to a micro:bit V2. The trained model recognizes all seven movement classes.
However, importing the same HEX file back into MakeCode displays:
The students followed the official CreateAI workflow correctly. The problem remains after importing the original sample JSON, retraining the model, exporting to MakeCode, and using “Download as File” again.
Technical inspection indicates that the MakeCode/PXT editable source embedded in Intel HEX record type
0x0Eexceeds the 64 KiB boundary.For the affected file:
74,688 bytes9,152 bytes65,536 bytes764,184 bytes0x0Eaddress reaches0xFFF0and then wraps to0x0000This appears to be a 16-bit length or address overflow:
74,688 - 65,536 = 9,152The executable firmware remains valid, so the HEX can still be flashed and run. However, MakeCode cannot reconstruct the editable project because the embedded compressed source is incomplete or overwritten after the address wrap.
The embedded project contains:
autogenerated.tsdataset.jsonmain.blocksmain.tsml-metadata.jsonpxt.json_packaged-extensions.jsonThe largest embedded files are:
dataset.json: 551,230 bytes_packaged-extensions.json: 161,986 bytesautogenerated.ts: 10,498 bytesWe confirmed the suspected cause by recovering the complete wrapped source and creating an editable copy in which only the embedded
dataset.jsonwas replaced with{}. The separate CreateAI sample JSON was retained for future retraining.After this change:
33,535 bytes0x0Eaddress wrap occurredautogenerated.tsremained intactTo Reproduce
https://makecode.microbit.org/.The issue appears when the LZMA-compressed PXT embedded-source data exceeds 65,535 bytes.
Expected behavior
A HEX file generated through the official CreateAI and MakeCode workflow should remain importable into MakeCode.
If embedded editable-source data cannot exceed 64 KiB, CreateAI or MakeCode should detect this before export and do one of the following:
dataset.jsonseparately instead of embedding it in the HEX0x0EsectionsStudents should not receive an apparently valid project file that runs on the micro:bit but cannot be reopened in MakeCode.
Screenshots
Attached screenshots show:
The original failing HEX and repaired HEX can also be attached for comparison.
micro:bit version (please complete the following information):
Desktop (please complete the following information):
9.0.813.0.5blocksprjpxt-microbit-ml v1.0.14https://makecode.microbit.org/Smartphone (please complete the following information):
The problem was reproduced on a Windows desktop computer.
Additional context
This has caused repeated disruption in a classroom environment. Students successfully complete data collection and model training, download the project, and later discover that it cannot be reopened in MakeCode.
Because the same HEX still runs on the micro:bit, the downloaded file appears valid even though its editable project data cannot be recovered through the normal MakeCode interface.
The failure has occurred repeatedly and is not an isolated student error.
The original CreateAI project used seven movement classes with approximately 20–30 samples per class.
A separate sample JSON backup is available. Because it contains the students’ complete movement-training data, it is not being attached publicly, but it can be provided privately upon request.
Files available for reproduction:
0x0Erecords正手-刪減版-data-samples.json