This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can't erase bootloader.

Hi,

I'm trying to debug my program after trying out the DFU example (specifically dfu/bootloader/pca10040/dual_bank_serial_s132).

Using my Segger J-Link, I run 'erase'. Then I power-cycle the chip, actually pulling out and plugging in the power to our prototype nRF52832 board.

So far, so good.

However, after I reprogram the SoftDevice S132 2.0.0 hex file to the chip, and 'r'eset and 'g'o, the old DFU bootloader starts running immediately again.

Does 'erase' not wipe out the Bootloader flash area and MBR?

Note: I had to change my Bootloader linker file to have a flash region starting at 0x79000 and size 0x5000, because any modifications I made to the Bootloader wouldn't fit in the 0x4000 size.

Thanks, Max

Update 1:

Weirdness, after an explicit erase, the second loadfile should not have found my app already in flash.

J-Link>r
Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
J-Link>g
J-Link>erase
Erasing device (nRF52832_xxAA)...
Erasing flash     [100%] Done.
Verifying flash   [100%] Done.
J-Link: Flash download: Total time needed: 0.509s (Prepare: 0.161s, Compare: 0.000s, Erase: 0.265s, Program: 0.000s, Verify: 0.000s, Restore: 0.082s)
Erasing done.
J-Link>loadfile /home/max/devsrc/minibrain/nRF5_SDK_11.0.0_89a8197/components/softdevice/s132/hex/s132_nrf52_2.0.0_softdevice.hex
Downloading file [/home/max/devsrc/minibrain/nRF5_SDK_11.0.0_89a8197/components/softdevice/s132/hex/s132_nrf52_2.0.0_softdevice.hex]...
Comparing flash   [100%] Done.
Erasing flash     [100%] Done.
Programming flash [100%] Done.
Verifying flash   [100%] Done.
J-Link: Flash download: Flash programming performed for 1 range (159744 bytes)
J-Link: Flash download: Total time needed: 3.074s (Prepare: 0.159s, Compare: 0.106s, Erase: 0.030s, Program: 2.689s, Verify: 0.005s, Restore: 0.083s)
O.K.
J-Link>r
Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
J-Link>g
J-Link>loadfile _build/nrf52832_xxaa_s132.hex
Downloading file [_build/nrf52832_xxaa_s132.hex]...
Comparing flash   [100%] Done.
Verifying flash   [100%] Done.
J-Link: Flash download: Flash download skipped. Flash contents already match
O.K.
J-Link>r
Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
J-Link>g
J-Link>

This is all being done with a J-Link Base:

Firmware: J-Link V10 compiled Mar 29 2016 18:45:53
Hardware: V10.00

J-Link>
Related