Skip to main content
Mujtaba
Associate III
May 25, 2018
Solved

lwIP + STM32CubeMX

  • May 25, 2018
  • 6 replies
  • 1432 views
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.

    This topic has been closed for replies.
    Best answer by Imen.D
    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

    6 replies

    ST Technical Moderator
    May 25, 2018
    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

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    Mujtaba
    MujtabaAuthor
    Associate III
    May 25, 2018
    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

    Imen.DBest answer
    ST Technical Moderator
    May 25, 2018
    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

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    Mujtaba
    MujtabaAuthor
    Associate III
    May 26, 2018
    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

    Mujtaba
    MujtabaAuthor
    Associate III
    May 25, 2018
    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