Skip to main content
elagreca1970
Associate II
February 12, 2015
Question

CubeMX LWIP Middleware Generated Code

  • February 12, 2015
  • 4 replies
  • 1168 views
Posted on February 12, 2015 at 13:51

I am having a problem with LWIP code.  From MX tool I enable DNS so that LWIP_DNS is defined as 1 in lwipopts.h file yet this is not detected in any of the files. For example in netdb.c:

#if LWIP_DNS && LWIP_SOCKET

LWIP_DNS comes up as being 0 (incorrect) whereas LWIP_SOCKET comes up as being 1 (correct).

A search of LWIP_SOCKET locates this in lwipopts.h whereas a search of LWIP_DNS results in it not being found in lwipopts.h - Very strange.

The relevant paths are included in the project.  I am using TrueSTUDIO 4.3.1.

Has anyone else seen this problem?

Rgds

Emilio

    This topic has been closed for replies.

    4 replies

    Bino
    ST Employee
    February 12, 2015
    Posted on February 12, 2015 at 17:44

    Hello,

    Could you please provide your ioc file so that we can investigate.

    If you define LWIP_DNS to 1 in a user section of lwipopts.h, does it works better?

    For sure if you enable LWIP_DNS in CubeMX, it should be generated in lwipopts.h ...

    Thanks for your reply.

    elagreca1970
    Associate II
    February 12, 2015
    Posted on February 12, 2015 at 22:44

    Hello eric

    I have attached .ioc file. I tried moving LWIP_DNS define to user code area with no effect. LWIP_DNS is enabled in MX tool and #define LWIP_DNS 1 is generated in the lwipopts.h file - The problem is this particular define is not detected in other code modules.

    Thanks

    ________________

    Attachments :

    com_eval429.ioc : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzWc&d=%2Fa%2F0X0000000bN8%2F_h7R7fb8YnfeRzRNZ1MJG.PXnZU6Wdbk50W5q1dTS84&asPdf=false
    Bino
    ST Employee
    February 13, 2015
    Posted on February 13, 2015 at 13:46

    Using your ioc file with IAR (EWARM), the problem you mentionned is not visible. Could you try maybe? Would it be possible to add this dummy code to be sure of the value of the parameter:

    #if !LWIP_DNS

    #include ''lwip/dummy.h''

    #endif

    If en error occurs at compilation phase, this will confirm that LWIP_DNS is unexpectedly to zero.

    Thanks for your confirmation

    elagreca1970
    Associate II
    August 28, 2015
    Posted on August 29, 2015 at 01:57

    Solved this some time ago with help from Atollic.

    C/C++ indexes need to be rebuilt every time code is generated from MX