Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Need to "Erase All" before I can run project without crashing.

Hi all,

I'm working on a project in SDK 5 (V17.0.2) on a custom board using a raytac nrf52840 module. IDE is segger embedded studio with a J-Link interface to the hardware.

The project has been going for a while and the code has been in a reasonably stable state.

Just recently the project has gone into a "phase" where I cannot reload new code unless I first "Erase All" flash. This is a new situation, previously I could happily reload code and continue debugging.

Now, if I write new code (or even stop and restart without code changes) and try to run in debug mode without "Erase All", the code hangs in drv_rtc_init()  at NVIC_EnableIRQ(RTC1_IRQn)

I have 2 timers running under app_timer - nothing has really changed there between when it was working normally and now.

If anyone has any ideas, it would be much appreciated.

Regards,

Carl Kamper.

Parents
  • Hello,

    Where in drv_rtc_init() is it that the code hangs? In the call to NVIC_EnableIRQ() itself? Is this something that I can replicate using a DK? Do you see it in other examples using the RTC? 

    Are you using the watchdog timer?

    Best regards,

    Edvin

  • Thanks for your reply Edvin.

    Yes, It is the call to NVIC_EnableIRQ() where the code hangs. I'm not using a watchdog timer at the moment.

    I have traced the problem to a call to nrf_gpio_pin_set() which turns on a relay. Once the code progresses past this point, it cannot be restarted in the debugger without Erasing Flash.

    I don't know if the relay is creating some type of power disturbance (although it does have a back-emf diode on the coil).

    The problem is exceedingly strange and I will investigate further but for now I can work on the code.

    Regards,

    Carl.

Reply
  • Thanks for your reply Edvin.

    Yes, It is the call to NVIC_EnableIRQ() where the code hangs. I'm not using a watchdog timer at the moment.

    I have traced the problem to a call to nrf_gpio_pin_set() which turns on a relay. Once the code progresses past this point, it cannot be restarted in the debugger without Erasing Flash.

    I don't know if the relay is creating some type of power disturbance (although it does have a back-emf diode on the coil).

    The problem is exceedingly strange and I will investigate further but for now I can work on the code.

    Regards,

    Carl.

Children
No Data
Related