Kinetis Bootloader Demo Application User's Guide
Kinetis Bootloader Demo Application User's Guide
Kinetis Bootloader Demo Application User's Guide
Contents
The Kinetis bootloader serves as the standard bootloader for all Kinetis devices. It provides a standard interface to the device
via all of the available peripherals supported on a given Freescale Kinetis device. The Kinetis bootloader interface comes in
several forms, ranging from ROM, serial flashloader, or a customized flash-resident bootloader. Some Kinetis devices arrive
with a ROM containing the Kinetis bootloader, while others arrive pre-programmed from the factory with a one-time-use
serial flashloader. For a customized interface, customers can leverage the Kinetis bootloader source code to create a unique
flash-resident bootloader that is both compatible with tools that understand the bootloader interface, and are capable of
supporting application-specific features. Freescale provides utilities to demonstrate how to interface with the bootloader.
Host projects:
• Microsoft® Visual Studio® Professional 2015 for Windows ® OS Desktop
• Microsoft® .NET Framework 4.5 (included in Windows OS 8)
• Microsoft® Visual C++ Redistributable for Visual Studio 2013 (vcredist_x86.exe)
• Apple® Xcode v.7.3 (for the blhost and elftosb tools)
• GNU Compiler (GCC) v.4.8.1 (for the blhost tool)
This section describes how to connect the platform to the computer and download the pre-built Kinetis bootloader
application. For information about the configuration of a board, find the subsection dedicated to a specific board in Appendix
B. All examples assume that the board is in its factory default configuration (jumpers, OpenSDA, etc).
For PCs running on Windows OS, install the P&E Micro OpenSDA drivers in order to communicate with the Kinetis device
over a serial port.
1. Connect the module to the USB port on a PC using the module's debug USB connector, J2 for the TWR-K64F120M.
2. Download the driver package from the P&E Micro website (www.pemicro.com/opensda/ ) and run the installer.
3. After the installer is finished, plug in the module and open the Windows Device Manager to show the COM port
number assigned to the virtual serial port.
• Open a command prompt in the directory containing blhost. For Windows OS, blhost is located in
<install_dir>/bin/Tools/blhost/win. To open a command prompt, go to the Windows OS start menu and
type "cmd" in the search box at the bottom of the window. Navigate to the blhost folder using change directory (CD)
commands.
• Type blhost --help to see the complete usage of the blhost utility.
For this exercise, verify the Kinetis device is running the bootloader firmware application.
• Press the "Reset" button on the platform.
• Note what the COM port that the platform is connected to. See step 3 of Section 3.1, "Connect the platform". For this
guide, the device is connected to COM23.
• Type blhost -p COM23 -- get-property 1 to get the bootloader version from the Kinetis bootloader.
• Something similar to the screen shot below indicates that blhost.exe is successfully communicating with the Kinetis
bootloader on the platform.
Figure 7. Host communication with Kinetis bootloader using the UART0 peripheral
For the TWR-K64F120M module:
• Press the "Reset" button on the platform.
• Type blhost -u -- get-property 1 to get the bootloader version from the Kinetis bootloader.
• Something similar to the screen shot below indicates that blhost.exe is successfully communicating with the Kinetis
bootloader on the platform.
Figure 8. Host communication with Kinetis bootloader using the USB peripheral
NOTE
The base address of a user application for use with a flash-resident bootloader is different
than the application base address when using a ROM-based bootloader. The application
linker file must be updated to link the image to the correct base address. In addition, the
application vector table must be updated based on the correct application location.
Figure 14. User application vector table and Bootloader Configuration Area (BCA)
All boards must be in their default factory state for jumper settings.
NOTE
If testing the UART interface on mbed port J37, add shunts on J25 pin 2-3. If testing the
UART interface on TWR-SER, add shunts on J25 pin 1-2 and J22 pin 1-2.
Table 3. MKL25Z4 bootloader – FRDM-KL25Z
Peripheral Instance Port Signal AltMode FRDM-KL25Z
Test points
UART 0 PTA2 UART0_TX 2 OpenSDA
NOTE
If testing the UART interface on OpenSDA port J511, add shunts on J505 pin 2-3 and
J506 pin 2-3.
Table 16. MKV11Z7 flashloader – TWR-KV11Z75M
Peripheral Instance Port Signal AltMode TWR-KV11Z75M
Test points
UART 0 PTD6 UART0_TX 3 J24 pin 27
PTD7 UART0_RX J24 pin 28
I2C 0 PTB0 I2C0_SCL 2 J18 pin 17
PTB1 I2C0_SDA J18 pin 18
SPI 0 PTE16 SPI0_PCS0 2 J18 pin 5
PTE17 SPI0_SCK J18 pin 6
PTE18 SPI0_SOUT J18 pin 7
PTE19 SPI0_SIN J18 pin 8
FlexCAN 0 PTA24 CAN0_TX 2 J24 pin 13
PTA25 CAN0_RX J24 pin 14
NOTE
CAN connection – option 1, use CAN transceiver on board:
1. Put jumper on J5 pin 1-2, and keep default jumpers on J5 5-6, and 7-8
2. Connect TWR-KV11Z75M J524 pin 2 to BusPal (KV46) J13 pin 2
3. Connect TWR-KV11Z75M J524 pin 1 to BusPal (KV46) J13 pin 1
3. Wring CAN0_RX
Wire CAN0_TX on TWR-KV11Z75M J24 pin 14 to TWR-SER J5 pin 6 - signal
name C_RXD
4. Connect to BusPal (KV46)
Connect TWR-SER CANH, J7 pin 1 to BusPal KV46 J13 pin 2
Connect TWR-SER CANH, J7 pin 3 to BusPal KV46 J13 pin 1
NOTE
CAN connection - Option 1, use the CAN transceiver on the board
1. CAN0_TX, Elev B68 -> TWR-SER J5 pin 8 , TWR-SER J7 pin 1 -> BusPal
(KV46) J13 pin 2
2. CAN0_RX, Elev B67 -> TWR-SER J5 pin 6 , TWR-SER J7 pin 3 -> BusPal
(KV46) J13 pin 1
10 Revision history