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

NRF51822 stopped working but can still be flashed

Hello, I have 4 NRF51822 modules, 2 stlink programmers, and a BLE400 board, I was using the same module with the same stlink each time, but the led on the board stopped lighting, after a flash, as I was testing different libraries I thought it was that, I tried to go back without success, then I tried another module, another stlink but nothing worked even if flash succeeds each time.

I supposed the board was broken, so I tried another more module without the board, the bluetooth worked before I flash but not after. I also tried to reflash the bootloader and a precompiled program with bluetooth feature, flashing succeed but the bluetooth doesn't work.

I don't know what to test, I need help.

Thank you

Parents
  • Sorry for the lake of details, I'm retrying with the raspberry and openocd and give you the output:

    [code]> halt
    target halted due to debug-request, current mode: Thread
    xPSR: 0x61000000 pc: 0x0001d360 msp: 0x20007ff8[/code]

    [code]> nrf51 mass_erase
    nRF51822-xxxx(build code: xx) 256kB Flash, 32kB RAM
    Mass erase completed.
    A reset or power cycle is required if the flash was protected before.[/code]


    [code]> flash write_image s130_nrf51_2.0.1_softdevice.hex
    Flash write discontinued at 0x000007c0, next section at 0x00001000
    not enough working area available(requested 34)
    no working area available, falling back to slow memory writes
    not enough working area available(requested 34)
    no working area available, falling back to slow memory writes
    wrote 108448 bytes from file s130_nrf51_2.0.1_softdevice.hex in 5.727901s (18.49 0 KiB/s)[/code]

     

    [code]> flash write_image examples/ble_app_proximity_pca10028_s130.hex
    Flash write discontinued at 0x000007c0, next section at 0x00001000
    not enough working area available(requested 34)
    no working area available, falling back to slow memory writes
    Padding image section 1 at 0x0001afe0 with 32 bytes
    not enough working area available(requested 34)
    no working area available, falling back to slow memory writes
    wrote 140004 bytes from file examples/ble_app_proximity_pca10028_s130.hex in 6.899047s (19.818 KiB/s)[/code]

    [code]reset[/code]

    This is the first time I retry with the raspberry and in fact it works, the Nordic_Prox is detected with a bluetooth scan then the NRF51822 is not dead.

    Now I'll try with arduino on Windows 10:

    ...

Reply
  • Sorry for the lake of details, I'm retrying with the raspberry and openocd and give you the output:

    [code]> halt
    target halted due to debug-request, current mode: Thread
    xPSR: 0x61000000 pc: 0x0001d360 msp: 0x20007ff8[/code]

    [code]> nrf51 mass_erase
    nRF51822-xxxx(build code: xx) 256kB Flash, 32kB RAM
    Mass erase completed.
    A reset or power cycle is required if the flash was protected before.[/code]


    [code]> flash write_image s130_nrf51_2.0.1_softdevice.hex
    Flash write discontinued at 0x000007c0, next section at 0x00001000
    not enough working area available(requested 34)
    no working area available, falling back to slow memory writes
    not enough working area available(requested 34)
    no working area available, falling back to slow memory writes
    wrote 108448 bytes from file s130_nrf51_2.0.1_softdevice.hex in 5.727901s (18.49 0 KiB/s)[/code]

     

    [code]> flash write_image examples/ble_app_proximity_pca10028_s130.hex
    Flash write discontinued at 0x000007c0, next section at 0x00001000
    not enough working area available(requested 34)
    no working area available, falling back to slow memory writes
    Padding image section 1 at 0x0001afe0 with 32 bytes
    not enough working area available(requested 34)
    no working area available, falling back to slow memory writes
    wrote 140004 bytes from file examples/ble_app_proximity_pca10028_s130.hex in 6.899047s (19.818 KiB/s)[/code]

    [code]reset[/code]

    This is the first time I retry with the raspberry and in fact it works, the Nordic_Prox is detected with a bluetooth scan then the NRF51822 is not dead.

    Now I'll try with arduino on Windows 10:

    ...

Children
  • Ok, using raspberry to program the NRF51822 seems to always works (but is less practical), after if I upload the program with arduino IDE it seems to work only sometimes, I don't understand why, this is my last fail:

    c:/users/greg/appdata/local/arduino15/packages/sandeepmistry/tools/gcc-arm-none-eabi/5_2-2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: changing start of section .heap by 4 bytes
    c:/users/greg/appdata/local/arduino15/packages/sandeepmistry/tools/gcc-arm-none-eabi/5_2-2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: changing start of section .stack_dummy by 4 bytes
    c:/users/greg/appdata/local/arduino15/packages/sandeepmistry/tools/gcc-arm-none-eabi/5_2-2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: changing start of section .heap by 4 bytes
    c:/users/greg/appdata/local/arduino15/packages/sandeepmistry/tools/gcc-arm-none-eabi/5_2-2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: changing start of section .stack_dummy by 4 bytes
    c:/users/greg/appdata/local/arduino15/packages/sandeepmistry/tools/gcc-arm-none-eabi/5_2-2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: changing start of section .heap by 4 bytes
    c:/users/greg/appdata/local/arduino15/packages/sandeepmistry/tools/gcc-arm-none-eabi/5_2-2015q4/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: changing start of section .stack_dummy by 4 bytes
    Sketch uses 31596 bytes (20%) of program storage space. Maximum is 151552 bytes.
    Open On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10:13)
    Licensed under GNU GPL v2
    For bug reports, read
    	http://openocd.org/doc/doxygen/bugs.html
    debug_level: 0
    0x4000
    adapter speed: 1000 kHz
    nrf51.cpu: target state: halted
    target halted due to debug-request, current mode: Thread 
    xPSR: 0xc1000000 pc: 0x000006d0 msp: 0x000007c0
    ** Programming Started **
    auto erase enabled
    nrf51.cpu: target state: halted
    target halted due to breakpoint, current mode: Thread 
    xPSR: 0x61000000 pc: 0x2000001e msp: 0x000007c0
    wrote 32768 bytes from file C:\Users\Greg\AppData\Local\Temp\arduino_build_403686/Blink.ino.hex in 1.646549s (19.435 KiB/s)
    ** Programming Finished **
    ** Verify Started **
    nrf51.cpu: target state: halted
    target halted due to breakpoint, current mode: Thread 
    xPSR: 0x61000000 pc: 0x2000002e msp: 0x000007c0
    verified 31792 bytes in 0.217847s (142.517 KiB/s)
    ** Verified OK **
    ** Resetting Target **
    shutdown command invoked
    

  • I also tried on windows with openocd:

    xpack-openocd-0.10.0-15>bin\openocd -f "scripts\interface\stlink.cfg" 
        -f "scripts\target\nrf51.cfg" -c init -c "reset halt" 
        -c "flash write_image s130_nrf51_2.0.1_softdevice.hex" 
        -c "flash write_image ble_app_proximity_pca10028_s130.hex 0x1c000" 
        -c reset -c exit

    Outputs:

    xPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev (2020-10-13-17:29)
    Licensed under GNU GPL v2
    For bug reports, read
            http://openocd.org/doc/doxygen/bugs.html
    Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
    Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
    Info : clock speed 1000 kHz
    Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
    Info : Target voltage: 3.255209
    Info : nrf51.cpu: hardware has 4 breakpoints, 2 watchpoints
    Info : starting gdb server for nrf51.cpu on 3333
    Info : Listening on port 3333 for gdb connections
    target halted due to debug-request, current mode: Thread
    xPSR: 0xc1000000 pc: 0x000006d0 msp: 0x000007c0
    Info : nRF51822-QFAA(build code: G2) 256kB Flash, 16kB RAM
    Info : Flash write discontinued at 0x000007c0, next section at 0x00001000
    wrote 108448 bytes from file s130_nrf51_2.0.1_softdevice.hex in 2.089192s (50.692 KiB/s)
    
    Info : Flash write discontinued at 0x0001c7c0, next section at 0x0001d000
    Info : Padding image section 1 at 0x00036fe0 with 32 bytes
    wrote 140004 bytes from file ble_app_proximity_pca10028_s130.hex in 2.673404s (51.142 KiB/s)

    But the device is not detected hover bluetooth. Nothing seems to work on windows.

  • I see. Nordic do not support programming with the stlink, nor OpenOCD når Arduino IDE so I am not in a position to make suggestions. I would recommend using a J-Link (either stand-alone or in form of a nRF5x Development Kit) if you want to use Nordic tools or get support. Alternatively you could ask on Arduino forums or wait and see if someone else on this forum has any suggestions.

Related