OpenMV3 firmware development

Discussion related to "under the hood" OpenMV topics.
MM3
Posts: 3
Joined: Mon Sep 25, 2017 6:56 am

OpenMV3 firmware development

Postby MM3 » Mon Sep 25, 2017 7:13 am

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 ?
User avatar
kwagyeman
Posts: 4130
Joined: Sun May 24, 2015 2:10 pm

Re: OpenMV3 firmware development

Postby kwagyeman » Mon Sep 25, 2017 11:45 am

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/m ... tag.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.
Nyamekye,
MM3
Posts: 3
Joined: Mon Sep 25, 2017 6:56 am

Re: OpenMV3 firmware development

Postby MM3 » Mon Sep 25, 2017 2:31 pm

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 ?
User avatar
iabdalkader
Posts: 1180
Joined: Sun May 24, 2015 3:53 pm

Re: OpenMV3 firmware development

Postby iabdalkader » Mon Sep 25, 2017 6:54 pm

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):

Code: Select all

 $(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

Code: Select all

micropython/lib/libm/math.c
MM3
Posts: 3
Joined: Mon Sep 25, 2017 6:56 am

Re: OpenMV3 firmware development

Postby MM3 » Tue Sep 26, 2017 5:32 am

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

Thank you
Buonecose
Ciao

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests