9 years, 10 months ago.

nRF51822 Stopped executing downloaded programs

Hello,

I have a nRF that stopped executing downloaded programs - it was working. The MBED and MBED LOADER drives do show up as you would expect. The bootloader image is up to date. Holding down the reset switch for >5 seconds doesn't seem to fix anything.

Programs download ok, but the reset switch doesn't get the new program started. Right after download, a file "fail.txt" appears. The file contents is 13 bytes, contents: "RESERVED BITS". The file stays after reset, but disappears after a power cycle.

Even this simple program no longer works:

#include "mbed.h"

DigitalOut myled(LED1);

int main() {
    while(1) {
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
    }
}

...kevin.

I have found the problem...

Thinking I had a dead device, I went out and purchased another nRF51822 module. I downloaded my program and it failed also. Looking at fail.txt, the error this time was TIMEOUT. hmmm... a different error. So on the new module, I upgraded the bootloader. I then downloaded my program again and this time I got the RESERVED BITS error in the fail.txt file. Same error as with the other nRF I have.

The original TIMEOUT error from the old bootloader made me suspicious. This time I compiled the program and downloaded the .hex file directly to my local drive first. I then copied the file to the nRF51822. Woo Hoo!! It works :) Now I have 2 working nRF51822 boards.

For some reason, the direct compile/download to the nRF has a problem. I am on a corporate network, so the path to mbed.org may have a many hops. I have not seen this problem occur with any other mbed product I have.

...kevin

posted by Kevin Braun 11 Jun 2014

Till now I am facing the same problem but for me error code is different as SWD ERROR in fail.txt.

posted by Anindya Gayen 13 Feb 2017

1 Answer

9 years, 10 months ago.

Hello,

have you tried to connect through debugger (CMSIS-DAP) using uVision? Download flash-size limited version (unregistered) and try that one. There's option to erase entire flash, which could fix the issue..

what about pyOCD? Does it connect to the chip? There are also commands available which could read/write to the flash, means you can read the flash to see what is the state of important registers, or erase the chip.

I usually for this type of problems, connect external debugger (jlink for example) and erase the chip.

Regards,
0xc0170

Accepted Answer

The only tool I have available to me is mbed. I thought the bootloader update was suppose to allow you to erase the BLE chip?

...kevin

posted by Kevin Braun 10 Jun 2014

Run pyOCD (haven't tested it yet with this chip yet). Does openOCD support this chip? that could be also another chance for you to get some more info.

posted by Martin Kojtal 10 Jun 2014

See my solution above,

...kevin

posted by Kevin Braun 12 Jun 2014