cancel
Showing results for 
Search instead for 
Did you mean: 

lwIP and Ethernet (Internal MAC) initialization for STM32F756 Nucleo Board

avinash_elec
Associate III

Hello!

The code generated for lwIP and Ethernet (Internal MAC) has three threads for working of lwIP and the Ethernet driver.

  1. tcip_thread: main thread used to execute the lwIP stack all TCP/IP processing is done by this.
  2. EthIf: Process the RX interrupt on Ethernet peripheral, when new data packet is received passes it to lwip.
  3. EthLink: constanly monitors the Phy chip for any connection/disconnection and auto-negotiation events.

I am using v 1.17.0 of the IDE (latest at the time of writting)

The problem is that the default value of STACK size of EthIf (Rx Handler Thread) is very small: Only 350 bytes. which leads to stackoverflow. I have manually changed the value from code. But I cannot find any GUI to change this! Only we are allowed to configure the tcip_thread but their is NO option for last two threads. issue.png

 

Further there is only a single constant that is used for initialization of both the threads (EthIf and EthLink)

#define INTERFACE_THREAD_STACK_SIZE ( 1024 )

and this same constant is overwritten that causes confusion.

2 REPLIES 2
Sandro_K
Associate III

Hello, I have exactly the same problem. On a STM32F777 with CMSIS V2 and F7 1.17.2 I get a stackoverflow. Manually increasing the size of the stack fixes the problem. However, every time new code is generated, this change is overwritten. How can the stack size be adjusted?
Perhaps the F7 package also needs to be corrected?

Sandro_K
Associate III

Ethernet Stack size.png

I have checked the used Stack size. The task needs more than the default 350 bytes.

I changed the .ftl file so that the change is no longer overwritten when code is generated.