- 1 Required Packages
- 2 Get the software
- 3 Programming the FRDM-KL26 Board
Once you get to the stage where you want to program your the ELC firmware there are two options. Either you can use one of the pre-compiled binaries which can be downloaded to the FRDM-KL26Z board using a flash programming application or you can build your own binary from source using the code provided. The latter option will require you to set up a development environment.
If you just want to use one of the pre-compiled binaries you still need to install the Segger or PEMicro drivers and you'll need Git to acquire the binary ".srec" files.
Development environment for ARM
The code for Bluebird ELC was developed using Atollic Truestudio which is a fully featured free IDE for code development in C/C++. It can be downloaded from their website:
The source code repositories contain project files for use with Atollic which therefore makes it the easiest way to start modifying the code. If you're a more experienced user you can configure your own preferred development environment.
Git and Tortoise Git
All the source code is controlled using Git, which is used to track changes and releases. Git can be downloaded for free from their website:
Git is the underlying source control system that can be operated using the command line, however a there are several 3rd party graphical user interfaces that can be installed to make usage a bit more friendly. A good one is TortoiseGit which can be downloaded from here:
A tutorial on basic Git usage can be found here.
Segger and PEMicro
The FRDM-KL26Z evaluation board comes with an on-board tool which can be programmed with firmware compatible with the Segger J-Link or PEMicro toolsets. The Atollic project is configured for use with the J-Link driver but this can be easily changed. Both of these drivers should be installed with Atollic Truestudio but additional tools can be downloaded from Segger and PEMicro websites.
- J-Link toolset - https://www.segger.com/downloads/jlink/#J-LinkSoftwareAndDocumentationPack
- PEMicro - http://www.pemicro.com/opensda/ (registration required)
Get the software
Visit the software page to clone the source code repository or download pre-compiled binaries.
Programming the FRDM-KL26 Board
On-Board Debug Tool
The first time you open a new FRDM-KL26Z evaluation board you will need to upgrade the firmware in the on-board debugger. This only needs to be done once for each new FRDM-KL26 board.
It appears this process can be done on Windows 10 using "safe mode". Previously it seemed that only Windows 7, Vista and XP machines could carry out the debug tool firmware upgrade procedure.
Entering safe mode on Windows 10
- Go to the "Settings" Menu
- Choose "Update & Security"
- Choose "Recovery" from the menu.
- Click "Restart Now" under the "Advanced Startup" heading. Note that this will restart your computer.
- Once your PC restarts, you'll need to choose "Safe Mode" from the menu. (Option 4).
Debug Tool Firmware Upgrade
On Windows 10 in "safe mode", or on any Windows 7, Vista or XP machine, even without the Segger or PEMicro drivers installed, the following procedure can be used. Download the PEMicro OpenSDA firmware files here.
- Holding the reset button on the evaluation board, connect the OpenSDA USB socket to the PC, then release the reset button
- A disk drive named "Bootloader" should appear like a removable flash drive.
- Copy the J-Link OpenSDA firmware file to the "Bootloader" disk.
- Safely remove the drive as you normally would a USB flash drive.
To Confirm the upgrade
- Connect the device to the PC you plan to use for programming with the Segger or PEMicro drivers installed, again using the OpenSDA USB socket.
- In device manager, the device should enumerate as j-link driver under USB devices
- If you're using Windows 10 in safe mode, you may now restart your PC to return to normal mode.
Programming the ELC Firmware into the KL26Z Microcontroller
It is recommended that you program the ELC firmware into the FRDM-KL26Z evaluation board the first time before it is installed on the ELC control board as an extra precaution. After the ELC firmware has been programmed once, it can be left installed on the control board for future programming iterations. This is to make sure that the firmware loaded is "known" and configures the microcontroller pins in a predictable way when the board powers-up.
Using J-Flash Lite
The result of building the source code is a binary program file which can be loaded into the KL26Z microcontroller. There are pre-compiled binaries available or you can build your own custom ones. The binary file should be in the ".srec" format. Once you have the ".srec" file you want to load into the microcontroller, you can use the following procedure:
- Connect the KL26Z Evaluation board to the PC using the OpenSDA USB socket
- Open J-Flash Lite
- Select the appropriate microcontroller (NXP MKL26Z128XXX4) from the list
- Choose, "SWD" interface, and speed "1000"
- Click "OK"
- Click the button in the "Data File" section and browse to the ".srec" file you want to program
- Click "Program Device"