Deal all,
I have a problem with stack overflow checking on Cortex-M3 (LPC1768 from NXP) using RL-ARM as below
=================================================================================================== main stack size: 0x00000200 (configured in startup_LPC17xx.s) heap size: 0x00001000 (configured in startup_LPC17xx.s, as I used RL-Flash) individual task stacks: InitTask: default task 1: U64 Stack1[200/8] Use UART2, I2C0 task 2: U64 Stack2[800/8] Use UART2, RTC task 3: U64 Stack3[800/8] Use FlashFS for SD Memory Card task 4: default Just turn on LED used os_itv_set / os_itv_wait for running checking task 5: default Just turn off LED used os_itv_set / os_itv_wait for running checking ===================================================================================================
In RTX_Conf_CM.c, I have the following settings:
=================================================================================================== Number of concurrent running tasks: 7 Number of tasks with user-provided stack: 0 Task stack size [bytes]: default (50 bytes) Check for stack overflow: checked Run in privileged mode: no checked SysTick Timer: 1000 (1ms) on OS clock 100MHz Enable Round-Robin: checked Round-Robim TimeOut: 5 Number of user timers: 0 ===================================================================================================
Task 1 and Task 2 have Inter-Task Communication using MailBox. If: - Disable task 3 (FlashFS with SD Memory Card) / Run tasks 1, 2, 4, 5: system run normally. - Disable task 1 / Run tasks 2, 3, 4, 5: system run normally. - Run all tasks or (task 1 with task 3): system frozen when task 3 run, Debug on Keil, I found it go to task os_idle_demon. => Increased stack size for task 1, 2, 3 to [2000/8] could not solve the problem. - If disable stack oveflow checking, system run normally.
Based on these factor, I think the problem come from stack overflow checking. What can I do to fix this problem? Any thoughts would be greatly appreciated.
Thanks, Minh Nhat