User Tools

Site Tools


manual:usb_demo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:usb_demo [2018/07/03 12:32]
voorburg
manual:usb_demo [2023/06/27 09:35] (current)
voorburg [USB driver installation]
Line 12: Line 12:
 ===== USB driver installation ===== ===== USB driver installation =====
  
-Once the bootloader is programmed and running on your microcontroller system, you will be prompted to install the USB driver, after connecting the system to your PC's USB port. The driver installation is described on a seperate page: [[manual:​demos:​usb_driver_install|OpenBLT USB driver installation instructions]].+Once the bootloader is programmed and running on your microcontroller system, you might be prompted to install the USB driver, after connecting the system to your PC's USB port. The driver installation is described on a seperate page: [[manual:​demos:​usb_driver_install|OpenBLT USB driver installation instructions]].
  
-===== Using Microboot ​=====+===== Using MicroBoot ​=====
  
-The Microboot ​utility needs to be configured to communicate via USB:+The MicroBoot ​utility needs to be configured to communicate via USB:
  
-  * Start Microboot ​by double-clicking "​\Host\**MicroBoot.exe**"​ (on Linux it is "​\Host\**MicroBoot**"​).+  * Start MicroBoot ​by double-clicking "​\Host\**MicroBoot.exe**"​ (on Linux it is "​\Host\**MicroBoot**"​).
   * Click the "​**Settings**"​-button and select "**XCP on USB**" from the "​Interface selection"​ dropdown box.   * Click the "​**Settings**"​-button and select "**XCP on USB**" from the "​Interface selection"​ dropdown box.
  
-Once you saved the settings by clicking the "​**OK**"​-button, ​Microboot ​is now ready for action!+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. ​+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. ​
  
-{{:manual:demos:​olimex_stm32h103_download.gif?|}}+{{:manual:olimex_stm32p405_download_usb.png?|}}
  
 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. 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.
  
-===== Notes =====+===== Using BootCommander ​=====
  
-When using USB as the communication ​interface, it is not recommended ​to use the default backdoor functionality,​ which keeps the bootloader active for a short time after reset. In theory it works, however the time that the backdoor stays open should be at least long enough for the installation of the USB driver ​on the host PCThis is hard to estimate and relatively long, causing long delays between ​system reset and the actual starting ​of the user program. +The BootCommander command line interface ​(CLI) program allows you to configure all communication settings via options ​on the command lineThe following example demonstrates how to call BootCommander for making ​firmware update with one of the demo programs
- +
-It is recommended to implement a custom backdoor solution in this case. This is achieved by setting configurable BOOT_BACKDOOR_HOOKS_ENABLE to a value of 1.+
  
 <​code>​ <​code>​
-#define BOOT_BACKDOOR_HOOKS_ENABLE ​     (1)+BootCommander -s=xcp -t=xcp_usb demoprog_olimex_stm32p405.srec
 </​code>​ </​code>​
  
-You can now implement your own backdoor solution in the hook-functions **BackDoorInitHook()** and **BackDoorEntryHook()**. Refer to the demo programs for an exampleTherea solution is implemented where the bootloader ​will always stay active ​after reset if a specific digital input had a pre-defined value during reset+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 relativedirectory ​to the name of the S-record firmware file. 
 + 
 + 
 +===== Notes ===== 
 + 
 +When using USB as the communication interface, the bootloader ​stays active a bit longer than usual. This extension time can be configured via configuration macro BOOT_COM_USB_BACKDOOR_EXTENSION_MS in “blt_conf.h”. This extra time is needed for the USB device to enumerate on the PC, to the point that the bootloader can detect firmware update requests
  
 +This time might not be long enough in the situation where the USB driver was just installed on the host PC and the USB enumeration takes place for the first time. For this reason it is highly recommended to implement an additional method to force the bootloader to stay active. This latter case happens when the CpuUserProgramStartHook()-function is enabled and returns BLT_FALSE. All OpenBLT demo programs that support firmware updates via USB have such a method implemented for forcing the bootloader to stay active. Typically if a push-button stays pressed for a few seconds during and after a microcontroller reset. Refer to the CpuUserProgramStartHook()-function ​ in the bootloader demo programs for more details.
  
manual/usb_demo.1530613950.txt.gz · Last modified: 2019/09/24 22:11 (external edit)