Hi
I would have liked to quickly run the code but there are many paths that can't be found (like C:/Freescale/KSDK_1.0.0-KL03Z which may be a special version just for the KL03?).
The generated code is not easy to follow since it is spread out in many files (some of these are also missing) so I didn't invest too much time trying to work out what it was doing.
If you post a binary that can be loaded to the HW it is usually easier to see problems by looking at some registers than trying to follow code sequences.
What I do see is that the LPUART is using a simple blocking polled transmission and it it is not getting past spinning on an empty flag. It is probably that the Tx hasn't been enabled or possibly the LPUART clock hasn't been set to one that is enabled, etc.
As reference I can show you the KL03 LPUART Tx code in the uTasker project so that you can check the initialisation steps to see whether something is missing in yours. This assumes that the UART is run from the IRC48M clock (MCGPCLK) 8 bit mode, 1 stop, no parity 19200 Baud. I have added the register values for comparison. It doesn't show the interrupt configuration and operation for simplicty. As you can see there is in fact very little code required for initialisation and transmission.
POWER_UP(5, SIM_SCGC5_LPUART0); // power up the LPUART [sets bit 0x00100000 in SIM_SCGC5]
SIM_SOPT2 |= (SIM_SOPT2_UART0SRC_IRC48M); // select the 48MHz IRC48MHz clock as source for the LPUART [0x04000000]
#define SPECIAL_UART_CLOCK (48000000)
LPUART0_BAUD = (((((SPECIAL_UART_CLOCK/16/19200) + 1) * 2)/2) | LPUART_BAUD_OSR_16); // set 19200 (x16 oversampling) [0x0f00009d]
LPUART0_CTRL = LPUART_CTRL_M; // 8 bit mode, one stop bit without parity [0x00000010]
_CONFIG_PERIPHERAL(B, 2, PB_2_UART0_RX); // UART0_RX on PB2 (alt. function 2) [PORT_PCR2 = 0x00000200]
LPUART0_CTRL |= (LPUART_CTRL_RIE | LPUART_CTRL_RE); // enable receiver and reception interrupt [0x00240010]
_CONFIG_PERIPHERAL(B, 1, PB_1_UART0_TX); // LPUART0_TX on PB1 (alt. function 2) [PORT_PCR1 = 0x00000200]
LPUART0_CTRL |= LPUART_CTRL_TE; // transmitter is enabled but not the transmission interrupt [0x002c0010]
// To send a byte of data (ucTxByte)
//
while ((LPUART0_STAT & LPUART_STAT_TDRE) == 0) { // wait for any transmit activity to complete
}
LPUART0_DATA = ucTxByte; // send byte
// Repeat for multiple bytes
//
//
Beware that the LPUART0_RX pin on the FRDM-KL03Z has a big 100nF capacitor connected to it (due to the fact that the pin can be used as VREF_OUT and then needs decoupling) which limits its Baud rate - 19200 Baud is OK bit higher becomes unreliable due to the fact that the input from the OpenSDA UART is just a triangular signal.
For completeness I have attached a binary which runs on the FRDM-KL03Z and has a simple menu on the LPUART interface (19200Baud). You can also use a debugger to check the register settings that it uses if required.
Regards
Mark
µTasker Kinetis support