I've now spent a lot of time debugging a problem/issue with the built-in stack overflow check in the RTX OS.
In my project I have a task that receives input from a UART (LPC 2368). The chacacters are read vith getchar(), which in turn calls fgetc, which is a retargetted function under my control. fgetc reads the characters from a SWI-function that I've written, and fgetc loops until something is received. I'm not sure why, but for some reason this bypasses the task switching for this given task, and thus any stack overflow is not detected.
The situation can be remedied by inserting a os_dly_wait-call in the task after getchar has returned a character, since this will allow the task switch mechanism to do it's task checking as usual.
I haven't analysed this fully, but I'd imagine that it may not be what Keil intended. Having a task sitting in a loop calling a (user) SWI-function may not be usual, but it isn't unheard of either.
Regards -Øyvind
I recommend that you consider the use of a mailbox or event for received data, so your task don't have to busy-wait.