OpenMV3 firmware development

Hi,
I’m trying to extend openmv firmware with a new algorithm ( it needs to use double precision and some lookup tables ).
During the compilation I received these errors:
undefined reference to __aeabi_ddiv' undefined reference to __aeabi_d2iz’
undefined reference to __aeabi_dadd' undefined reference to __aeabi_dadd’
undefined reference to `__aeabi_ddiv’
So I removed the -nostdlib flag in order to support the double precision (software emulated).
But I received this error:
arm-none-eabi/bin/ld: section .init LMA [080035e0,080035e3] overlaps section .data LMA [080035e0,080036b3]
Could you help me to change the linker script file in order to avoid this overlap ?

Is there a reason you need doubles? I’ve ported a lot of PC code to the OpenMV Cam now and found doubles to be completely unnecessary each time.

See the top of the aprtiltags.c file for how I basically turned all doubles and all methods that worked on doubles to work on floats without editing the code manually.

https://github.com/openmv/openmv/blob/master/src/omv/img/apriltag.c#L225

If you actually need doubles, like their precision, and know you need the ability for that precision… then maybe Ibrahim knows how to fix this. I don’t actually know. I’ll ping him to check if you absolutely need doubles. But, if you need doubles note that you’re going to experience a 2x slow down versus floats.

I have already done an attempt to use the algorithm in float but the statistical model used is trained using double precision.
Do you plan to extend the FW side in order to provide a sort of bare-metal SDK ?

Hi,

Try the following:

  • Remove -Wdouble-promotion flag from top Makefile.

  • Add -lgcc to top Makefile after $(FIRMWARE).elf (around line: 399 or whatever line number you have):

 $(CC) $(LDFLAGS) $(FIRM_OBJ) -o $(FW_DIR)/$(FIRMWARE).elf -lgcc

This will link libc with all the missing functions.

  • Final step, if you get multiple definitions of functions like i2d or f2d just remove them from
micropython/lib/libm/math.c

Ok now works fine.
I have added -Wl,–no-enum-size-warning to avoid some warning during linking.

Thank you
Buonecose
Ciao