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); | |
} | |
} |
Solved! Go to Solution.
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.
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.
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
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
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