Can't read pad from HardFault_Handler?

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
robomancer
Posts: 11
Joined: Mon May 08, 2017 9:34 pm

Can't read pad from HardFault_Handler?

Post by robomancer »

Hi all, I'm making an STM32F4 based board fault tolerant but I'm running into a weird behavior where palReadPad doesn't seem to work within the HardFault_Handler. My suspicion is that HardFault_Handler is so high priority that AHB1 stops ticking and thus new values aren't copied into the IDR. Is there any way to get around this and read a digital pin? Could I manually emit an AHB1 tick to refresh the register?

Edit: adding the following code to the hander did not help

Code: Select all

RCC->AHB1ENR |= 0x7f;
RCC->AHB1LPENR |= 0x7f;
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Can't read pad from HardFault_Handler?

Post by Giovanni »

Hi,

You should be able to use GPIO from hard faul handler without any special handling, assuming GPIO has been already initialized (after calling halInit()).

Giovanni
robomancer
Posts: 11
Joined: Mon May 08, 2017 9:34 pm

Re: Can't read pad from HardFault_Handler?

Post by robomancer »

Thanks for letting me know I'm not crazy! It turns out to have been a hardware problem.
Post Reply