cancel
Showing results for 
Search instead for 
Did you mean: 

Nx_TCP_Echo_Client Example Hard Fault if cable is unplugged while test running (STM32H573I-DK)

RomThi
Associate III

Hi,

i am developing an embedded software based on the TCP Client example for CubeMX. During tests with large number of packets I have got an hard fault error. It seems that it happens on a re-transmit. The hard fault can be easy reproduced with original code. For this the right IP address must be set. Also the packet count should be increased to have time to remove the LAN cable while running.

 

The Project was setup like this:

2024_09_06_11_36_35_Start_Project_from_Example.png   

My only modification:

#define TCP_SERVER_ADDRESS IP_ADDRESS(192, 168, 0, 213)

#define MAX_PACKET_COUNT 10000

 

Here a screenshot:

Untitled.png

It seems that a pointer gets damaged as the address 0xF338000 makes no sense.

 

Best regards,

Roman Thiel

 

 

 

10 REPLIES 10

Hi Adam,

do you have more details of your application? What is your base?

Adding NX_PACKET_HEADER_PAD and NX_PACKET_HEADER_PAD_SIZE=4 to the pre-processor should not change the functionality. Something must be strange at your code.

You can also try to add more padding e.g. NX_PACKET_HEADER_PAD_SIZE=16 but 4 should be OK.

 

Regards,

Roman