2025-01-09 04:46 AM - last edited on 2025-01-09 05:31 AM by SofLit
Steps to reproduce:
Start a new STM32 Project in STM32CubeIDE v1.17.0
Select NUCLEO-F746ZG board, and initailize all peripherals.
Now in the IOC editor, under Middleware select LwIP and enable it.
Set the PHY to LAN8742 in the "Platform Settings" tab.
On the Key Options tab set NO_SYS to OS Not Used.
In General Settings tab, disable DHCP, disable the TCP module and enable UDP.
Go back to Key Options tab and note that the "LWIP_RAM_HEAP_POINTER" is set to 0x30004000
Save, Build an run the project in debug mode.
The code will hard-fault during MX_LWiP_Init() because the RAM HEAP POINTER is wrong.
Now open the file at LWIP/Target/lwipopts.h
Note that at approximately line 58/59 there is:
/*----- Default Value for F7/H7 devices: 0x30044000 -----*/
#define LWIP_RAM_HEAP_POINTER 0x30004000
FIrst of all the comment doesn't match the value given, and even if you change the value given to the same as the comment (this is an F7 device after all) the code will still hard-fault.
If you comment out the #define the code will now build and run, but the number of ETH_RX_BUFFER_CNT buffers you can set in the IOC editor is very limited.
Also, if you make any changes at all to anything in the IOC editor, this line will get put back i and your code will hard-fault again.
2025-01-09 06:43 AM - edited 2025-01-09 06:55 AM
Hello @KMill, you are right
The default value causes a Hardfault as the address is in a reserved region:
I'm creating an internal ticket to correct this (Internal ticket number: 200083)
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.