I am having some difficulty in isolating a Hard Fault error on a project that runs fine with tickless idle turned off but fails with a hard fault when turned on.
The program is based on one of the low power examples. It has a transmit task and a receive task. The receive task waits forever on a queue and flashes an LED when a message comes in. The sender waits forever for a semaphore. The semaphore is set by an RTC interval timer interrupt.
At first, I had some trouble getting into low power sleep mode. The example I was looking at had a timeout value on the semaphore. The implementation of eTaskConfirmSleepModeStatus in tasks.c will not return eNoTasksWaitingTimeout unless ALL the tasks (except idle) are in suspended state. Well, tasks will only enter suspended state if they have no timeout. (Hope I’m right about this.) So, when I removed the timeout on the semaphore, the processor went into stop mode.
It runs for a couple of cycles and then goes to hard fault. I put in the code to find out where it thought it was and it reports that it’s off in deep space somewhere, like a stack corruption issue or something.
I sure hope someone can help me with this, I am in the midst of converting a fully function application for battery operation. I am running on an STM32F205VE with custom hardware.