Closed jonnor closed 1 month ago
I tried implementing support for larger jumps in https://github.com/micropython/micropython/pull/12241/files However the first iteration was not correct.
Has now been fixed upstream in https://github.com/micropython/micropython/pull/15812 - scheduled for release with MicroPython 1.24
I have backported this fix to https://github.com/jonnor/micropython/tree/emlearn-micropython-v1.23-2 which is now used in master. I was able to run the xor_trees example (above 2kB) on an RP2040, so this appears to be fixed now.
RP2040 and other Cortex M0/M0+ devices (ARCH=armv6m) only support ARM Thumb (not Thumb 2) instruction set. As of MicroPython 1.23, the linker for .mpy files only supports jumps that are under 11 bits. This limits module sizes to around 2kB maximum.
Most of the emlearn-micropython modules are slightly larger than 2kB on armv6m. The module sizes are a bit larger than some other architectures, since this architecture does not have floating point hardware, and we need to include some soft-float support.
At the moment, this is blocking most practical uses on Cortex M0.