LWIP stack configuration issue on NUCLEO-H755
Hi everyone!
I'm experiencing on ethernet communications using a NUCLEO-H755 board.
I already configured the LWIP stack on the M4 core and it seems work.
Now I'm trying to make it work on the M7 core following this guide:
Compared to the guide, in my project thereare some differences:
1) Memory mapping
2) I've integrated the MX_LWIP_Process function in the main() infinite loop (instead of the udp message test).
By this way, LwIP stack seems to work also on M7: I'm able to ping my board.
But if I try to ad some more code to the infinite loop, it results in an LwIP assertion failure with this message:
"Assertion "pc->custom_free_function != NULL" failed at line 767 in C:/Users/PF5766/Documents/REPO/NucleoH755ZI/H755lwipTest/Middlewares/Third_Party/LwIP/src/core/pbuf.c"
then the board enters in Hard-fault.
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
MX_LWIP_Process();
if((HAL_GetTick() - uiCnt) >= 200U)
{
uiCnt = HAL_GetTick();
HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
}
uiTimeOutCounter++; // Causes Hard Fault!
}
/* USER CODE END 3 */Here the code of my infinite loop on the M7.
The led blinking code gives no problems, but the uiTimeOutCounter variable increase results in the hard fault: Commenting it, will fix the hard fault.
Also leaving uiTimeOutCounter and commenting out the MX_LWIP_Process functions fix the hard fault.
It seems a MPU configuration issue. It could be?
BTW, enabling the MPU in the .ioc file, seems generate 2 functions: MPU_Initialize(void) and MPU_Config(void).
But the first one (MPU_Initialize) is only declared and never defined (giving also a warning at compile time).
Any Idea?
iTTy
P.S: I'm using CubeIDE 1.13.2, Project was generated with CubeMX 6.9.2 and H7 firware version 1.11.1
