Booting SAM7 (again)

I am trying out IAR and the FreeRTOS.org port on the SAM7S256 and I have run into a strange problem.

I am using OpenOCD and Olimex JTAG for downloading to the chip.

If I use the following commands (telnet => open ocd) everything works just fine.

reset soft resume

This will download code to the flash, reset the CPU and start executing at bottom of memory (0x00000000).

But, if I hit the reset button, or cycle the board, the cpu starts executing some stuff but a few threads just won’t start.

What can cause this strange differences? Where do I start?

Oh my! Can’t believe the problem was this obvious.

The problem was that a timer that drives an interrupt signaling a thread to wake up had it’s peripheral clock started after it was configured, effectively causing the configuration not to “bite” on the first program run.

After a soft restart the clock was already running and the configuration was successful.

Couldn’t see the wood for the trees…