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

51822 does not work outside of debugger

I have been able to successfully load and run a colleague's firmware (worked perfectly) and make my own modifications (worked perfectly) but after recently leaving it powered down for a couple of hours and then returning to it, the nrf51822 will run correctly when debugging, or after just having flashed it with nrfjprog but as soon as the debugger is detached/the power is cycled then it just doesn't run.

Our application normally sleeps, drawing about 3.3ua, but after a reset the application is obviously not running and it draws about .5ma. Nrfgo studio is acting flaky, not responding and lots of j-link DLL errors, same thing with Keil. I can usually connect it successfully by applying power before connecting to the JTAG interface rather than after.

As in devzone.nordicsemi.com/.../ I get the same error from nrfjprog when running nrfjprog --pinreset which is the error:

ERROR: JLinkArm.dll returned an error condition. Try again. If the condition per sists, please report the error to Nordic Semiconductor support with the text "pi n_reset_ignore_pall: return code 8".

My nrfjprog version is Version: 5.2.0.45203

While nrfgo studio is not responding the red led on the J-LINK lite flashes, which I have never seen before.

Nothing has changed with our setup as far as I can tell, it's extremely odd.

I can tell that the application is running because it clicks a peizo. I will also just clarify my process: --1 In Keil, I start the debugger, the application is written to flash and verified successfully. Bootloader runs and beeps the peizo, and then the application is running, because I can hear the peizo. If I stop debugging, then where it would normally do a "reset"...nothing happens. I can't hear the application running anymore and since the debugger is detached I can't see what's going on there, either.

--2 I run a batch file for loading on softdevice + application + bootloader with nrfjprog, which successfully writes to flash and verified. Following programming, I can hear that the bootloader ran successfully and that the application is running successfully. I can disconnect the JTAG line (and this behavior also applies to Keil if I disconnect the JTAG line instead of stopping debugging) and once disconnected, I can still hear the application running. However, as soon as I power cycle...nothing. .5ma draw, but not much else.

The nrjprog --pinreset does actually reset the device however, and it is functional even when disconnected from JTAG right up until a power cycle.

  • Have been trying to get it to work. Once programmed (via nrfjprog or Keil flash/debug), resetting the device resulting in it booting and running the application normally, but a power cycle always results the device failing to boot (can't hear bootloader beep the peizo) and the device just draws a constant .5ma, as I've mentioned.

    Is this the sign of a busted chip? It's so weird that it works immediately after programming and on resets after that until a power cycle...

  • Still can't think of any solution, I've double checked as much as I can, the Keil memory maps etc check out. The only aberration I could see was that my UICRBOOTLOADER points to 0xC000 0x0003, which I believe is correct, but my UICRCLENR0 is 0xFFFFFFFF....which I don't think is correct..?

    And by this I mean, I have no clue as to what's going on. On Wednesday I will be returning to work and I will be testing with another couple of chips to see if it is a hardware or a software problem...quite frustrating since it was working absolutely perfectly until it got left alone and then this problem cropped up...

  • Can you try without the DFU. I suspect the DFU did not see your firmware as valid so it stays in DFU mode. You can scan with to see if it showes up as DfuTag after power cycle.

  • I am not using DFU mode in the bootloader yet, I'm using nrfjprog to flash softdevice application and bootloader all at once, or using Keil to flash before debug using nrfjprog, too.

    I have tried a simple "led blink" application. It behaves in the same way, works right after a flash, still works after a nrfjprog --reset but completely fails (and never works again unless I reflash the chip) if I power cycle or if I nrfjprog --pinreset.

  • This is what happens when using nrfjprog to reset after flash: C:\Users\User>nrfjprog --reset Applying system reset. (Device resets and application still works) C:\Users\User>nrfjprog --reset Applying system reset. (Device resets and application still works) C:\Users\User>nrfjprog --pinreset Applying pin reset. ERROR: JLinkArm.dll returned an error condition. Try again. If the condition per sists, please report the error to Nordic Semiconductor support with the text "pi n_reset_ignore_pall: return code 8". (Device resets because I can hear a beep but then application stops running because the beep stops, it requires a power cycle before it will talk to the J-Link again and even then the application still does not run, subsequent commands time out and J-Link lite blinks red led) C:\Users\User>nrfjprog --reset ERROR: Cannot connect to the nRF51 device.

Related