ncs wdt handler

How to use a custom wdt interrupt routine in ncs, because I need to record my pc pointer in the wdt interrupt routine, just like in nrf5 sdk:

void WDT_IRQHandler_real(uint32_t *sp)
{
    /* PC is sp[6]*/
    //R0、R1、R2、R3、R12、LR、PC、XPSR
    uint32_t pc_address = sp[6];
    if (nrf_wdt_event_check(NRF_WDT_EVENT_TIMEOUT))
    {
        nrf_wdt_event_clear(NRF_WDT_EVENT_TIMEOUT);
    }
    ram_remain_info.wdt_pc_addr = pc_address;
    //remian_info_sync();
}

void WDT_IRQHandler(void) __attribute__((naked));
/* Cortex M3/4 */
void WDT_IRQHandler()
{
    asm volatile(
        "TST   LR, #4\n\t"
        "ITE   EQ\n\t"
        "MRSEQ R0, MSP\n\t"
        "MRSNE R0, PSP\n\t"
        "LDR   R1, =WDT_IRQHandler_real\n\t"
        "BX    R1");
}

Parents Reply
  • Hi, 

    Sigurd is out of the office, so I take this case. 

    If the register content is corrupt, it could be an indication of a stack overflow. but then you should be storing the information from the error handler. 

    Do you have CONFIG_RESET_ON_FATAL error enabled or disabled?

    We are currently understaffed due to the summer vacation period, so delayed replies must be expected. I am sorry about any inconvenience this might cause.

    Regards,
    Amanda H.

Children
No Data
Related