Error[Li005]: no definition for "gsName" when trying to use DHCP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error[Li005]: no definition for "gsName" when trying to use DHCP

Jump to solution
1,305 Views
jesperevertsson
Contributor IV

Hi, I'm trying to get the eth_to_serial MQX example to work with DHCP. It was no problem to make it work tiwh static ip, but when I try to use DHCP instead I get a linker error saying:

Error[Li005]: no definition for "gsName" [referenced from ipcfg.o(rtcs.a)]

Here is my code:

_enet_address enet_addr = ENET_MAC;
IPCFG_IP_ADDRESS_DATA ipData;

  

ipData.ip = ENET_IPADDR;
ipData.mask = ENET_IPMASK;
ipData.gateway = ENET_IPGATEWAY;

  

uint32_t status = RTCS_create();
if (status == RTCS_OK)
{
    status = ipcfg_init_device(BSP_DEFAULT_ENET_DEVICE, enet_addr);
    if (status == RTCS_OK)
    {
    //status = ipcfg_bind_staticip(BSP_DEFAULT_ENET_DEVICE, &ipData);
    status = ipcfg_bind_dhcp_wait(BSP_DEFAULT_ENET_DEVICE, FALSE, NULL);
    if (status == RTCS_OK)
        _task_create(0, UDP_TASK_INDEX, 0);
    }
}
Labels (1)
Tags (3)
0 Kudos
1 Solution
818 Views
jesperevertsson
Contributor IV

I managed to get it to work now by simply adding this code line to my main file.

char gsName;

Seems pretty stupid that this would solve the problem but it does. I have no clue though why this variable is required.

View solution in original post

0 Kudos
5 Replies
819 Views
jesperevertsson
Contributor IV

I managed to get it to work now by simply adding this code line to my main file.

char gsName;

Seems pretty stupid that this would solve the problem but it does. I have no clue though why this variable is required.

0 Kudos
818 Views
DavidS
NXP Employee
NXP Employee

Hi Jesper,

What version of MQX and what development tool are you using?

I tested with MQX_4.1.1 on frdm-k64f using CW10.6 successfully.

Attached web_hvac demo project file rtcs.c is setup for DHCP and waits for Ethernet cable to be plugged in if it is not plugged in at reset.

Regards,

David

0 Kudos
818 Views
jesperevertsson
Contributor IV

I'm using MQX 4.1.1, twrk60 and IAREW.

I also just now saw this test in the ipcfg.h file: "RTCSCFG_IPCFG_ENABLE_DHCP must be set for DHCP"

Where do I set that? In user_config.h? Because right now that flag doesn't exist in my user_config.h file

0 Kudos
818 Views
DavidS
NXP Employee
NXP Employee

Hi Jesper,

The RTCSCFG_IPCFG_ENABLE_DHCP is defined in RTCS header rtcscfg.h and defaults to being enabled.

If you wanted to turn it off (i.e. disable it) then you could define it to 0 in the user_config.h header to override the default setting of 1.

BTW: Did you have a patch applied to the code for a WiFi vendor that might have included the gsName variable?

Regards,

David

0 Kudos
818 Views
jesperevertsson
Contributor IV

I have no clue where the gsName comes from. I just modified the eth_to_serial MQX example and didn't include anything extra afaik

0 Kudos