I was trying to flash an firmware on my nrf51822 module from Nordic SDK example, I concatenated the bin file with the s110 file and it worked fine. Now, when I went ahead to flash the bin file, here’s what I got (I followed the wiki http://github.com/RIOT-OS/RIOT/wiki/Boa … a-nrf51822)
> flash probe 0
nRF51822-QFAA(build code: Gx0) 256kB Flash
flash 'nrf51' found at 0x00000000
> flash banks
#0 : nrf51.flash (nrf51) at 0x00000000, size 0x00040000, buswidth 1, chipwidth 1
#1 : nrf51.uicr (nrf51) at 0x10001000, size 0x00000000, buswidth 1, chipwidth 1
for some reason, I have no idea why size 0x00000000
… any clue?
If I do
> nrf51 mass_erase
> flash banks
#0 : nrf51.flash (nrf51) at 0x00000000, size 0x00040000, buswidth 1, chipwidth 1
#1 : nrf51.uicr (nrf51) at 0x10001000, size 0x00000100, buswidth 1, chipwidth 1
Now when I try to flash the firmware, I get the following:
> flash write_image erase ~/NRF51822/Board/pca10001/s110/ble_app_proximity/gcc/_build/test.bin 0
auto erase enabled
Padding image section 0 with 12596 bytes
using fast async flash loader. This is currently supported
only with ST-Link and CMSIS-DAP. If you have issues, add
"set WORKAREASIZE 0" before sourcing nrf51.cfg to disable it
jtag status contains invalid mode value - communication failure
error waiting for target flash write algorithm
Failed to enable read-only operation
Failed to write to nrf51 flash
error writing to flash at address 0x00000000 at offset 0x00000000
Previous state query failed, trying to reconnect
It’s driving me crazy, I have no clue why that’s happening. I couldn’t get it to work.
Note: I have an STLink-v2 dongle, no STM32 board involved. I also updated the stlink-v2 firmware using stlink utility.
One last thing, the test.bin file I’m using is basically the output of the following (using S110 v6 and example from sdk v6):
srec_cat ~/Downloads/s110_nrf51822_6.2.1/s110_nrf51822_6.2.1_softdevice.hex -intel ble_app_proximity_s110_xxaa.hex -intel -o ./test.bin --line-length=44