Illustrated Step-by-Step Instructions: Updating the Freescale Freedom Board Firmware
Join the DZone community and get the full member experience.
Join For FreeI have received a bunch of Freescale FRDM boards to be used in an Embedded Systems programming crash course. There are multiple issues with the boards coming from the factory:
- They come with an old bootloader which is not compatible with Windows 8.x
- They have an old and outdated firmware on the board only supports a MSD bootloader
This post is a step-by-step instruction how to update Freescale FRDM boards (e.g. FRDM-KL25Z) to the latest firmware.
Preconditions
:!: Note that this instructions apply for the FRDM boards with the P&E OpenSDA bootloader (FRDM-KL03Z, FRDM-KL05Z, FRDM-KL25Z, FRDM-KL26Z, FRDM-KL46Z, FRDM-K20), but *NOT* to newer FRDM board like the FRDM-K64F and FRDM-K22F (which use a mbed bootloader which is different and does not allow to upate the bootloader).
You need
- The board (of course :-) )
- A mini USB cable to connect the board to the host
- A host machine (Windows 7 machine is needed, see note below)
- P&E USB drivers
- P&E OpenSDA Firmware files
:!: There is a bug with the factory firmware on the board which prevents it working with Windows 8.x (see “FRDM Board Bootloader fails with Windows 8.1 Preview” and “New P&E OpenSDA Firmware v114“). Windows 8 tries to write the ‘virtual’ MSD (Mass Storage Device) of the board, confusing the bootloader. Seehttps://community.freescale.com/message/440982#440982 for the getting it working with Windows 8 (many thanks to Mark Butcher!).
Configure “Do not allow locations on removable drives to be added to libraries” as discussed here: http://answers.microsoft.com/en-us/windows/forum/windows8_1-hardware/how-do-i-prevent-system-volume-information-files/815b0046-d631-4419-a43e-44083a3733f5
Download and install the P&E drivers from https://www.pemicro.com/opensda/ (you can skip this step if you have CodeWarrior or Kinetis Design Studio installed).
Download the OpenSDA Firmware Files from https://www.pemicro.com/opensda/(registration required). You can skip this step if you have Kinetis Design Studio V1.1.1 installed, as it comes with the files in C:\Freescale\KDS_1.1.1\pemicro\opensda).
Unzip that archive to your local machine.
Inside the archive, there is as wellOpenSDA_Bootloader_Update_App_v111_2013_12_11.zip: extract that file too:
There are two steps for the update required:
- Update the bootloader. This makes it Windows 8 aware.
- Update the board firmware. This gives you MSD bootloader, a USB CDC interface and the ability to debug the board as an OpenSDA board.
:!: In the steps below you are asked to copy files to the ‘board’ drive. On Windows, you can use the ‘Send to’ context menu, or drag&drop the file to the drive. If this does not work, use the DOS/command Shell copy command. A common failure for this operation is using any kind of ‘File Commander’ or special File Manager. Another common failure point are any kind of virus scanner, so if things are still failing, temporarily disable your firewall/virus scanner.
Updating the Bootloader
- Press first the Reset button (and keep it pressed) while power theboardwiththeOpenSDA USB connector:
- The green LED will blink with a frequency of 1 Hz:
- The board willshowupasBOOTLOADER drive on your system:
- Copy BOOTUPDATEAPP_Pemicro_v111.SDA to the BOOTLOADER driver:
- The copy operation takes about 2-3 seconds, and the green LED should still blink with a 1 Hz frequency. If it blinks faster, the copy operation failed. :-(
- Unpower the board:
- Power the board again normally (do NOT press the reset button this time):
- Wait a second so the bootloader gets reprogrammed. The board shall showupagainasBOOTLOADER, with the green LED blinking at 1 Hz.
- You can check if the V1.11 bootloader has been correctly programmed if you open theBOOTLOADER\SDA_INFO.HTM file with your web browser:
If you have the V1.11 bootloader on your board, then everything is ready for the next step: loading the MSD+CDC+Debug board firmware.
Updating Board Firmware
The P&E OpenSDA firmware features three functions:
- USB MSD bootloader: the board looks like a memory (MSD=Mass Storage Device), so you can copy .s19 files to it to get it programmed
- USB CDC serial bridge: the OpenSDA debug firmware is like a USB-to-Serial Converter, so the microcontroller on the board can communicate with the host PC
- USB Multilink OpenSDA debug: the board can be used for debugging e.g. with CodeWarrior or Kinetis Design Studio.
Because the firmware is board-specific, you need to copy the *correct* firmware file to your board. Carefully select and use the firmware *.SDA file matching your board:
To program the board with the new firmware:
- Press first the Reset button (and keep it pressed) while power theboardwiththeOpenSDA USB connector:
- The green LED will blink with a frequency of 1 Hz:
- The board willshowupasBOOTLOADER drive on your system:
- Copy MSD-DEBUG-<boardname>_Pemicro_v*.SDA (matching your board!)totheBOOTLOADER driver:
- The copy operation takes about 2-3 seconds, and the green LED should still blink with a 1 Hz frequency. If it blinks faster, the copy operation failed. :-(
- Unpower the board:
- Power the board again normally (do NOT press the reset button this time):
- If needed, your host system will install the device drivers. In your Windows Device Manager, you should see the PEMicro OpenSDA Debug Driver, the WinDriverand an OpenSDA – CDC Serial Port:
- The green LED shall be permanently on:
- The board shows up with its name as device:
- You can check if the firmware has been correctly programmed if you open theSDA_INFO.HTM file with your web browser: It should show an installed application matching your board:
Done! Now you can use the board to be programmed with an S19 file, or by the debugger, or it can communicate with the host using the USB CDC interface :-).
Summary
The factory boards come shipped with an outdated firmware and application (which only supports MSD bootloading). To make the board working with Windows 8 it requires a bootloader update. To really use the board, the latest firmware needs to be loaded on the board too.
Happy Bootloading
Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
Future of Software Development: Generative AI Augmenting Roles and Unlocking Co-Innovation
-
How to Use an Anti-Corruption Layer Pattern for Improved Microservices Communication
-
Five Java Books Beginners and Professionals Should Read
-
Observability Architecture: Financial Payments Introduction
Comments