cancel
Showing results for 
Search instead for 
Did you mean: 

Hard fault when recieving uart RX interrupt

nejcokle
Associate
Posted on May 21, 2016 at 17:43

Hello.

As my title says, i keep getting hard fault when i get interrupt.

Now when debugging, i see that interrupt happend, i get into the function to recieve rx content ( UART_Receive_IT ) but when i come to line :

    else

    {

      *huart->pRxBuffPtr++ = (uint8_t)(huart->Instance->RDR & (uint8_t)uhMask); 

    }

i get a hard fault. 

I implemented uart example for my nucleo-l073rz to my existing project (also using HAL drivers) which uses RTOS.

Best regards,

Nejc

#nucleo-l073rz #rtos #stm32cube
1 REPLY 1
Posted on May 21, 2016 at 18:19

Ok, and doesn't that suggest to you that the pointer(s) you are attempting to use are bogus, or unaligned for type on the Cortex-M0.

Why don't you sanity check the pointers first, before writing.

Also make sure you initialize the structure and pointers, before enabling interrupts that might use them?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..