Crazyflie communication protocol

Firmware/software/electronics/mechanics
Post Reply
Great_mind
Beginner
Posts: 5
Joined: Mon Sep 27, 2021 2:58 pm

Crazyflie communication protocol

Post by Great_mind »

Hello at bitcraze....

In my process of sourcing parts for my drone swarm project...I found the crazyflie as.a reference point to start, I would have liked to use the STM32F4 as the crazyflie but due to price spikes and and global chip shortage the chips are very expensive and scarce...in my process of finding alternative to the chip...I found a new chip that is close to the stm32f4...so my question is...is it possible to use the crazyflie communication protocol with other chips apart from stm32f405 and it will work same way as on the STM32F4 with all features incorporated?...


Thanks in advance.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Crazyflie communication protocol

Post by arnaud »

Hi,

I am not sure to understand the question. Using another MCU will likely be a porting problem more than a communication problem.

There is nothing in the communication protocols that are specific to the stm32f405: Crazyflie1 used the same protocol and was using an stm32f103 and we have even played around with prototype running entirely in an nRF52. The main problem is porting the code to the new MCU and potentially new sensors. The Crazyflie firmware is quite modular so it is not that hard to port, if you are targetting another STM32F4 it should be even easier since most of the peripheral would be identical (this needs to be checked very carefuly, I know that the I2C peripheral for example can change a lot, for the better, between stm32s).
Great_mind
Beginner
Posts: 5
Joined: Mon Sep 27, 2021 2:58 pm

Re: Crazyflie communication protocol

Post by Great_mind »

:o :o Thank you Arnaud


The main main problem I am talking about is porting to another MCU... which will definitely be a very complicated one... because am using another MCU entirely different from the STM32 series... which is the new raspberry pi chip (RP2040)..and I want to port the communication protocol of the crazyflie 2.X...and am using all the sensors from the Crazyflie 1.0 except the baro that am changing from MS5611 to bmp280...and am using same battery charger as crazyflie 2.X...

So, the main problem am looking forward to is the OTA update of the Nrf51822 and the STM32.. because I want to be able to update the RP2040 wirelessly like crazyflie does...how was it implemented and what section of the repository will I find the code?
jonasdn
Expert
Posts: 132
Joined: Mon Mar 01, 2021 3:13 pm

Re: Crazyflie communication protocol

Post by jonasdn »

Hi Great_mind!

For the OTA update of the nrf and the stm32 you can look at the https://github.com/bitcraze/crazyflie-lib-python, search for flash_full and start there. And then for you can look at the code in https://github.com/bitcraze/crazyflie2-nrf-bootloader for flashing the nrf and https://github.com/bitcraze/crazyflie2-stm-bootloader for flashing the stm.

There is also some interaction for entering bootloader in the https://github.com/bitcraze/crazyflie2-nrf-firmware and https://github.com/bitcraze/crazyflie-firmware repositories.

Happy hacking!
Great_mind
Beginner
Posts: 5
Joined: Mon Sep 27, 2021 2:58 pm

Re: Crazyflie communication protocol

Post by Great_mind »

Hello jonasdn....
And thanks for the tip..

But the flash_full section in the python library is under which section of the repository...is it crtp or drivers?
jonasdn
Expert
Posts: 132
Joined: Mon Mar 01, 2021 3:13 pm

Re: Crazyflie communication protocol

Post by jonasdn »

Great_mind
Beginner
Posts: 5
Joined: Mon Sep 27, 2021 2:58 pm

Re: Crazyflie communication protocol

Post by Great_mind »

Thanks I will check it out..
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Crazyflie communication protocol

Post by arnaud »

Interesting project!

Just a note: the bootloader is actually documented! There is some doc of the implemented packets; https://www.bitcraze.io/documentation/w ... hitecture/. Looking at the implementation of the bootloader is a good start as well, the point is to implement the different required commands, once all the commands are implemented the lib should work with your bootloader.

I played around with implementing a minimal stm bootloader in rust and the core or it, the command handler, is not that complex: https://github.com/ataffanel/crazyflie2 ... col.rs#L51.
Great_mind
Beginner
Posts: 5
Joined: Mon Sep 27, 2021 2:58 pm

Re: Crazyflie communication protocol

Post by Great_mind »

Another problem I have is RP2040 has UF2 boot-rom...so am working my way about it...so... writing a new boot loader is doable.

Thanks for the help...am going through the documentations already..
Post Reply