Cannot Communicate with Crazyradio after Flashing NRF51822

Discussions about all things Bitcraze
Post Reply
Sun
Beginner
Posts: 9
Joined: Wed Jun 06, 2018 2:50 pm

Cannot Communicate with Crazyradio after Flashing NRF51822

Post by Sun »

Hi,

I flashed the firmware to a brand new NRF51822 by the command 'make factory_reset'. All of the MCUs in my drone are brand new, meaning no programs or no correct programs have been flashed to them before. The method of flashing is soldering STlink cable to four NRF debug pins on the drone and flashing by STlink. My working environment is BitcrazeVM_2018.01. The files in crazyflie2-nrf-firmware hasn't been modified.

After flashing, I tried to download the code of STM32 by 'make cload' using Crazyradio PA, but it fails, showing 'cannot connect the bootloader'. The 'make cload' method always succeeded when I downloaded the program to the drones whose firmware was flashed by the manufacturer.

I am also not sure about whether the leds were blinking correctly after flashing the NRF51822 firmware. Right after I flashed the nrf firmware, all the lights turned off, except led M2 keeping on. Then I unplugged the stlink cable and connected the battery and tried to make M2 blink slowly by pressing the switch for some time. After that, I executed 'make cload' and it showed 'cannot connect the bootloader'.

I think the communication between crazyradio and crazyflie is not connected. I also tried the DFU method. The drone could enter DFU mode but unfortunately it couldn't be detected by lsusb. The EEPROM also can't be changed by the python script for the device couldn't be detected.

Another strange thing is that during the flashing, error often occured when doing 'make flash'. Executing 'make clean', 'make' and 'make flash' in order after the error occurs can eliminate the error. I don't know the reason for that.

I am really confused by the problem of flashing firmware to NRF51822 and STM32. Is there any difference between flashing to MCUs with correct firmware and without any firmware or with wrong firmware? How can I solve my problem? I am waiting for your response.

Thanks!
Sun
Beginner
Posts: 9
Joined: Wed Jun 06, 2018 2:50 pm

Re: Cannot Communicate with Crazyradio after Flashing NRF51822

Post by Sun »

The pictures shows the error information when using make cload command.
Attachments
1.png
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Cannot Communicate with Crazyradio after Flashing NRF51822

Post by arnaud »

Hi,
First things I am curious about is: for what reason did you need to erase and flash the nRF52?

In order to debug the situation we can start with the basics: find our of the boorloader is working.
- Your flashing method for the nRF51 looks correct. Does all the openocd commands work without any errors? It may be needed to have the battery connected in order to run the factory_reset make target.
- When factory-reset is done properly it should be possible to access the bootloader, if you disconnect all power source, press the button and connect USB or battery (this is better done with 3 hands ;), then release the button when M2 starts blinking. Both M2 and M3 should then blink, if M3 is not blinking you need to build and flash the crazyflie2-stm-bootloader firmware in the stm32. If both blue LEDs are blinking you should be able to use the bootloader.
Sun
Beginner
Posts: 9
Joined: Wed Jun 06, 2018 2:50 pm

Re: Cannot Communicate with Crazyradio after Flashing NRF51822

Post by Sun »

Hi arnaud,

The reason why all the MCUs are brand new is that I remade the PCB board according to the crazyflie schematic documents to add extra functions and change the shape of the drone.

In my trials before, LED M3 never blinks so I need to flash the crazyflie2-stm-bootloader firmware as you said. Then what's the correct method of flashing stm-bootloader firmware? Is it the same as flashing nrf-firmware using nrf swd ports or using the tiny stm32-swd-6p port or other ways?

I only flashed nrf-firmware before and the drone can't communicate with crazyradio. If I only successfully download both nrf-firmware and stm-bootloader-firmware, does these two firmware ensure that I can use make cload to download the stm32 firmware? Now I am not quite sure how many and which firmware do I need to flash to make the drone work.

Last thing is that I did encounter warnings when flashing nrf-firmware. But the flashing seems still succeeds. I don't know whether that will affect.
Sun
Beginner
Posts: 9
Joined: Wed Jun 06, 2018 2:50 pm

Re: Cannot Communicate with Crazyradio after Flashing NRF51822

Post by Sun »

Here is a screenshot showing the last step of make factory_reset.
Attachments
6.png
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Cannot Communicate with Crazyradio after Flashing NRF51822

Post by arnaud »

Once you have the bootloader working on both CPU, you will be able to run "make cload" on crazyflie2-nrf-firmware and crazyflie-firmware. This should be enough firmware to run the drone.
Post Reply