LPC Bootloader Auto-Baud

Before I found the updated version of lpc21isp I thought I was stuck using flashmagic, or writing my own tool to program the chip over serial. When I first looked through the user manual I unfortunately missed the syntonization protocol the bootloader follows. I was about to try looking at the data being transmitted on an oscilloscope when I found the correct way to finish the auto-baud routine. Section 21.3.3 of the lpc111x user manual (UM10398) fits it all into one paragraph.

The confusing aspect of this protocol is that earlier in the user manual section 10.5.14 specifies doing auto-baud using an ‘A’ or ‘a’ character and gives reasoning as to why those characters are used. The ISP auto-baud protocol requires the ‘?’ character.

If one character was all that was needed to enter the bootloader I would try and think of a couple reasons for the use of the ‘?’ character. However, after sending the initial ‘?’ there are another couple of steps required.

Connected to the bootloader.

The protocol to access the bootloader is as follows:

  • Reset with the ISP pin held low
  • Connect to RX/TX and open a terminal with your favorite program
  • ‘?” and hit return
  • LPC111x will return ‘Synchronized’
  • Reply with ‘Synchronized’
  • LPC will return ‘OK’
  • Reply with the crystal frequency in kHz (12000 in my case)
  • LPC will return ‘OK’
  • Auto-baud is now finished and ISP commands can be executed.

In my case the formatting covered up some of what I had typed, but everything worked perfectly even at 115200 baud.

I might still write something in python to flash new code onto my board, but the new version of lpc21isp looks promising and covers OSX and Linux.