cancel
Showing results for 
Search instead for 
Did you mean: 

Hard Fault occurs when using Sx1262 LoRa Module with STM32L496ZGTP

vbk22398
Senior

When Debugging the code in STM32 Cube IDE, the program execution flow directly goes into the HardFault Handler. The Debugging starts at HardFault Handler and I don't know why? Also this happened when I am trying to interface Sx1262 LoRa Module with STM32L496ZGTP. If anyone have come across similar issues please help me in this concern.


Thank You

1 ACCEPTED SOLUTION

Accepted Solutions
vbk22398
Senior

@SofLit The issue is resolved. I did not write the return condition in all the functions properly with pointers. The actual issue was that, before that I did dereference a NULL pointer. So since I wrote a condition in all the functions involving pointers, the Hard Fault was omitted. Thanks for the reply.

View solution in original post

4 REPLIES 4

Perhaps you can just unpack the processor registers and see what it's objecting too?

Likely to be unrelated to the use of the SX1262, and everything to do with your code, buffers, alignment, etc.

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

Thanks @Tesla DeLorean . I want an example code integrating Sx1262 with STM32. I tried many examples but couldn't find a suitable one. Please if you know any code let me know. 

Thanks

Hello,

What about the stack size? did you try to increase it?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
vbk22398
Senior

@SofLit The issue is resolved. I did not write the return condition in all the functions properly with pointers. The actual issue was that, before that I did dereference a NULL pointer. So since I wrote a condition in all the functions involving pointers, the Hard Fault was omitted. Thanks for the reply.