Hi, I have some problems with rtcs of MQX 4.2.
When my code works these functions:
ipcfg_init_device()
ipcfg_get_link_active()
ipcfg_bind_dhcp_wait()
ipcfg_get_ip()
ipcfg_bind_staticip()
My code stucks inmediately to mqx_idle_task. I debugged and my code pass to mqx_idle_task, don't let me create the others tasks in the next lines of code.
I don't know which is the problem. My code doesn't work the rest of my application.
I attach my user_config.h
BR
Norberto Jiménez
Original Attachment has been moved to: user_config.h.zip
Hi Norberto
Can you attache you source code here, so I can reproduce your issue on my side?
Regards
Daniel
Hi, It's some confidential my application; however, I copied all initialization of RTCS of the demo "eth_to_serial" to my app.
#if RTCSCFG_ENABLE_IP4
IPCFG_IP_ADDRESS_DATA ip_data;
uint32_t ip4_addr = ENET_IPADDR;
#endif
uint32_t error;
sockaddr addr;
_enet_address enet_addr = ENET_MAC;
uint32_t retval = 0;
SOCKETS_STRUCT sockets;
uint32_t conn_sock;
uint32_t client_sock;
_task_id rx_tid;
_task_id tx_tid;
FILE_PTR ser_device;
uint32_t option;
#if MQX_USE_IO_OLD
uint32_t param[3];
#endif
TASK_PARAMS task_p = {0};
rtcs_fd_set rfds;
int32_t err;
#if RTCSCFG_ENABLE_IP6
uint32_t n = 0;
uint32_t i = 0;
IPCFG6_GET_ADDR_DATA data[RTCSCFG_IP6_IF_ADDRESSES_MAX];
char prn_addr6[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"];
#endif
conn_sock = 0;
sockets.sock4 = 0;
sockets.sock6 = 0;
/* Initialize RTCS */
_RTCSPCB_init = 4;
_RTCSPCB_grow = 2;
_RTCSPCB_max = 20;
_RTCS_msgpool_init = 4;
_RTCS_msgpool_grow = 2;
_RTCS_msgpool_max = 20;
_RTCS_socket_part_init = 4;
_RTCS_socket_part_grow = 2;
_RTCS_socket_part_max = 20;
error = RTCS_create();
if (error != RTCS_OK)
{
fputs("Fatal Error: RTCS initialization failed.", stderr);
_task_block();
}
#if RTCSCFG_ENABLE_IP4
ip_data.ip = ENET_IPADDR;
ip_data.mask = ENET_IPMASK;
ip_data.gateway = ENET_IPGATEWAY;
#endif
/* Initialize ethernet */
error = ipcfg_init_device(BSP_DEFAULT_ENET_DEVICE, enet_addr);
The problem is that my code stucks in ipcfg_init_device(); I'm sure that it isn't advance because I debug it. I have some _task_create after this line, and I checked in the task summary that they aren't created. I try to debug in steps, but it's very long to step all functions inside of ipcfg_init_device().
BR,
Norberto Jiménez
Hi Norberto Jiménez:
I don't see any problems in your pasted code. I would suggest you comment out the _task_create code for debugging. Or adjust the task's priority to see whether it helps.
For some confidential application, you can submit a new question for further NXP support.
https://community.nxp.com/docs/DOC-329745
Regards
Daniel
Hi Daniel. I don't know what I've done that the problem is now fixed.