cancel
Showing results for 
Search instead for 
Did you mean: 

LwIP power cycle problem

EGonc.2
Associate II

Hi

I'm using this example:

en.stm32cubef7_v1-16-0\STM32Cube_FW_F7_V1.16.0\Projects\STM32F767ZI-Nucleo\Applications\LwIP\LwIP_HTTP_Server_Netconn_RTOS\EWARM

(I have applied patch 1.16.1)

I'm using a Nucleo-144 STM32F767ZI.

The board has a static IP address of 192.168.0.10 with a MAC address of 02:00:00:00:00:00.

I'm getting a strange behaviour...

When the board starts by the IAR debugger or by pressing the Reset button on the board all works fine.

By when I power cycle the board the firmware doesn't work, that is, when I try to show the web page at address 192.168.0.10 I get a connection error after some time.

However if I put a delay before ( see code below for main() ) the initialisation of the LwIP all works. With debugger, with reset and with power cycle.

It also works with 2.5s delay, but not with 1s delay.

The difference I can see in wireshark is when I power cycle without the delay the ARP annoucement shown below is not transmitted by the Nucleo-144.

40175 1124.456115 02:00:00:00:00:00 Broadcast ARP 60 ARP Announcement for 192.168.0.10

Is there any explanation for this?

Instead of a delay can use something else more reliable?

thanks

----------------------------------------------------------------

int main(void)

{

 /* Configure the MPU attributes as Device memory for ETH DMA descriptors */

 MPU_Config();

  

 /* Enable the CPU Cache */

 CPU_CACHE_Enable();

 /* STM32F7xx HAL library initialization:

    - Configure the Flash ART accelerator on ITCM interface

    - Configure the Systick to generate an interrupt each 1 msec

    - Set NVIC Group Priority to 4

    - Global MSP (MCU Support Package) initialization

   */

 HAL_Init();  

  

 /* Configure the system clock to 200 MHz */

 SystemClock_Config(); 

  

 /*configure LED1 and LED3 */

 BSP_LED_Init(LED1);

 BSP_LED_Init(LED2);

 BSP_LED_Init(LED3);

  

 BSP_LED_On(LED2);

  

 HAL_Delay ( 5000 ); \\ <<-------------

 BSP_LED_Off(LED2);

 /* Init thread */

#if defined(__GNUC__)

 osThreadDef(Start, StartThread, osPriorityNormal, 0, configMINIMAL_STACK_SIZE * 5);

#else

 osThreadDef(Start, StartThread, osPriorityNormal, 0, configMINIMAL_STACK_SIZE * 2);

#endif

  

 osThreadCreate (osThread(Start), NULL);

  

 /* Start scheduler */

 osKernelStart();

  

 /* We should never get here as control is now taken by the scheduler */

 for( ;; );

}

1 REPLY 1
GCsor
Associate

I have the same issue with an STM32H743. I need 4ms delay but I would be also interested in a proper solution.

I used the post here to setup my project: https://community.st.com/t5/stm32-mcus/how-to-create-project-for-stm32h7-with-ethernet-and-lwip-stack/ta-p/49308

My first guess was an uninitialized variable in LwIP stack (or in my usage), but a delay wouldn't solve that. It's likely some race condition with some hardware. Before initializing the LwIP stack only unrelated peripherals are initialized, so I don't have a clue what could be a problem here.