Skip to main content
S_bgh99
Associate II
November 9, 2021
Question

start code execution problem with MX_LWIP_Init

  • November 9, 2021
  • 6 replies
  • 3923 views

Hi

I add ethernet communication to my program with STM32CubeMx and I just compiled and run it. I have a problem:

if I disconnect Jlink the board I have a ping error. but I run the code with 3 times click on run in MDK-ARM the board will ping.

I also try my app without

MX_LWIP_Init();

if I comment this line all thing is good.

you can find 3-time click video here

6 replies

alister
Senior III
November 10, 2021
SKast.1
Associate
October 31, 2022

Hi, S_bgh99,

Did you find the solution for the problem you mentioned?

If Yes, can you suggest me what is the way to figure out this issue.

NAham.1
Associate II
July 12, 2023

Hello S_bgh99,

I am facing the above said issue

Could you please guide me to fix this issue

Thanks in Advance!

NAham.1
Associate II
July 19, 2023

Hi,

I got the solution for this issue

Thanks!

Associate II
August 31, 2023

Would you tell me a bit more about how have solved this issue? I have very similar problems and looking for a solution. Thank you in advance!

Visitor II
November 27, 2023

I had the same problem. This is caused by the use of printf in the LWIP library. The Retarget.c file must be added to the project, or just add this smal code to main.c

 

struct __FILE { int handle; };
FILE __stdout;

int fputc(int c, FILE *f) {
 return (0);
}

 

 


NAham.1
Associate II
August 19, 2024

Hi,

Try with enabling microLib option

NAham1_0-1724052065602.png

 

Thanks & Regards