Replies: 6 comments 13 replies
-
You will need to statically link libgcc. |
Beta Was this translation helpful? Give feedback.
-
All the |
Beta Was this translation helpful? Give feedback.
-
Soft floats are not supported in dynamic native modules. The float example only works on architectures with hardware floating point (i.e. not armv6m or armv7m). (The documentation and features2 readme should probably make this more explicit). The problem is that your dynamic module ends up having to bring in all the soft float support code, because it has no way to link to the support already provided in the main firmware. (The MicroPython dynamic linker can only link the symbols in dynruntime.h). Hardware float is fine because there is no support code required. (e.g. what you're seeing here is the linker error because it needs the soft implementation of float multiply) You could probably make this work if you were prepared to have a much larger .mpy file (which ends up using a lot more RAM on the target device), but it would be wasteful to duplicate all the floating point support code that is already on the device. |
Beta Was this translation helpful? Give feedback.
-
It is possible to use soft floating point in dynamic native modules (.mpy). I am doing it in the emlearn-micropython project. It might be possible to integrate this kind of approach mpy_ld.py - since it knows all the unresolved symbols, it could attempt to resolve them using libgcc.a |
Beta Was this translation helpful? Give feedback.
-
Been working more this more recently, by making fast FFT as a dynamic native module. |
Beta Was this translation helpful? Give feedback.
-
One way to solve it is this PR: #15838 |
Beta Was this translation helpful? Give feedback.
-
I cannot make natmod .mpy module for
ARCH = armv6m
if floats or doubles are involved.The examples in examples/natmod are mostly made nicely, so my setup seems to be correct (had to install pyelftools, not mentioned in the docs, but no problem).
But in their Makefile
ARCH = x64
is defined.The examples without floats also are made if this setting is changed to
ARCH = armv6m
orARCH = armv7m
.But examples/natmod/features2 which has floats involved throws errors:
The above resulted from cross-checking if I made something wrong.
My original attempt was a benchmarking natmode multiplication function:
with Makefile:
Here the compilation succeeds, but the linker gives the error:
LinkError: build/mulxy500.o: undefined symbol: __aeabi_fmul
.What am I about to do?
Beta Was this translation helpful? Give feedback.
All reactions