Flashloader application
The Kinetis platform must be connected to a host computer to interface with the MCU flashloader application. After the platform is connected, use the blhost or KinetisFlashTool application to program a user application into the Kinetis flash memory.
Connecting to the Kinetis platform
The flashloader supports UART and USB connections to a computer. See the Reference Manual for a specific device to determine the peripherals supported by the flashloader application and the signals route to the pins of the Kinetis platform. After the Kinetis platform is powered up, there is a physical serial/USB connection between the Kinetis platform and host. The Kinetis device is ready to receive commands.
For this example, a Kinetis device is connected to a serial-to-USB converter that enumerates on a Windows® operating systems PC as a Serial Port on COMx.
UART connection to MCU platform
Alternate UART connection to MCU platform
Host utility application - blhost
This section describes how blhost host utility program is used to communicate with the MCU bootloader.
Open a command prompt in the directory containing blhost.
Type blhost –help to see the complete usage of the blhost utility.
Verify if the Kinetis device is connected and is running the flashloader firmware application.
Assumption: The Kinetis platform just came out of reset.
Check under the COM port in Device Manager that the Kinetis platform is connected. In this example, let us say that the device is connected to COMx.
Type blhost -p COMx – get-property 1 to get the flashloader version from the flashloader.
Below screenshot shows that blhost is successfully communicating with the Kinetis platform.
Host communication with MCU flashloader
Flashing the user application
The flashloader issue two commands to program the Kinetis flash memory with a user application once the communication establishes between the flashloader and the host.
blhost -p COMx – flash-erase-all - Erases the entire flash array.
blhost -p COMx – write-memory 0 myApp.bin – Writes the myApp.bin binary image to address 0 of the Kinetis flash memory.
[Optional] blhost -p COMx – reset – Resets the Kinetis platform and launches the user application. Note: the flashloader is no longer running on the device, so further commands issued from the blhost utility fail.
After issuing the reset command, allow 5 seconds for the user application to start running.
Below screenshot shows the successful completion of the above commands.
Programming a user application using the MCU flashloader
KinetisFlashTool application
The KinetisFlashTool application can be used to program an application to the device. See the Kinetis Flash Tool User’s Guide for more information.