Flashing everything from scratch

Firmware/software/electronics/mechanics
Post Reply
formica
Beginner
Posts: 11
Joined: Tue Apr 28, 2015 2:30 pm

Flashing everything from scratch

Post 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
formica
Beginner
Posts: 11
Joined: Tue Apr 28, 2015 2:30 pm

Re: Flashing everything from scratch

Post 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.
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: Flashing everything from scratch

Post 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?
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Flashing everything from scratch

Post 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.
formica
Beginner
Posts: 11
Joined: Tue Apr 28, 2015 2:30 pm

Re: Flashing everything from scratch

Post 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!

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

Re: Flashing everything from scratch

Post 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?
formica
Beginner
Posts: 11
Joined: Tue Apr 28, 2015 2:30 pm

Re: Flashing everything from scratch

Post 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.
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: Flashing everything from scratch

Post 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.
Post Reply