cancel
Showing results for 
Search instead for 
Did you mean: 

lwip - tcpecoserver - transmit data

emre ozdemir
Associate III

Hello.

I am using an STM32H743BI processor in the project.

I am using freertos.

I have completed the connection setup from ethernet. I can ping the device and connect as tcpclient.

In the working scenario I need to send data at 100ms intervals as long as the client is connected to the client.

I am having trouble with this, after a few messages the device goes to hardfault as you can see in the picture below.

emreozdemir_0-1729518501194.png

 

#define MEM_SIZE 10*1024
/*----- Default Value for H7 devices: 0x30044000 -----*/
#define LWIP_RAM_HEAP_POINTER 0x30004000
you can also find the whole lwipopts.h file attached.


I will also leave here the settings I made about memory.

MPU_InitStruct.Number = MPU_REGION_NUMBER2;
MPU_InitStruct.BaseAddress = 0x30004000;
MPU_InitStruct.Size = MPU_REGION_SIZE_32KB;
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1;
MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;
MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;

HAL_MPU_ConfigRegion(&MPU_InitStruct);

I am using heap1 as freertos heap and I set the size to 200000bytes.

 

Thanks for your helps.

Best Regards.

EMRE

 

 

1 REPLY 1
STea
ST Employee

Hello @emre ozdemir ,

I advise you to properly debug the Hardfault to know for sure what is causing your problem in the first place, this article may help you in the debug process .

Also, the code snippet for MPU config that you shared seems to be lacking.

I recommend you follow the example  STM32H7-LwIP-Examples/STM32H743_Nucleo_ETH at main · stm32-hotspot/STM32H7-LwIP-Examples (github.com)
Take special care with DMA descriptors and RX pool placement in the FLASH.ld file of your project.

Regards

 

In order 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.