cancel
Showing results for 
Search instead for 
Did you mean: 

HardFault_Handler() at stm32l4xx_it.c:61 0x8000882 in STM32CUBEL4 proximity example

Sundar santhanam
Associate II

https://github.com/STMicroelectronics/STM32CubeL4/tree/master/Projects/B-L475E-IOT01A/Applications/Proximity

Hi,

I was going through the example of promixity sensor of B-L475E-IOT01A board in the github stm32l4cube repository. i compiled the code and debugged it. After dumping the program into my board and while trying to get the values in hyperterminal I get the following error, HardFault_Handler() at stm32l4xx_it.c:61 0x8000882 . to be noted that I got this error only after I entered the command in my hyperterminal to view the sensor values.

Can anyone help me with rectifying this

Thanks!!!

1 ACCEPTED SOLUTION

Accepted Solutions

The linker script (.ld) controls where the linker places things.

The listing file (.lst, .lss, etc) is a disassembly of the file, or sources. I expect you could use objcopy to generate one from the .elf file if necessary.

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

View solution in original post

10 REPLIES 10

Perhaps start by looking at a listing file for the offending location.

Ideally in your debugger, you can inspect the processor registers, and code at/prior to the faulting location.

Perhaps an interrupt firing with an uninitialized pointer or peripheral instance

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

@Community member​  I am a newbie , so it would be very helpful if you can share any resources who previously encountered similar problem?

Thanks!!

The linker should be able to generate a listing file. A debugger should be able to show code at a specific address.

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

Status VL53L0X_Error <optimized out>

 I found this in VL53L0X_PerformSingleRangingMeasurement() at

vl53l0x_api.c:2,519 0x800105c

and ".ld"is the linker file if I am not wrong

TDK
Guru

Debug with an IDE. Use the stack trace to guide the debugging process. Inspect the SCB register to determine the source of the hardfault and correct.

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

Thank you trying that now

The linker script (.ld) controls where the linker places things.

The listing file (.lst, .lss, etc) is a disassembly of the file, or sources. I expect you could use objcopy to generate one from the .elf file if necessary.

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

Thank you so much , will try that

Sundar santhanam
Associate II

I commented out the function which actually converts the millimeter values to sigma ( I think the function ensures the distance values we get are within a limit of a certain range) , now the code seems to work , but not sure whether my values are calibrated . Thanks!!!