Skip to main content
Associate
November 14, 2024
Solved

Hard fault after lwip init

  • November 14, 2024
  • 3 replies
  • 1817 views

i recently made a custom board using stm32h743VIT6 and i configured lwip and freertos (before this i was using stm32f407vgt6 it is perfectly working and the circuit is same for this MCUs) now when i start the program it keeps having hardfault i tried it with MPU but still im having hardfault i changed the clock setting from external to internal but nothing changed only when i commented out MX_LWIP_Init() its working its better to mention im having only one task in freertos with 2048 stack size and also the lwip init is done completly after a little hard fault come up.
my hardfault analyzer returns "Bus memory management or usage fault with bus fault details imprecise data access violation".
im not having any httpd or anything on lwip i only want to get a simple ping.

This topic has been closed for replies.
Best answer by mƎALLEm

So refer to this article on : "How to debug a HardFault on an Arm Cortex®-M STM32"

3 replies

mƎALLEm
ST Technical Moderator
November 14, 2024

Hello,

Check what MX_LWIP_Init() is accessing as variables, it could be due to an access to a non-initialized/NULL pointer/buffer. Check your map file, and if you are using MPU, check the memory regions you prohibited for access.

Check out this article "How to create a project for STM32H7 with Ethernet and LwIP stack working"

Also refer to this article on : "How to debug a HardFault on an Arm Cortex®-M STM32"

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Saeedn823Author
Associate
November 16, 2024

first of all i dont have any non-initialized/NULL pointer/buffer then tried "How to create a project for STM32H7 with Ethernet and LwIP stack working" now i can get ping but still i get hard fault in this article there was a part that moves ethernet buffers i tied with and without it but still i have hardfault somtimes.

mƎALLEm
mƎALLEmBest answer
ST Technical Moderator
November 18, 2024

So refer to this article on : "How to debug a HardFault on an Arm Cortex®-M STM32"

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.