How can I use IRQHandler in Zephyr?

Hello, I would like to use RTC2_IRQHandler in Zephyr environment.



However, each time an RTC interrupt is called, the entire system shuts down and reboots.



How can I use the RTC_IRQHandler?



Here's my source code.

main.cpp

RTC.cpp

Parents
  • Here is my RTT viewer

    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0
    CLOCK : 993
    CLOCK : 1986
    CLOCK : 2979
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
    RIDERLOG LTE Device Firmware : 0.9.5
    Board Version : Release 5
    CLOCK : 0

  • I don't see the IRQ_CONNECT() macro that connects the handler function to the actual interrupt.

    I suspect the device resets because it runs into an unhandled interrupt.

    You should also use the irq_enable() funtion instead of calling those NVIC_xxx functions directly. They can do more in zephyr OS.

Reply
  • I don't see the IRQ_CONNECT() macro that connects the handler function to the actual interrupt.

    I suspect the device resets because it runs into an unhandled interrupt.

    You should also use the irq_enable() funtion instead of calling those NVIC_xxx functions directly. They can do more in zephyr OS.

Children