RTC1_IRQHandler triggered before main with nRF5340

I try to migrate a working code from nRF52832 to nRF5340 with the use of 7002 companion chip for the network part (BLE). However, while I can jump to main and successfully run the program on nRF52, the RTC1_IRQHandler is triggered before I jump to main on nRF5340, and I fall into infinite wfi or even the default NMI handler. It ss because I call a custom function in the IRQ handler that hasn't been initialized yet :

At this point, mTimer is NULL so maybe this is why my functions are being populated weirdly. The thing is, I fall here : 

If I don't test mTimer I end up in the default NMI handler forever.

The prj.conf of the nrf52 and nrf53 are very similar. 

pjr_nrf5340.conf: 

prj_nrf52.conf : 

The things that differs the most is that I use the 7002 as companion chip. I know this guy is responsible for some pre-main initializations. I tried to debug the nrf53_sync_rtc sample after adding RTC1_IRQHandler, and I don't have the issue : I first jump into the main, and after the IRQ_CONNECT, I break in the IRQ_Handler.

Can someone explain please? Thank you for you help

  • Hi,

    Let me stop you in the first sentence:

    I try to migrate a working code from nRF52832 to nRF5340 with the use of 7002 companion chip for the network part (BLE).

    The nRF7002 does Wi-Fi, not Bluetooth Low Energy. Is this a typo or?

    Regards,
    Sigurd Hellesvik

  • Hi,

    Yes absolutely, I mistook 7002 with the network core of the nRF5340, my bad. It is indeed different. I currently use the app core and the network core of the nRF5340. Anyway, I realized that Zephyr might use RTC1 for itself, I put myself on the RTC2 and it seems to be fine. I still have some issues but seems not related to RTC1. Thank you for your answer