2023-12-11 03:43 PM
Hi,
I got a Nucleo F103RB, and I am running the very same software I run on my Nucleo F7ZI, and I am getting this weird hard fault that always. I do not enable RTC, but right before the fault happens, the ICSR register tells there is a pending interrupt, number 3, that is the RTC:
I am inside an SVC Handler. I haven't enabled the RTC timer. I have tried to disable it, have also tried handle the interrupt, with no success. Am I being deceived by the debugger?
Any help is much appreciated,
Thank you.
2023-12-11 03:44 PM
Oh, it might as well as be SysTick, since it is -1 and it only shows the last two bits of the IRQ...
2023-12-11 04:03 PM
Nope, it is not.
2023-12-11 05:39 PM
Subtract 16 from VECTPENDING/VECTACTIVE to find the corresponding IRQn_Type.
0xE is -2 which is PendSV_IRQn
0x3 is -13 which is HardFault_IRQn.
2023-12-12 02:42 AM
Hi, thanks for replying
Than it is warns it is pending a "Hard Fault" ? I was assuming a hard fault would just happen.
2023-12-12 08:14 AM
Yep, I would have thought so too. It's very interesting. Does it happen eventually if you keep stepping through?
Regardless, doesn't look RTC related to me.
2023-12-12 08:20 AM
Yes, it does happen. Regarding the RTC, as you pointed out I was misreading the ICSR information. Didn't even realise I was already within a PendSV and not an SVC. It is happening when I call a PendSV from an SVC, but the breakpoint does not enter the PendSV handler.