I have my own hardware design based off the MCF52259twr design and it's been working well for years. Recently added support for 2 RS232 ports with interrupt driven TX and RX. Using UART0 and UART1. Running CW V 11 and MQX 420.
When I run a single port hard, meaning the ISR gets a TX event while servicing RX, everything works fine.
When I run both ports hard at the same time, meaning UART0 can be interrupted by UART1, things get a little bizzare. I'm sure it's not a stack problem, there are no globals being accessed. These are kernel_isrs created with _int_install_kernel_isr(MCF5225_INT_UART0, comm1_isr); and _int_install_kernel_isr(MCF5225_INT_UART1, comm2_isr), on IRQ 14 an 15
I am very familiar with working at this low layer and already have 4 kernel isrs for DTIMs running multiple stepper motors and sure they experience the same re-entracy aned nesting issues that the UARTs do and those run flawlessly. It's just these silly UARTs giving me the problem.
What;s happening is somehow vector 15 (UART2) is getting activated. I know this for a fact because MQX defaults all unused vectors to DEFAULT_ISR( ) and I was always getting to that so I looked into dispatch.c and saw it was being called by IRQ level 15 (UART2). Then I installed a kernel ISR for IRQ 15 just to be able to set a breakpoint and sure enough the breakpoint hit when the problem occurred.
When I hit the breakpoint, I looked at IMRL0 and IRQ15 wasn't even enabled, it was still masked.Looked at the INTFRCLO to see if the IRQ was somehow forced but again, that bit wasn't enabled.
So I'm kind of stumped why everything works fine, then all of a sudden the core vectors to the wrong ISR which is masked off
Any thoughts on this are appreciated
Best Regards
Phil Roth