Page 1 of 1

Separate main.py vs embedding into hex

Posted: Tue Jul 16, 2019 7:54 pm
by aivarannamaa
Hi everybody!

Are there any benefits of embedding main code into hex file instead of uploading plain firmware and main.py separately?

Does one of these approaches allow longer programs?

Best regards,
Aivar

Re: Separate main.py vs embedding into hex

Posted: Tue Jul 16, 2019 10:32 pm
by jimmo
On the micro:bit, the difference is fairly small.

To allow for the largest possible program, put your main.py in the hex and put additional modules into the filesystem. (But be aware that flashing the hex file may erase the filesystem).

One advantage of putting code in the filesystem is that it's faster to upload, because you don't have to flash the entire device for every code change. Although if you install the latest daplink firmware and use recent versions of Mu, then flashing the hex file is a lot faster anyway. https://support.microbit.org/support/so ... -micro-bit