Odd FIQ interrupt behavior

I’m having some strange issues with FIQ interrupts that I’m hoping someone can help me with. I have a Sparkfun Logomatic v2, and I’ve modified the default firmware to just record everything that comes in on UART1. I’m using WinARM to compile everything, and I haven’t modified the USB bootloader.

Everything works perfectly using normal vectored interrupts. I decided to modify the code to use an FIQ interrupt instead, just for learning purposes. I modified the startup code to move the interrupt vectors to RAM, and I’ve verified that the assembly produced is doing what I expect it to do.

With interrupt vectors moved to RAM, normal vectored interrupts still work fine. However, switching to an FIQ interrupt does not. The FIQ interrupt runs as expected (verified by toggling an LED), but the data from the UART is no longer recorded in the global variable (which is volatile), and the while (1) loop that checks for filled buffers or for a button press doesn’t seem to work. If I press the “stop” push button before entering the FIQ interrupt (by not hooking up anything to the UART rx pin), the while (1) catches it. As soon as the interrupt has fired at least once, it doesn’t, even when I remove the input to the rx pin, and the interrupt isn’t firing. The while (1) loop does continue to run (verified by toggling another LED), but the button press just isn’t recognized. It’s possible that the buffers are also filling, and those if statements are just not working either.

The FIQ interrupt appears to be set up correctly, and the FIQ and IRQ service routines are identical. I could understand the button press not registering if I didn’t clear the interrupt and it was firing continuously, but I can remove the UART input and (through the LED) verify that the FIQ interrupt no longer fires, and it still doesn’t work. I’ve spent some time searching this forum, the LPC2000 group on Yahoo, and reading through a lot of material on interrupts, but I haven’t found anything yet that helps.

I’m happy to post any revelant parts of the code that might help. Anyone have any suggestions?

Obvious question: do you have an adequately large FIQ stack?

Yep, switched the sizes of the IRQ and FIQ stacks when I switched between them, so FIQ stack is 0x200.

Thanks for the suggestion, I’m pretty sure it is something small and obvious like that that I’m just missing.

Is your startup code actually setting up the FIQ mode stack pointer? I have a vague recollection of this being commented out in an IAR example I used once.