crazyflie firmware and c++

Firmware/software/electronics/mechanics
Post Reply
stefanovic
Beginner
Posts: 2
Joined: Sun Mar 29, 2020 7:52 pm

crazyflie firmware and c++

Post by stefanovic » Sun Mar 29, 2020 7:58 pm

Hello,

I'm trying to embed c++ code into the freertos-based firmware of the crazyflie drone, with the "app" framework and the push-demo as a basis.

I succeeded in compiling, linking, launching, but dynamic_cast<> always returns nullptr, and exceptions raised are not caught. I enabled flags such as -fexceptions, -rtti, and removed --specs=nano.specs to no avail. Something to know: it's the app task that eventually calls a c++ function which in turn does c++ stuff.

Does anybody know if the specific flags of the crazyflie firmware compilation process prevent c++ to behave correctly wrt to dynamic_cast?

(and I’m aware rtti and exceptions are not recommended in embedded apps, but I still want to try)

Best,
Stéphane



kristoffer
Bitcraze
Posts: 256
Joined: Tue Jun 30, 2015 7:47 am

Re: crazyflie firmware and c++

Post by kristoffer » Mon Mar 30, 2020 11:51 am

Hi!

I know Arnaud looked at C++ at some point, but as far as I remember he ran into some kind of problem, not sure what though. We did not have the app layer at that time, it might be possible to get that to work?

I found this thread that might help you?
https://www.freertos.org/FreeRTOS_Suppo ... a047j.html

Please keep us posted on your work!

stefanovic
Beginner
Posts: 2
Joined: Sun Mar 29, 2020 7:52 pm

Re: crazyflie firmware and c++

Post by stefanovic » Mon Mar 30, 2020 3:23 pm

Thank you.
Unfortunately the various discussions on this on the net do not bring solutions to my problems, including the one you mention.

I opened up another discussion over at https://forums.freertos.org/t/freertos-and-c-rtti/9372

Everything happen as if the std library was not initialized somehow: dynamic_cast returns nullptr, stl containers are faulty, no initialization of c++ global objects etc.

still trying to no avail...

Post Reply