Page 1 of 1

Flashing everything from scratch

Posted: Tue Feb 16, 2016 12:37 pm
by formica
Hi guys,
I'm trying to hack my CF2 using an SWD programmer (from the ST nucleo board) and openocd.
I can flash the software easily using either openocd via telnet or using the Makefile (make flash etc etc.).

I'm experiencing a lot of trouble with the firmware...

I have flashed, in this order:
- crazyflie2-stm-bootloader (Release version) on the STM32F4
- crazyflie-firmware-2015.08.1 (Release version) on the STM32F4

Next on the NRF51 I have flashed everything from:
- crazyflie2-nrf-firmware-2015-08.1 (Release version) using 'make factory_reset'

At the end of this procedure I obtain a BLUE LED (that one connected to the NRF) stucked on and anything else.
Meausuring with the tester it seems the NRF does not enable the cortex's voltage regulator and the cortex doesn't run.

If I mass erase the NRF flash the cortex run and the RED led flash 5 times.

So, any idea?
Thanks in advance
Roberto

P.S. Openocd returns me the following warning but I do not think is related with my issue

Code: Select all

Warn : Unknown device (HWID 0x00000057)
Warn : using fast async flash loader. This is currently supported
Warn : only with ST-Link and CMSIS-DAP. If you have issues, add
Warn : "set WORKAREASIZE 0" before sourcing nrf51.cfg to disable it

Re: Flashing everything from scratch

Posted: Tue Feb 16, 2016 3:43 pm
by formica
I have tried etiher compiling the NRF firmware with BLE=0 and without. Same results... the board is stucked with the nrf BLUE LED on.

I mass erased everything from the two chips, so I have to flash all from scratch.

Re: Flashing everything from scratch

Posted: Wed Feb 17, 2016 2:37 am
by chad
formica wrote:I have tried etiher compiling the NRF firmware with BLE=0 and without. Same results... the board is stucked with the nrf BLUE LED on.

I mass erased everything from the two chips, so I have to flash all from scratch.
If you flash the NRF and STM firmware from the latest release, do you still have the problem?

Are you using the Bitcraze 0.6 VM to build your firmware?

Re: Flashing everything from scratch

Posted: Wed Feb 17, 2016 6:32 am
by arnaud
Hi,

For some reason flashing the firmware after the debugger erases the debugger on the STM32. This order will work:

On the nRF51:
- make factory_reset

On the STM32:
- Flash firmware (optional, you can bootload it, this is what we do in factory)
- Flash the bootloader.

Then it should work. We have had this problem for a while but since I mostly use the bootloader to flash anyway I never investigated why openocd erses the debugger.

Re: Flashing everything from scratch

Posted: Wed Feb 17, 2016 9:39 am
by formica
Hi arnaud,
thanks for the answer.

Unfortunately I cannot flash the STM32 after the NRF: it seems that openocd doesnt't connect at all to the STM32 if there is something in the NRF flash (conversely, if I mass_erase the NRF flash I can connect again). Strange!

:(

Re: Flashing everything from scratch

Posted: Wed Feb 17, 2016 10:52 am
by arnaud
Then you should try to flash only the bootloader in the STM anyway.

There has been some programming issues if the Crazyflie is USB powered. We usually only battery power it in factory, do you have the battery connected?

Re: Flashing everything from scratch

Posted: Wed Feb 17, 2016 4:11 pm
by formica
No way!

I have followed your order, with this procedure:

1) flashed crazyflie2-nrf-firmware (release version) on the NRF: 'make' + 'make factory_reset'
2) I had to halt the NRF by hand (through openocd 'reset halt')
3) flashed crazyflie2-stm-bootloader (release version) on the STM32F4: 'make' + 'make flash'
4) flashed crazyflie-firmware (release version) on the STM32F4: 'make' + 'make flash'

The blue led still remain stucked ON (turning on as soon as I connect the battery, without pressing the button) and the crazyradio-PA doesn't see the copter.
The button doesn't work at all.
I cannot program the STM32 without plugging in the USB.

If I remove the firmware from the NRF the cortex seems to start and RED LED blink periodically 5 times.

Any Idea?
Maybe I have to compile the NRF firmware with BLE or S110 flag ON/OFF or the CF2 firmware with DEBUG or CLOAD flag ON/OFF?

P.S. @chad: I'm not using the VM but the arm-none-eabi toolchain from launchpad, version suggested by bitcraze, on ubuntu 13.

Re: Flashing everything from scratch

Posted: Tue Mar 15, 2016 8:03 pm
by whoenig
I just flashed everything as well with the following procedure:

1)

Code: Select all

make factory_reset
for crazyflie2-nrf-firmware. Note that this has BLE=1 and S110=1 by default
2)

Code: Select all

make flash
for crazyflie-firmware. Note that this has CLOAD=1 on by default
3)

Code: Select all

make flash
for crazyflie2-stm-bootloader

I have to flash the stm-bootloader after the firmware (flashing the firmware overrides the bootloader). I am using a J-LINK EDU for flashing.