Over a million developers have joined DZone.

Illustrated Step-by-Step Instructions: Updating the Freescale Freedom Board Firmware

· IoT Zone

Access the survey results 'State of Industrial Internet Application Development' to learn about latest challenges, trends and opportunities with Industrial IoT, brought to you in partnership with GE Digital.

I 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:

  1. They come with an old bootloader which is not compatible with Windows 8.x
  2. 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.

FRDM Board

FRDM Board

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

  1. The board (of course :-) )
  2. A mini USB cable to connect the board to the host
  3. A host machine (Windows 7 machine is needed, see note below)
  4. P&E USB drivers
  5. 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).

P&E USB Drivers

P&E USB Drivers

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).

P&E OpenSDA Firmware Apps

P&E OpenSDA Firmware Apps

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:

BOOTUPDATEAPP_Pemicro_v111.SDA

BOOTUPDATEAPP_Pemicro_v111.SDA

There are two steps for the update required:

  1. Update the bootloader. This makes it Windows 8 aware.
  2. 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

  1. Press first the Reset button (and keep it pressed) while power theboardwiththeOpenSDA USB connector:
    Power-On with Reset Pressed

    Power-On with Reset Pressed

  2. The green LED will blink with a frequency of 1 Hz:
    Blinks with 1 Hz

    Blinks with 1 Hz

  3. The board willshowupasBOOTLOADER drive on your system:
    BOOTLOADER

    BOOTLOADER

  4. Copy BOOTUPDATEAPP_Pemicro_v111.SDA to the BOOTLOADER driver:
    Copy to BOOTLOADER Drive

    Copy to BOOTLOADER Drive

  5. 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. :-(
  6. Unpower the board:
    Unpowered Board

    Unpowered Board

  7. Power the board again normally (do NOT press the reset button this time):
    Powering the Board Normally

    Powering the Board Normally

  8. Wait a second so the bootloader gets reprogrammed. The board shall showupagainasBOOTLOADER, with the green LED blinking at 1 Hz.
    BOOTLOADER

    BOOTLOADER

  9. You can check if the V1.11 bootloader has been correctly programmed if you open theBOOTLOADER\SDA_INFO.HTM file with your web browser:
    Bootloader Version 11.1

    Bootloader Version 11.1

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:

  1. 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
  2. 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
  3. 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:

Different Firmware for each board

Different Firmware for each board

To program the board with the new firmware:

  1. Press first the Reset button (and keep it pressed) while power theboardwiththeOpenSDA USB connector:
    Power-On with Reset Pressed

    Power-On with Reset Pressed

  2. The green LED will blink with a frequency of 1 Hz:
    Blinks with 1 Hz

    Blinks with 1 Hz

  3. The board willshowupasBOOTLOADER drive on your system:
    BOOTLOADER

    BOOTLOADER

  4. Copy MSD-DEBUG-<boardname>_Pemicro_v*.SDA (matching your board!)totheBOOTLOADER driver:
    Copy to BOOTLOADER Drive

    Copy to BOOTLOADER Drive

  5. 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. :-(
  6. Unpower the board:
    Unpowered Board

    Unpowered Board

  7. Power the board again normally (do NOT press the reset button this time):
    Powering the Board Normally

    Powering the Board Normally

  8. 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:
    P&E OpenSDA Drivers in Device Manager

    P&E OpenSDA Drivers in Device Manager

  9. The green LED shall be permanently on:
    Green LED On

    Green LED On

  10. The board shows up with its name as device:
    Board Device

    Board Device

  11. 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:
    Debug Application Firmware Loaded

    Debug Application Firmware Loaded

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 

The IoT Zone is brought to you in partnership with GE Digital.  Discover how IoT developers are using Predix to disrupt traditional industrial development models.

Topics:

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}