When I start a debug session, the code downloads properly and starts at the reset vector, but the kernel never starts. My investigation shows that osKernelInitialize() fails because IsIrqMode() returns 3, which corresponds to a HardFault interrupt.
Why would the processor start in HardFault context?