User Tools

Site Tools


manual:uart_demo

This is an old revision of the document!


Firmware updates using the UART communication interface

Bootloader configuration

In order to perform firmware updates with the OpenBLT through the UART communication interface, double-check that this communication interface is configured in “blt_conf.h”. The following macro should have a value of 1. If this macro did not yet have a value of 1, the bootloader should be rebuild after making the change.

#define BOOT_COM_UART_ENABLE            (1)

Using MicroBoot

The MicroBoot utility needs to be configured to connect to the correct COM-port and to communication at the correct baudrate:

  • Start MicroBoot by double-clicking “\Host\MicroBoot.exe” (on Linux it is “\Host\MicroBoot”).
  • Click the “Settings”-button and select “XCP on RS232” from the “Interface selection” dropdown box.
  • Select the PC's communication device that the board is connected to.
  • Select the baudrate to the value specified by macro BOOT_COM_UART_BAUDRATE in “blt_conf.h”. Typically, this is 57600 bits/sec for the demo programs.

Once you saved the settings by clicking the “OK”-button, MicroBoot is now ready for action!

After building your user program, its S-record formatted firmware file can be downloaded to the remaining flash memory using the bootloader. In Microboot click the “Browse”-button and select your user program's firmware file. For the demo programs, this one is located in the “.\Prog\bin\” directory. Once the firmware file was selected, the download should automatically start.

Once the download completed, the newly programmed software will be started by the bootloader. For the demo program's you can verify this by checking that the LED blinks. Congratulations! That's all there is to using the bootloader.

Using BootCommander

The BootCommander command line interface (CLI) program allows you to configure all communication settings via options on the command line. The following example demonstrates how to call BootCommander for making a firmware update with one of the demo programs. Just correct the “-d” option to select the PC’s communication device that the board is connected to. On Linux, change COMx to the full path of the communication device, for example /dev/ttyUSB0.

BootCommander -s=xcp -t=xcp_rs232 -d=COM5 -b=57600 demoprog_olimex_stm32p405.srec

The example assumes that the S-record of the demo user program is located in the same directory as where the BootCommander executable itself resides. If not, then simply prepend the absolute (or relative) directory to the name of the S-record firmware file.

Notes

Depending on the configuration of the bootloader, there might be a delay between a system reset and the actual start of the user program. This is needed by design for the bootloader's backdoor functionality. Check configurable BOOT_BACKDOOR_ENTRY_TIMEOUT_MS in “blt_conf.h” for the exact delay time.

To prevent having to run MicroBoot/BootCommander with super user privileges under Linux, add yourself to the dialout group. Example for Debian/Ubuntu distributions:

sudo usermod -G dialout -a $USER
manual/uart_demo.1530708578.txt.gz · Last modified: 2019/09/24 22:11 (external edit)