AnsweredAssumed Answered

How to get blhost to talk to ROM bootloader on the FRDM-KL27Z?

Question asked by Robert Poor on Sep 21, 2017
Latest reply on Sep 27, 2017 by Kerry Zhou

I want to communicate with the ROM bootloader on the FRDM-KL27Z using blhost (in my case, running on Mac OS X), but I have not been able to get blhost to communicate with the ROM bootloader. 

 

Here's what I've tried:

 

First, I power cycled the board (unplugged the USB and re-plugged it WITHOUT holding down the RST button).  The green LED is now on solid.  But I could not get a response via serial modem:

 

$ blhost --version
blhost 2.0.0
Copyright (c) 2013-15 Freescale Semiconductor, Inc.
All rights reserved.
$ ls /dev/cu.usb*
/dev/cu.usbmodem1411    /dev/cu.usbmodem242     /dev/cu.usbmodem97
$ blhost --port /dev/cu.usbmodem242 -- get-property 1
^C
$ blhost --port /dev/cu.usbmodem242,9600 -- get-property 1
^C
$ blhost --port /dev/cu.usbmodem242,57600 -- get-property 1
^C
$ blhost --port /dev/cu.usbmodem242,115200 -- get-property 1
^C

 

Maybe /dev/cu.usbmodem242 is the wrong port?  Let's try the other two ports:

 

$ blhost --port /dev/cu.usbmodem97 -- get-property 1
Could not open serial port.Error: UartPeripheral() cannot open PC UART port(/dev/cu.usbmodem97), speed(57600 Hz).
$ blhost --port /dev/cu.usbmodem1411 -- get-property 1
Could not open serial port.Error: UartPeripheral() cannot open PC UART port(/dev/cu.usbmodem1411), speed(57600 Hz).

 

Maybe we should be using the USB interface instead?   Using the Mac System Information window, we can find the Vid and Pid:

 

OpenSDA Hardware:

  Product ID: 0x0089

  Vendor ID: 0x1357

  Version: 8.00

  Serial Number: SDA597D4E7F

  Speed: Up to 12 Mb/sec

  Manufacturer: P&E Microcomputer Systems Inc.

  Location ID: 0x14100000 / 22

  Current Available (mA): 500

  Current Required (mA): 464

  Extra Operating Current (mA): 0

 

$ blhost --usb 0x1357,0x0089 -- get-property 1
Error: UsbHidPeripheral() cannot open USB HID device (vid=0x1357, pid=0x0089, sn=).

 

Okay, so maybe the bootloader isn't listening at all.  So I then unplugged the USB cable and held down the RST pin (JSW2) while plugging in the USB cable.  The green LED is now blinking about once every second.  (I believe that means it's in the ROM bootloader.)  Then:

 

$ ls /dev/cu.usb*
/dev/cu.usbmodem1411    /dev/cu.usbmodem97

 

Hmm -- our favorite USB port is not mounted.  I don't expect this to work, but for completeness, let's try the remaining two:

 

$ blhost --port /dev/cu.usbmodem97 -- get-property 1
Could not open serial port.Error: UartPeripheral() cannot open PC UART port(/dev/cu.usbmodem97), speed(57600 Hz).
$ blhost --port /dev/cu.usbmodem1411 -- get-property 1
Could not open serial port.Error: UartPeripheral() cannot open PC UART port(/dev/cu.usbmodem1411), speed(57600 Hz).

 

Let's try the USB port instead:

 

$ blhost --usb 0x1357,0x0089 -- get-property 1
Error: UsbHidPeripheral() cannot open USB HID device (vid=0x1357, pid=0x0089, sn=).

 

At this point, I've exhausted all the ideas I can think of.   I suspect it's something simple.  Any hints appreciated!

Outcomes