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

CPU cannot be halted

Hi to everyone!

I am using nRF52832 driven by nRF52 DK and a sensor from Maxim Integrated. As debug output i am using the RTT viewer and as IDE Keil.

When i run my code it seems to work properly but when i use the sensor (it is a like a photodetector and a led, so when i move the finger on it this will cause an interrupt) the outputs on the RTT viewer stops and i ends up to the "**JLink Warning: CPU could not be halted" warning as shown:

  

Even if the output of the RTT stops i can see that the sensor is continue to work properly, when my finger is detected a led  is set high. 

Where this error come from? Is it a problem of the RTT window (LOG) only? if it is not, why my sensor continue to work as defined?

Thanks,

polimarte

Parents
  • Hi,

    Could be that the chip resets due to an error. Please have a look at the debugging procedure described in this thread, and see if that helps with your problem.

    Best regards,
    Jørgen

  • It couls also be caused by a HardFault..

    Can you put breakpoints in your code to find exactly which function call is causing this problem? If this happens when your finger is detected by the sensor, I would start with the interrupt handling in the sensor libraries/drivers, and see how far it gets from this point. Note that if you have a softdevice enabled, you need to restart the application once you hit a breakpoint, attemping to step further will normally cause an assert in the softdevice.

  • Probably i am missing something at the basics. Unfortuanately I am a newbie in embedded system. I can debug entirely my code without any error. I have put several APP_ERROR_CHECK in all over the code. This sensor as well as the SDA and SCL use two pins, RST and MFIO. This last pin after the initialization of the sensor must be set as interrupt input pin. This pin is set high when there is finger detection from the sensor. While i am debugging all seems to work properly till when i put the finger on it, triggering the interrupt and giving this error. Can be a problem of interrupt configuration on the sdk_config? i don't have any handler for the interrupt. I am using a sensor hub which communication is defined as host command/ slave response with i2c.

    Even if the output of the RTT stops i can see that the sensor is continue to work properly, when my finger is detected a led  is set high.

    How is that possible? My finger detection still trigger the MFIO pin also after the stop. Is this a normal behavior? 

    Thanks for the help,

    polimarte

  • polimarte said:
    Even if the output of the RTT stops i can see that the sensor is continue to work properly, when my finger is detected a led  is set high.

    How is that possible? My finger detection still trigger the MFIO pin also after the stop. Is this a normal behavior? 

    Hard to say without having a look at your project. The only thing I can think about is that the application is stuck in an interrupt with lower priority than the interrupt handler for the MFIO pin, or the LED is set through PPI and GPIOTE (or the LED and the MFIO pin is the same GPIO, causing the LED to blink when the pin is set by the sensor).

    You did set the DEBUG flag, and set a breakpoint in the app_error_fault_handler, to catch any errors? Does the Disassembly window show you where your application is when this problem occurs, or do you fully lose the debug connection?

  • Hi i am sorry to have open a post about this, it was an hardware problem. Unstable voltages leads to very strange errors on the code that i could not understand. 

    Thanks,

    polimarte

Reply Children
No Data
Related