ConsoleIO support for TWR-KL25Z128 + TWR-SER boards

To make changes to the project build settings, perform these steps:

  1. Add ConsoleIO.c, ConsoleIO.h, UART0_PDD .h, PDD_Types.h files to the project in the respective folders as shown in the image below. ConsoleIO.c contains the UART Console routines __read_console, __write_console, __close_console, InitClock and ConsoleIO_Init.

    Location of the files: <CWInstallDir>\MCU\ARM_GCC_Support\UART\TWR-KL25Z128 (or your respective board).

    Note: For TWR-K60N512 + TRW-SER board (Derivative - PK60N512) the location of the files is <CWInstallDir>\MCU\ARM_GCC_Support\UART\TWR-K60N512. (ConsoleIO.c, ConsoleIO.h, UART_PDD .h, PDD_Types.h).
    Figure 1. CodeWarrior Projects View for KL25Z128

  2. Modify your code in main.c:
  3. Include ConsoleIO.h
  4. Call ConsoleIO_Init() to initialize the UART.
    Listing: Simple Program
    #include "derivative.h" /* include peripheral declarations */
    #include "ConsoleIO.h"
    int main(void)
    {
    int counter = 0;
    ConsoleIO_Init();
    puts("Hello World in 'C'!");
    for(;;) {
    counter++;
    }
    return 0;
    }
  5. Clean and rebuild the project.
  6. Download your project to the board
  7. Connecting a terminal to your board and 38400 baud, you should see the message printed to the terminal.