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.

Parents
  • 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.

  • The bootloader address in the UICR @ 0x10001014 UICR.BOOTLOADER is set to 0x3C000 which is the address that I have for the start of ROM for the Keil project for the bootloader, but when I can I will try it completely without the bootloader and report back.

    Just tried it without the bootloader and it still completely fails after a hard/power reset. I don't believe I am ever entering DFU mode on the bootloader, I wish I could use the debugger to see what is going on, but it works perfectly when the debugger is attached!

    Thanks for your help. :)

    Another addition: it seems to come right down to a pin reset/power cycle where it absolutely fails, otherwise the chip works perfect. I might take a video to demonstrate the behavior, if I get some of the other units tomorrow and they perform the same...

Reply
  • The bootloader address in the UICR @ 0x10001014 UICR.BOOTLOADER is set to 0x3C000 which is the address that I have for the start of ROM for the Keil project for the bootloader, but when I can I will try it completely without the bootloader and report back.

    Just tried it without the bootloader and it still completely fails after a hard/power reset. I don't believe I am ever entering DFU mode on the bootloader, I wish I could use the debugger to see what is going on, but it works perfectly when the debugger is attached!

    Thanks for your help. :)

    Another addition: it seems to come right down to a pin reset/power cycle where it absolutely fails, otherwise the chip works perfect. I might take a video to demonstrate the behavior, if I get some of the other units tomorrow and they perform the same...

Children
No Data
Related