FRDM-KL25Z

This Freescale Freedom board is based on the KL25Z128VLK4 which is a 48MHz device from the ultra-low-power KL family with Cortex-M0+ core and USB. This KL25 device has 128k Flash and 16k SRAM and is in an 80 pin LQFP package, whereby the KL25 is also available in various other LQFP packages (32, 48, 64 pins) and its memory ranges from 32k ..256k Flash and 4k ..32k SRAM. There is an 8MHz crystal on the board for clocking the part.

Full details and documentation for this board can be obtained from the Freescale web site: FRDM-KL25Z

To configure the µTasker project for this board simply enable the define FRDM_KL25Z in the project's config.h file. The compiler needs to be set to build for Cortex M0+ (and not Cortex M4) and the linker script KL_128_16.ld should be selected [KL_128_16_BM.ld for downloadable version] {the linker script extension may vary for different compilers, whereby *.ld is valid for GCC}

FRDM-KL25Z Binaries

Here are some binary files that can be loaded to the board. These were built using the µTasker applications (serial loader and V1.4 application) and can be simply generated using the supported compilers/IDEs [these were built using GCC], built using different configuration options or modified to suit specific requirements or hardware derived from this board :

  • uTaskerSerialBoot_FRDM-KL25Z_KBOOT_HID_UART_MSD.bin KBOOT compatible USB-HID loader with composite USB-MSD loading, as well as KBOOT UART loading on UART 0 at 57'600 Baud [16.0k] allowing applications to be loaded at link address 0x8080 (using Freescale's KBOOT USB connection, or KBOOT UART at 57'600 Baud or USB-MSD when the board appears as upload hard disk). When operating, the green LED blinks at 5Hz. To force the loader reset the board with connector pin J1-6 pulled to GND. To disable the watchdog reset the board with with connector pin J1-8 pulled to GND. This can be loaded using the FRDM_KL25Z's USB-MSD (OpenSDA) boot loader. Note that the loader limits application sizes to 40k - it can be built without limits using the µTasker project.
  • uTaskerV1.4.8_BM_FRDM-KL25Z_8080.bin FRDM-KL25ZM application with command-line menu on the virtual COM connection (115'200 Baud) with various menu items (as well as on UART0), including the ability to switch to USB-UART-0 bridge mode with end-to-end flow control. Output from the on-board accelerometer can be viewed in the I2C menu. Low power modes can be set in the application menu. The USB device is a composite USB-CDC, HID mouse and HID-keyboard device. The keyboard operation can be tested by the logic level on the connector pin J1-6 which behaves as the 't' key ('0' is pressed). Mouse movement is controlled by the accelerometer values and so by the tilt angle of the board. Drivers that can be used for this device are available below. The processor runs at 48MHz [38.6k].
    Linked to 0x8080, this binary image can be loaded with drag-and-drop onto the upload disk that appears when the serial loader is operating or using the KBOOT loader's USB or UART connections. When the application is running the green LED blinks at 2.5Hz.
  • uTaskerV1.4.8_FRDM-KL25Z.bin The same FRDM-KL25Z application as stand-alone software that can be loaded using the FRDM-KL25Z's USB-MSD (OpenSDA) boot loader [39.6k].

  • uTaskerFreescale_mouse_kb_VirtualCOM.inf USB composite mouse/keyboard/CDC installation file for 32-bit windows.
  • uTaskerFreescale_mouse_kb_VirtualCOM_64bit.inf USB composite mouse/keyboard/CDC installation file for 64-bit windows. See the following for a guide to installing unsigned drivers on Windows 8.1


FRDM-KL25Z USB-MSD Device using internal Flash

This application shows the FRDM-KL25Z as a USB-MSD device with a FAT in 74k of its internal Flash. There is only a standalone application (rather than boot loadable ones) in order to maximise the space Flash available. The flash drive can be formatted by a PC host when connected via USB and is seen as a 74k disk. Usually it will format it as FAT12 which gives a usable space of 54k due to the FAT12 overhead.

The command line menu shell on the debug UART (OpenSDA virtual COM) allows the file system to also be used in the "Disk Interface" menu (this is a DOS like interface but with various extra tools for analysing visible, deleted and hidden files. The interface additionally allows formatting for FAT16 or FAT32, as well as FAT12, if desired.

The application was configured with USB_INTERFACE to enable USB and USE_USB_MSD to enable the USB-MSD operation. The define FLASH_FAT is used instead of SDCARD_SUPPORT to specify that internal flash is used (the SD-card could be used in parallel with the SDCARD_SUPPORT define) and the following defines to control the location and size of the Flash area dedicated to the FAT:
#define INTERNAL_FLASH_FAT_SIZE (74 * 1024) // size of the flash area used as disk
#define FLASH_FAT_MANAGEMENT_ADDRESS (54 * 1024) // physical address where the used flash starts


FRDM-KL25Z USB-MSD Device using internal Flash with three composite CDC interfaces

This application shows the FRDM-KL25Z as a USB-MSD device with a FAT in 64k of its internal Flash. There is only a standalone application (rather than boot loadable ones) in order to maximise the space Flash available. The flash drive can be formatted by a PC host when connected via USB and is seen as a 64k disk. Usually it will format it as FAT12 which gives a usable space of 44k due to the FAT12 overhead.

The command line menu shell on the debug UART (OpenSDA virtual COM) allows the file system to also be used in the "Disk Interface" menu (this is a DOS like interface but with various extra tools for analysing visible, deleted and hidden files). The interface additionally allows formatting for FAT16 or FAT32, as well as FAT12, if desired.

Three USB-CDC interfaces are added in the composite device and these are connected to three UARTs (the maximum number of usable UARTs on the FRDM-KL25Z) as follows:
- CDC Interface 0 - Connected to the command line input but can be commanded to a USB-UART0 bridge in the USB menu. UART0 is connected to the OpenSDA virtual COM port connection.
- CDC Interface 1 - UART 1 (UART1_TX = PTE0 [J2-18], UART1_RX = PTE1 [J2-20])
- CDC Interface 2 - UART 2 (UART2_TX = PTD3 [J2-10], UART2_RX = PTD2 [J2-12])

The application was configured with USB_INTERFACE to enable USB, USE_USB_MSD to enable the USB-MSD operation as well as USE_USB_CDC and #define USB_CDC_COUNT 3 for three CDC interfaces. The define FLASH_FAT is used instead of SDCARD_SUPPORT to specify that internal flash is used (the SD-card could be used in parallel with the SDCARD_SUPPORT define) and the following defines to control the location and size of the Flash area dedicated to the FAT:
#define INTERNAL_FLASH_FAT_SIZE (64 * 1024) // size of the flash area used as disk
#define FAT_FLASH_MANAGEMENT_ADDRESS (64 * 1024) // physical address where the used flash starts


FRDM-KL25Z nRF24L01+

This application shows the FRDM-KL25Z using the Nordic Semiconductor 2.4GHz wireless transceiver nRF24L01+ as either master (primary Tx) or slave to another device. It initialises the transceiver on channel 15 at 1Mb/s with auto-ack enabled. Then messages are sent out once every 5s so that they can be received by other devices on the channel with the same configuration and echoed responses are displayed on the UART (OpenSDA virtual COM). As slave it will display receptions on its UART output and echoes modified data back to the master.

Use together with another FRDM-KL25Z as master/slave pair or any other of the Kinetis boards with a binary available for this configuration.

To build for this configuration the nRF24L01P+ interface is enabled by the define nRF24L01_INTERFACE in config.h.

Wiring Details:
nRF24L01P_CS - PORTE_BIT4 - J9-13
nRF24L01P_TX_ENABLE - PORTE_BIT0 - J2-18
nRF24L01P_DOUT - PORTE_BIT3 - J9-11
nRF24L01P_SCLK - PORTE_BIT2 - J9-9
nRF24L01P_DIN - PORTE_BIT1 - J2-20
nRF24L01P_IRQ - PORTA_BIT5 - J1-12

The default mode is master (primary Tx). To set slave mode connect the input PTC0 (J1-3) to GND at reset.


FRDM-KL25Z and character LCD

This application shows the FRDM-KL25Z driving a a 2 x 16 character LCD in 4-bit mode, connected on the following ports:

  • LCD 4-bit data bus - PTA15, PTA14, PTA13, PTA12
  • LCD RS control - PTE0
  • LCD_WR - PTE1
  • LCD_EN - PTE2
  • LCD_Backlight - PTE3

To add the LCD operation the define SUPPORT_LCD is enabled with the options #define LCD_LINES 2 and #define LCD_CHARACTERS 16, whereby a range of 1 x 8 to 4 x 40 is supported. The simulation of this configuration is shown in the screen shot below and an executable is provided - this requires no installation and can be started by extracting and simply executing the file uTaskerV1.4.8_FRDM-KL25Z_LCD.exe. It is worth noting that the simulator adapts itself to the chosen display and optionally supports Cyrillic fonts. For more information about using a character LCD see the LCD User's Guide.



Emulated FAT and TSI Slider

The following µTasker V1.4 application uses two channels of the TSI (Touch Sensor Interface) to realise a slider control on the FRDM-KL25Z (SUPPORT_KEY_SCAN and USE_SLIDER). When the slider area is touched the green LED stops blinking and the LED color is controlled by PWM outputs instead. When the slider position is moved the LED color changes from blue to red (color mixture according to the position). When the slider is no longer touched the color is held for one second before the LED starts blinking green again.
The % slider position is shown on the debug output when the slider area is touched.

Furthermore, this application also includes emulated FAT, meaning that it appears as a hard drive to a PC host and allows viewing linear data content. The application is discussed in the document µTasker - FAT Emulation, although this configuration doesn't use a large area of the internal flash for data storage and formatted viewing (due to smaller size of Flash in the KL25) but instead allows a raw display of its entire internal Flash memory and a snap-shot of its internal RAM.
To achieve this configuration it uses (USB_INTERFACE, USE_USB_MSD and FAT_EMULATION)

DAC Signal Generator

The following µTasker V1.4 application uses the DAC and DMA to generate a continuous 158Hz sine wave on the DAC0 output (PTE30 - J2-11). Its FS USB interface operates as a USB-CDC device, allowing the command line interface to be controlled there.


Return to the Kinetis landing page


µTasker Kinetis FRDM-KL25Z support. Copyright (c) 2004..2016 M.J.Butcher Consulting