Reflashing bootloader on FRDM-KL06 and FRDM-K25Z boards from linux

15 Apr 2016

The handbook for the FRDM-KL05Z and FRDM-KL25Z say that if you have a board with an older bootloader then you have to use windows to update it.

A bit of experimentation shows that this is not true, and is is in fact possible to make these boards work using a modern Linux system.

There seems to be very little information on this subject, and much of it (including the mbed Handbook) is wrong, so I'm putting this here in the hope that is will help others.

Linux Bootloader Reflashing Procedure

  • Download the P&E "Firmware Apps" from http://www.pemicro.com/opensda/
  • Extract "BOOTUPDATEAPP_Pemicro_v111.SDA" from that zip file.
  • Run the following commands:
sudo udevadm control -s
# Hold the reset button while connecting the USB cable
sudo mount -t vfat -o sync /dev/sdb /mnt # replace /dev/sdb as appropriate
sudo cp BOOTUPDATEAPP_Pemicro_v111.SDA /mnt
sudo umount /mnt
# Unplug the usb cable
# Plug the USB cable without pressing the reset button
# wait a few seconds
# Unplug the USB cable
sudo udevadm control -S
  • The bootloader should now be updated to v1.11. Follow the normal mbed reflashing procedure.

Details

There are two bugs in the old bootloader that cause the normal procedure to fail on Linux. Both of these are fixed in the 1.11 bootloader:

  1. blkid probes sector #0x1e4500 looking for a raid signature. This crashes the bootloader and the device needs rebooting. Workaround by temporarily disabling udev. Filesystem autoprobing causes similar crashes. Workaround with mount "-t vfat".
  2. Image writing fails due to out of order disk writes. Workaround with mount "-o sync".
19 Apr 2016

Thanks Paul! I updated the handbook.

01 Sep 2016

Thank you Paul, it worked!