cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743ZI LWIP TCP/IP EchoClient Example

KKim.19
Associate II

I am sorry that I am not good at English.

Hi. 

I use the stm32h743zi mcu. 

I ported stm32h743i-val lwip tcp echo server and client application

server application was well working but client was not working

ping test was not responed.

my firmware flow is this

lwip init -> tcp_echoclient init -> lwip process

i don't use RTOS

14 REPLIES 14

Hi Piranha,

thank You for the answer.

I am trying to implemented recommended changes, but I am not able to do them all. I am using stm32f417 chip. I am generating cubeMX project with RTOS and LWIP with firmware package STM32Cube_FW_F4_V1.25.0 and cubeMX version 5.6.1

from the list You provided:

https://community.st.com/s/question/0D50X0000BOtfhnSQB/how-to-make-ethernet-and-lwip-working-on-stm32

I have added these modifications:

1.

i added ad the end of function MX_LWIP_Init() in the lwip.c:

ETH->MACIMR = ETH_MACIMR_TSTIM | ETH_MACIMR_PMTIM;

ETH->MMCRIMR = ETH_MMCRIMR_RGUFM | ETH_MMCRIMR_RFAEM | ETH_MMCRIMR_RFCEM;

ETH->MMCTIMR = ETH_MMCTIMR_TGFM | ETH_MMCTIMR_TGFMSCM | ETH_MMCTIMR_TGFSCM;

2.

I added function MPU_Config() and call it at the end of main function inicialization.

void MPU_Config(void)

{

   MPU_Region_InitTypeDef MPU_InitStruct;

   /* Disables the MPU */

   HAL_MPU_Disable();

   /**Initializes and configures the Region and the memory to be protected

   */

   MPU_InitStruct.Enable = MPU_REGION_ENABLE;

   MPU_InitStruct.Number = MPU_REGION_NUMBER2;

...

The rest I am not able to identify what exactly should i change and where.

1.

from the point:

https://community.st.com/s/question/0D50X0000C4Nk4GSQS/bug-missing-compiler-and-cpu-memory-barriers

I cannot locate OWN bit so i do not know where to add __DMB()

2.

https://community.st.com/s/question/0D50X0000B2AG7FSQW/ethernet-send-complete-interrupt-not-triggered-in-stm32f7

this is very confusion, no clue what should be done.

3.

this one is last one applicable for stm32f4

lwIP API related:

  • Code made by ST is not thread-safe. When used with RTOS, it generally ignores lwIP requirements described in Common pitfalls and Multithreading. IP stack initialization, Ethernet link status and DHCP processing code are all broken in this regard.
  • Improper use of netif up/down status. The meaning of NETIF_FLAG_UP flag changed in v2.0.0, but ST's code is not updated. For a link status NETIF_FLAG_LINK_UP flag must be used.
  • Improper use of DHCP client. The code is for an outdated version of DHCP client.

I use fixed IP address, so no DHCP is used.

anybody could help please?

Thank You.

Peter

Could enyone help please? I really cannot move from this place.

Thank You.

Peter

PLang.4
Associate II

Hi ST comunity, could somebody please provide CubeMX file with RTOS and LWIP properly setup for stm32f4* chip ,that will generate project, which i could use for running TCP client?

Thank You.

Peter

ST Community,

I am stuck at TCP client for STM32f4. Could anybody please give me working example for the STM32f4 chip family?

Thanks a lot!

Peter

PLang.4
Associate II

Hi ST comunity,

Here I add my TCP client project generated with CubeMX. As I said, project is nto working, I cannot see ACK message beeing send out of the chip. However with the same setup TCP server is working good.

Could anybody please help?

Thank You.

Peter