A bootloader shall be small and concise. I very much like bootloaders which do not need a ‘special’ program on the host, so I prefer a simple terminal for this. While porting my serial bootloader to the NXP FRDM-K64F board, I have found RealTerm which offers a lot of cool features:
The RealTerm terminal program can be downloaded from SourceForge here: http://realterm.sourceforge.net/. (download page: https://sourceforge.net/projects/realterm/files/). I’m using the version 2.0.00.70.
Loading S-Record Files
In my serial bootloader, I use the shell command
BL load s19
to load a S19 (S-Record) file. The bootloader expects a normal S19 ASCII file, so I could type that file in if I wish ;-).
Much easier is to use the ability to send that file from the terminal. The problem is usually as the bootloader is only using RX and TX, there is no hardware flow control. A solution would be to use software flow control (XON/XOFF), but my experience is that this did not work out great.
What worked very well is to have the ability to slow down the sending with delays. And here RealTerm has two settings: A delay (ms) for each character sent, and a delay for each line:
Of course there are more advanced ways to deal with the missing flow control problem, but this approach is very simple and does not need any overhead in the bootloader.
The original bootloader (see “Serial Bootloader for the Freedom Board with Processor Expert“) is now ported to Kinetis Design Studio and FRDM-K64F board. It uses now a simple buffering for a flash page to cut programming time.
If you want to have a look at the updated serial bootloader for the NXP K64F (FRDM-K64F board), it is on GitHub.
You can try the bootloader with the example blinky project wich is in GitHub.
💡 If using a OpenSDA USB CDC connection (Serial over USB), make sure you use the latest OpenSDA firmware, e.g. Segger J-Link OpenSDA Firmware with Virtual MSD. Earlier OpenSDA firmware has the issue that characters might be lost during transmission.
RealTerm is a powerful open source terminal program suitable for serial bootloaders. It has many features, and I love the most the ability to configure the file sending functionality.
Happy Loading 🙂
- RealTerm Terminal Program: http://realterm.sourceforge.net/
- FRDM-K64F Bootloader: https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/KDS/FRDM-K64F120M/FRDM_K64F_Bootloader
- FRDM-K64F Bootloader example application: https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/KDS/FRDM-K64F120M/FRDM-K64F_Bootloader_Test
- Serial Bootloader for FRDM-KL25Z: Serial Bootloader for the Freedom Board with Processor Expert