Syson/Sysoff/rebootToBootloader in crazyflie_server

Discussions about all things Bitcraze
Post Reply
meyigo2018
Beginner
Posts: 10
Joined: Wed Jun 14, 2017 1:43 pm

Syson/Sysoff/rebootToBootloader in crazyflie_server

Post by meyigo2018 »

Hi,

I'm integrating Syson/Sysoff/rebootToBootloader function into crazyflie_server.cpp. These functions work only when crazyflie is on. It seems that the packets cannot be received when it's off.It doesn't make sense. I thought the nrf chip is on at all time and it should receive the packets.

Besides, after I set the crazyflie to bootloader mode, the radio couldn't find the bootloader anymore. It works for pressing the button though.

I just added the function into Crazyflie.cpp. Is there anything else I need to do? BTW, I'm using the latest nrf firmware.

Thanks in advance!

Tracy
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Syson/Sysoff/rebootToBootloader in crazyflie_server

Post by arnaud »

Hi Tracy,

The nrf chip is always powered but when the Crazyflie is off the nrf chip is in low power mode (I think it is called suspended mode in the nrf terminology), it means that only a reset or wakeup pin activity (ie. the button) can wake-up the nrf. So the nrf is essecially switched off as well.

Now, it would be possible to switch ON the nrf at regular intervals to listen to the air for a wake-up call, there is a low power oscillator and a timer that can achieve that. This is (as far as II understand) how log power bluetooth device are implemented. In the case of Crazyflie the power amplifier will have to be powered too which consumes a bit more but if it is done seldom enough (like every couple of seconds), it should not consume much in average.

For the bootloader, the reason is that when you restart to bootloader, the bootloader will take a random address (in crazyflie2 it uses the NRF bluetooth address which is unique to each nrf chip). This is a great thing because it pretty much guarantee that two bootloader will not collide if two crazyflie are being flashed at the same time. The reset init packet sends back the radio address where the bootloader will be present. It is implemented there in the nrf: https://github.com/bitcraze/crazyflie2- ... ain.c#L414. For an example of how to use it you can look a crazyserver (in go) that implements it already: https://github.com/mikehamer/crazyserve ... oot.go#L55
Post Reply