First off, consider using ChibiOS instead. ;-)
I am using ChibiOS in other projects with STM32 and it works very well. For this specific project I would like to use CMSIS RTOS (among other reasons are licensing restrictions).
Second, get JTAG/SWD working. You can guess at problems for weeks, but a debugger will tell you right away which exception handler you're in.
Done. The CPU happend to be stuck in "SVCall_Handler" which is spelled wrong in the startup file and should be "SVC_Handler"
After fixing this issue the processor stays in HardFault_Handler - great
(gdb) bt
#0 0x000000de in HardFault_Handler () at startup/startup_lpc12xx.c:267
#1 <signal handler called>
#2 SVC_Handler () at HAL_CM0.S:230
#3 0x00000250 in SVC_Handler () at HAL_CM0.S:222
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Third, pay particular attention to how your startup code sets up the stack pointer(s). Also, since RTX wants to dynamically allocate stack space at runtime, make sure that it's able to allocate memory correctly.
This is what I am trying to find out. How does the startup code need to get modified to make the dynamic stack allocation work?
I have been using the supplied linker files of the RTOS package from the Templates directory, adjusting the ISR names for my CPU
Then GCC sample startup assembler code and supplied linker script. All not working
Maybe someone whats to share a known working linker file and startup script for ARM CMx so that I can find out the key differences.