Skip to main content
ldelaprade
Associate
December 23, 2024
Question

STM32CubeMX 6.13 upgrade causes LWIP + RTOS to hang on MX_LWIP_Init()

  • December 23, 2024
  • 3 replies
  • 848 views

All my apps LWIP/RTOS based bugged after STM32CubeMX migration to 6.13 (from 12.1).

Went back to 12.1 to solve the issue.

3 replies

Andrew Neil
Super User
December 23, 2024

Did you do a diff to see what changed?

Did you use the debugger to see where, exactly, MX_LWIP_Init was hanging?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
ldelaprade
Associate
December 23, 2024

No obvious diff... blaming stmcubeMX update was a my finding after days of regression investigations. We settled 'downgrade to 6.12' as an acceptable solution.

Just signaling the issue to help others who might wondering what's suddenly is going wrong...

Ghofrane GSOURI
Technical Moderator
December 24, 2024

Hello @ldelaprade 

First let me thank you for posting.

It would be helpful if you could share your IOC with me so that I can investigate further the issue.

I will be waiting for your feedback.

THX

Ghofrane

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.
ldelaprade
Associate
December 24, 2024

This is the working one (MxCube.Version=6.12.1), opening it with 6.13 cubeMX will migrated it and then break LWIP.

 

in lwip.c I add this to trace DHCP success:

 

/* USER CODE BEGIN 2 */
// DHCP callback function, returns 1 when there's an address
int8_t dhcp_status_trace(void)
{
 if (gnetif.ip_addr.addr != 0)
 {
 // IP address is assigned
 char ip_addr_str[16];
 ip4addr_ntoa_r(&gnetif.ip_addr, ip_addr_str, sizeof(ip_addr_str));
 printf("\n!!! IP address assigned: %s !!!\n", ip_addr_str);
 return 1;
 }
 return 0;
}
/* USER CODE END 2 */

then in main.c I can delay my private thread  operations using: 

/* USER CODE END Header_StartDoipTask */
void StartDoipTask(void *argument)
{
 /* USER CODE BEGIN StartDoipTask */

 printf("StartDoipTask Starting.................\n");

 char IP_dhcp_obtained = 0;
 while (!IP_dhcp_obtained)
 {
 printf(".");
 IP_dhcp_obtained = dhcp_status_trace();
 osDelay(1);
 }
 printf("................\n");

 // DoIT diag services (TCP)
 start_doip_server();
 // DoIT discovery service (UDP)
 start_udp_discovery();

 /* Infinite loop */
 for (;;)
 {
 osDelay(1);
 }
 /* USER CODE END StartDoipTask */
}

I can then also track IP assignment visualy (VSCode serial monitoring of ttyACM0 @9600 bauds)  :

STM32 with RTOS Starting.................
StartDefaultTask Starting..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
!!! IP address assigned: 192.168.1.40 !!!
................