Hello dear ARM fellows,
I write this thread because I am experiencing a weird issue in my RTX application based on a NXP LPC2388.
I did not make any changes in the source code of my application, this issue arisen after migrating from my old MDK-ARM (MDK402 + RLARM340) to the MDK-ARM Pro 4.72a.
After replacing all config files, librairies and having a compilation without error I flashed my frimware into the µC. Now it resets after a certain amount of time. After debugging I saw that it was hanging on the following function : os_sys_init(OS_init);
My OS_init task is written as follow:
__task void OS_init(void) { // Create tasks socket_init(); // TCP task tid_task_resti = os_tsk_create_user(task_resti, 2, &task_resti_stack, sizeof(task_resti_stack)); tid_task_xmlserver = os_tsk_create_user(task_console_server, TASK_XML_PRIO, &task_xmlserver_stack, sizeof(task_xmlserver_stack)); tid_task_filemanager = os_tsk_create_user(task_filemanager, FILE_MANAGER_PRIO, &task_filemanager_stack, sizeof(task_filemanager_stack)); tid_task_timertick = os_tsk_create(task_timertick, TCP_TIMER_PRIO); tid_task_canmanager = os_tsk_create(task_canmanager, CAN_MANAGER_PRIO); tid_task_errormanager = os_tsk_create_user(task_errormanager, ERROR_TASK_PRIO, &task_errormanager_stack, sizeof(task_errormanager_stack)); os_tsk_delete_self(); }
After making a step by step execution, I noticed that the OS_init task hangs on the os_tsk_delete_self() and precisely when this function calls tsk_lock() (RTX SWI function) which is causing the abort. I am aware that SWI functions could crash when the startup file is not well configured but in my case I use the IMPORT SWI_Handler statement. And anyway, my LPC2300.s is the only file I didn't change because after comparison there was no change between my old version and the new one.
I use my own RTX lib because I added a new SWI function but it used to work fine with my previous setup. By the way, to avoid any problem related to this custom lib I tried the standard pre-compiled RTX lib without success.
While debugging I saw that my tasks stacks were far to be full. I tried to increase my Supervisor Mode stack (used by SWI functions) without success. A that point, I am a little bit stray so I need a fresh eye on my issue or a hint to look into.
If you need more info to help me I can provide it, just ask.
Tank you in advance for your help.
Regards.