cancel
Showing results for 
Search instead for 
Did you mean: 

lwIP + STM32CubeMX

Mujtaba
Senior
Posted on May 25, 2018 at 10:32

Dear friends,

I am trying to config lwIP Netconn APIs to connect my board to the TCP/IP network using STM32F107RCt6 MCU and a DP83848CVV PHY.  The only options that I change in configuration tab in CubeMX is to disable the DHCP server and enter the static IP address and I add another freeRTOS thread with default stack size of 128 words. I used the tcp echo server example provided by ST and copied the code to the new thread I created and I am sure my code is fine and works well and when I download the code, the board even doesn't answer to the ICMP ping request!

I also tried to config the STM32F746 Discovery board but I get the same result and the board didn't answer to the ping request so I'm pretty sure there is something missing in my lwIP configuration in CubeMX.

I already run TCP echo server using STM32F107RCt6 with lwIP native raw apis version 1.3.1  and SPL libraries but I want to migrate to CubeMX and HAL libraries and new versions of lwIP and freeRTOS.

I would be very thankful if someone could help me in configurations. I am using the latest version of CubeMX and Keil IDE and lwIP version 2.0.0.

1 ACCEPTED SOLUTION

Accepted Solutions
Posted on May 25, 2018 at 11:59

Hi

Hossaini.Mujtaba

,

Try to set the PHY address to 0 and I increase the heap space in FreeRTOS by changing configTOTAL_HEAP_SIZE in FreeRTOS configuration.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

6 REPLIES 6
Imen.D
ST Employee
Posted on May 25, 2018 at 11:10

Hello

Hossaini.Mujtaba

,

Did you set in the CubeMx the PHY address to 0 ?

With Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Mujtaba
Senior
Posted on May 25, 2018 at 11:37

Dear Imen,

Thanks for your quick reply.

The PHY address of my board is 1.

Best regards,

Mujtaba

Mujtaba
Senior
Posted on May 25, 2018 at 12:31

Hi,

I will change the phy address but I dont think the problem lies within the freeRTOS because I couldnt ping the board even when I config lwIP to native raw api.

Thanks for your reply,

Mujtaba

Posted on May 25, 2018 at 11:59

Hi

Hossaini.Mujtaba

,

Try to set the PHY address to 0 and I increase the heap space in FreeRTOS by changing configTOTAL_HEAP_SIZE in FreeRTOS configuration.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on May 26, 2018 at 14:45

Dear Imen,

I set the phy address to zero and I totally disabled FreeRTOS but still have the same problem. 

The board does not even anser to the ping request.

Could you please give me a hint how I can find the problem?

As I said I coud run tcp echo server using lwip native raw api version 1.3.1 with phy address of 1 and spl libraries. (Without using cube the board worls well but when I use cube to do the initialaztions, the board does not work and I am 100% sure that the problem lies somewhere inside my lwip configurations in cube.)

Besr regards,

Mujtaba

Posted on May 27, 2018 at 10:51

Dear Imen,

Thanks for your help.

When I increased the total heap size of FreeRTOS, I could ping the board successfully.