Timer.2 interrupt does not set bit in INTERRUPT register

michprev
Posts: 92
Joined: Fri Aug 04, 2017 8:57 pm

Timer.2 interrupt does not set bit in INTERRUPT register

Postby michprev » Sun Jun 24, 2018 3:26 pm

Hi,
I would like to use Timer.2 CPU interrupt. It is priority level 5 interrupt (not C servicable).
I am initializating it like this:

Code: Select all

void System_Time_Init()
{
    uint32_t ccount;
    __asm__ __volatile__ ("rsr.ccount %0" : "=r"(ccount));

    ccount += 10000;
    __asm__ __volatile__ ("wsr.ccompare2 %0" :: "r"(ccount));

    uint32_t intenable;
    __asm__ __volatile__ ("rsr.intenable %0" : "=r"(intenable));

    intenable |= 1u << 16u;

    __asm__ __volatile__ ("wsr.intenable %0" :: "r"(intenable));
}
CPU enters level 5 interrupt vector. There I check that bit 16 in INTENABLE and INTERRUPT registers is set. But when I do

Code: Select all

rsr.interrupt a0
a0 contains 0x0 (no interrupts triggered). Isn't it strange? The only interrupt that does not set bit in INTERRUPT register should be NMI.

michprev
Posts: 92
Joined: Fri Aug 04, 2017 8:57 pm

Re: Timer.2 interrupt does not set bit in INTERRUPT register

Postby michprev » Mon Jun 25, 2018 9:23 am

Probably bug in OpenOCD/GDB. Will post it on https://github.com/espressif/openocd-esp32.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 105 guests