TWR-K21F120M

This Freescale tower board is based on the K21FN1M0VMC12 which is a 120MHz device from the performance and integration K21 family with Cortex-M4 core, FPU and USB. This K21 device has 1M Flash and 128k SRAM and is in an 121 pin MAPBGA thin-profile package, whereby the 120MHz K21 is also available in 144 pin LQFP or MAPBGA and its memory ranges of 640k...1M Flash with 128k SRAM. K21 parts with 50MHz maximum CPU frequency are furthermore available in 80 pin LQFP, or 121 pin MAPBGA with memory ranges of 192k...512k Flash and 32...128k RAM. 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: TWR-K21F120M

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

TWR-K21F120M 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_TWR-K21F120M_KBOOT_HID_UART_MSD_SDHC.bin KBOOT compatible USB-HID loader with composite USB-MSD loading, as well as KBOOT UART loading on UART 5 (available on OSJTAG virtual COM) at 57'600 Baud, or from an inserted SD card 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 or as a file on the SD card) [24.2k]. When operating, the green LED blinks at 5Hz. To force the loader reset the board with push button SW3 held down. To disable the watchdog reset the board with push button SW2 held down. This can be loaded using CodeWarrior's Flash utility via the TWR-K21F120M's OSJTAG debug interface. Note that the loader limits application sizes to 70k - it can be built without limits using the µTasker project.
  • uTaskerV1.4.8_BM_TWR-K21F120M_8080.bin TWR-K21F120M application with command-line menu on the UART 5 (OSJTAG virtual COM) with various menu items. Output from the on-board accelerometer can be viewed in the I2C menu. The USB device is USB-MSD and so the board appears as a hard drive to the PC when the SD card is inserted into the socket on the board. Files can then be read and written to the SD card from the PC and also worked with via the DOS-like command line interface in the disk-interface sub-menu.
    The processor runs at 120MHz. [59.5k].
    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 orange LED blinks at 2.5Hz.
    Low power modes can be set in the application menu (when LLS has been entered, pressing the push button SW3 will wake and return to the fully functional mode - more details of this operation can be found in Low-Leakage Wakeup (LLWU) Support).
  • software.bin The same TWR-K21F120M application that can be copied to the SD card (or memory stick; see USB-MSD Host Loader below) and will be loaded to the processor when the board starts [59.5k] (the name is required for it to be recognised - see the Serial Loader User's Guide for more details).
  • uTaskerV1.4.8_TWR-K21F120M.bin The same TWR-K21F120M application as stand-alone software that can be loaded using CodeWarrior's Flash utility via the TWR-K21F120M's OSJTAG debug interface [60.5k].

USB-CDC with 6 UARTs

The following µTasker V1.4 application configures for a 6 USB-CDC interface composite device by enabling USB-CDC and setting the define for USB_CDC_COUNT to 6, the maximum number of available UARTs in the K21 on the TWR-K21F120M. The first interface (0) is connected to the command line shell (as is UART5 - the UART connected to the OSJTAG virtual COM port connection) but can be commanded to a USB-UART5 bridge in the USB menu. The other 5 USB-CDC interfaces perform dedicated USB-UART bridges as follows:
CDC Interface 1 - UART 0 (UART0_TX = PTA15, UART0_RX = PTA14)
CDC Interface 2 - UART 1 (UART1_TX = PTC4, UART1_RX = PTC3)
CDC Interface 3 - UART 2 (UART2_TX = PTD3, UART2_RX = PTD2)
CDC Interface 4 - UART 3 (UART3_TX = PTC17, UART3_RX = PTC16
CDC Interface 5 - UART 4 (UART4_TX = PTC15, UART4_RX = PTC14

USB-MSD Host (Memory Stick) Loader

USB-MSD host loader for updating firmware from a memory stick.

  • uTaskerSerialBoot_TWR-K21F120M_MemStick.bin

  • Debug output is available on UART 5 (on OSJTAG virtual COM) at 115'200 Baud [25.6k]; applications to be loaded at link address 0x8080. The same applications "software*.bin" can be loaded as with the SD card loader (see above).
    When operating, the green LED blinks at 5Hz. To force the loader reset the board with push button SW3 held down.
    To disable the watchdog, reset the board with push button SW2 held down.
    This can be loaded using CodeWarrior's Flash utility via the TWR-K21F120M's OSJTAG debug interface. Note that the loader limits application sizes to 64k - it can be built without limits using the µTasker project.


    Emulated FAT Operation

    The following µTasker V1.4 application configures for a USB-MSD device as emulated FAT for linear data. It uses (USB_INTERFACE, USE_USB_MSD and FAT_EMULATION). This enables the FAT emulation and makes the device accessible from a USB host. The application is discussed in the document µTasker - FAT Emulation and allows viewing data files in binary and formatted formats. For example, for retrieving sampled data from linear internal or external SPI Flash to a .csv file for direct import into a processing program. A typical data view of the .cvs formatted view is shown below:



    Return to the Kinetis landing page


    µTasker Kinetis TWR-K21F120M support. Copyright (c) 2004..2018 M.J.Butcher Consulting