FreeRTOS Task Vs. Firmware Application Layer

Firmware/software/electronics/mechanics
Post Reply
GriffinBonner
Beginner
Posts: 20
Joined: Thu Oct 08, 2020 2:45 pm

FreeRTOS Task Vs. Firmware Application Layer

Post by GriffinBonner »

I am trying to implement a failsafe module for the crazyflie 2.0 firmware. My current implementation includes a system task which reads the RSSI and connection to detect a weak signal or telemetry loss between the Crazyradio PA and the Crazyflie. I want to be able to call my application layer program to land the crazyflie when telemetry from the Crazyradio PA is detected. Is it possible to call an application from a running FreeRTOS task? or should I try to implement the entire functionality as a single FreeRTOS task/module?
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: FreeRTOS Task Vs. Firmware Application Layer

Post by kimberly »

I would use the app layer since that is also scheduled as an RTOS task, and that is designed exactly for what you want to do. See the documentation here. We also recently opened up all kinds of apis up for the applayer to use of which you can see examples in the example folder of the firmware repo. Its a nice way to keep your code separate from the firmware, so that you can easily update it when we have new changes.

You can then read the RSSI log value through the internal log api and then land the crazyflie using the internal high level commander function.
Post Reply