When mbed is built with #define OS_TIMERS 0, svcThreadCreate() fails (correctly) for the creation of the timer thread. This causes the main thread to have task_id 1. There are a couple of places where the task_id for the main thread is assumed to be 0x02. In particular, rt_stk_check fails since it is trying to ignore the MAGIC_WORD check on the main thread but the task_id check fails since the main thread task_id is 0x01 rather than 0x02.