I'm currently working with Crossworks ARM (2.1) and I have some problems with interrupts on my LPC2368 mcu.
Two courses of action (in UART example):
1) Working one:
- whole uart initialization and IRQ implementation is located in main.c file
- code is builded with VECTORED_IRQ_INTERRUPTS flag as it is required by Crossworks
- Everything works fine (echo tester is responding)
- After exiting from IRQ cpu is changing it mode into Supervisor (it was also set with build flags) This is cool and working..
2) Not working one:
- cpu is initialized by routine located in other file in other directory than main.c ((ProjDir)/SystemCtrl/)
- uart init function is set in nested directory ((ProjDir)/SystemCtrl/LPC/libuart)
- After startup everything is ok. Baudrate is fine, UART is initialized properly
First Bad thing: When data is received at first time, IRQ is called properly. But received data is different (ie. sent: 0x31, received: 0x82).
Second Bad thing: Even if wrong data was received echo will send to PC different value! (ie. sent: 0x31, received: 0x82, echo will send: 0xFE)
Third bad thing: IRQ is exiting and IRQ mode in CPSR is still set! I flag is not cleared. IRQ has __attribute__ ((interrupt(IRQ))) and still not working properly.
Does anybody have any idea? I don't have a clue whats wrong. I even changed stack sizes (I thought that maybe it's lost somehow in weird space). How nesting directories would break everything? It was tested also with clean project without changing any settings.
Please sign in to leave a comment.