AnsweredAssumed Answered

KL04 UART interrupts not working

Question asked by Kamil Subzda on Aug 24, 2015

I started developing a new project based on a custom board with a MKL04Z32VFK4 processor, and got stuck with a pretty basic thing. UART interrupts do not seem to work.


On the board I have a peripheral device, which starts sending data after detecting low state on a pin called TX_REQ, which is connected to one of the processor pins: PTA8. The KL04 uses UART0 with pins PTB1 and PTB2.


Using KDS 2.0.0 and Processor Expert plugin with its UART:AsynchroSerial component, I prepared two generally identical projects, the simplest as they can be, with only one difference. The first communicates with the device using no interrupts (TX_REQ to 0, some delay, and then reading the Rx register), the second uses interrupts. The first project is working fine - KL04 sets the pin to 0, the device starts sending data, the data appears in the register. The second one does not receive the data, although the data are present on the UART_RX pin (checked with the oscilloscope). The interrupt routine (automatically generated PE_ISR(ASerialLdd1_Interrupt)) is not called - at least the CPU does not stop there on a breakpoint in the debug mode. The Processor Expert settings say that the interrupts are enabled (Cpu:MKL04Z32VFK4 properties), and Interrupt service/event in the UART0 properties is also checked.


For sure this is no a hardware issue, because everything works fine in the project with no interrupts. The basic project settings and the code execution flow are also correct, for the same reason. The sources in these two projects differ only in automatically generated code parts, where these differences seem to be related only to some UART interrupts procedures and their enabling. So there must be something missing or incorrect with these settings, I think, but for now I have no idea what it is.


So my question is: what do I basically need to set in the Processor Expert, in order to start UART0 interrupts working properly?


I attach both of the projects, if that could help helping me.

Original Attachment has been moved to:

Original Attachment has been moved to: