cancel
Showing results for 
Search instead for 
Did you mean: 

RTC seems to be always enabled - hard fault

sailorembedded
Associate III

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:

sailorembedded_0-1702337905844.png

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.

6 REPLIES 6
sailorembedded
Associate III

Oh, it might as well as be SysTick, since it is -1 and it only shows the last two bits of the IRQ...

Nope, it is not.

TDK
Guru

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.

 

If you feel a post has answered your question, please click "Accept as Solution".

Hi, thanks for replying

 

Than it is warns it is pending a "Hard Fault" ? I was assuming a hard fault would just happen.

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.

If you feel a post has answered your question, please click "Accept as Solution".

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.