User Tools

Site Tools


manual:can_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:can_demo [2016/12/17 11:52]
voorburg [Notes]
manual:can_demo [2022/08/09 15:55] (current)
voorburg [Lawicel]
Line 1: Line 1:
 ====== Firmware updates using the CAN communication interface ====== ====== Firmware updates using the CAN communication interface ======
- 
- 
  
 ===== Bootloader configuration ===== ===== Bootloader configuration =====
Line 8: Line 6:
  
 <​code>​ <​code>​
- 
 #define BOOT_COM_CAN_ENABLE ​           (1) #define BOOT_COM_CAN_ENABLE ​           (1)
- 
 </​code>​ </​code>​
  
 +===== Using MicroBoot =====
  
 +The MicroBoot utility needs to be configured to connect to the correct CAN interface on the PC:
  
-===== Preparing Microboot =====+  * Start MicroBoot by double-clicking "​\Host\**MicroBoot.exe**"​ (on Linux it is "​\Host\**MicroBoot**"​). 
 +  * Click the "​**Settings**"​-button and select "**XCP on CAN**" from the "​Interface selection"​ dropdown box 
 +  * Select the CAN communication device that your PC uses to connect to the CAN bus. 
 +  * Select the channel you intend to use on the CAN communication device, if applicable. 
 +  * Set the baudrate to the value specified by macro BOOT_COM_CAN_BAUDRATE in "​blt_conf.h"​. Typically, this is **500** kbits/sec for the demo programs. 
 +  * Set the Transmit ID as a hexadecimal value. This is the value specified by macro BOOT_COM_CAN_RX_MSG_ID in "​blt_conf.h"​. 
 +  * Set the Receive ID as a hexadecimal value. This is the value specified by macro BOOT_COM_CAN_TX_MSG_ID in "​blt_conf.h"​. 
 +  * If the Transmit/​Receive ID's are 29-bit instead of the default 11-bit, make sure to check the "​29-bit extended CAN identifiers"​-checkbox.
  
-The Microboot utility needs to be configured to connect to the correct CAN interface on the PC:+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. ​
  
 +{{:​manual:​olimex_stm32p405_download_can.png?​|}}
  
-  * Start Microboot ​by double-clicking "​\Host\**MicroBoot.exe**".+Once the download completed, the newly programmed software will be started ​by the bootloaderFor the demo program'​s you can verify this by checking that the LED blinks. Congratulations! That's all there is to using the bootloader.
  
-  * Click the "​**Settings**"​-button and select "​**OpenBLT using Lawicel CANUSB**"​ or "​**OpenBLT using Peak CAN interface**"​ from the dropdown box, depending on the manufacturer of the CAN interface you intend to use on your PC.+===== Using BootCommander =====
  
-  * Click the "**Options**"​-button ​to configure ​the communication ​parameters.+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 CAN communication ​device that your PC uses to connect to the CAN bus
  
-    * Select ​the type of CAN hardware ​that is being used.+On Windows, ​the name of the CAN device depends on those that are supported by BootCommander and [[manual:​libopenblt|LibOpenBLT]]. Refer to the [[manual:​bootcommander#​program_usage|BootCommander user manual]] for a list of supported CAN devices. On Linux, specify the SocketCAN device on your system, for example **can0** or **slcan0**. You can use the "ip addr" command to find out the name of the SocketCAN devices on your system. It is assumed that the SocketCAN device is already configured and online (this also means that the "​-b"​ baudrate command line option ​is don't care when using Linux).
  
-    * Select the channel with which the CAN hardware is connected to the CAN network.+<​code>​ 
 +BootCommander -s=xcp -t=xcp_can -d=peak_pcanusb -b=500000 -c=0 -tid=667 -rid=7e1 -xid=0 demoprog_olimex_stm32p405.srec 
 +</​code>​
  
-    * Set the communication speed to the value specified by macro BOOT_COM_CAN_BAUDRATE ​in "​blt_conf.h". Typicallythis is **500** kbits/sec for the demo programs.+The example assumes that the S-record of the demo user program is located ​in the same directory as where the BootCommander executable itself residesIf notthen simply prepend ​the absolute (or relative) directory to the name of the S-record firmware file.
  
-    * Set the Transmit ID as a hexadecimal value. This is the value specified by macro BOOT_COM_CAN_RX_MSG_ID in "​blt_conf.h"​. 
  
-    * Set the Receive ID as a hexadecimal value. This is the value specified by macro BOOT_COM_CAN_TX_MSG_ID in "​blt_conf.h"​.+===== Notes =====
  
-    * If the Transmit/​Receive ID's are 29-bit instead ​of the default 11-bitmake sure to check off the "Use Extended ID'​s"​-checkbox.+Depending on the configuration ​of the bootloaderthere 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.
  
 +==== Lawicel ====
  
 +Starting with OpenBLT version 1.14, the included Windows binaries (MicroBoot, BootCommander and LibOpenBLT) are 64-bit. For this reason you should download and install the [[http://​www.can232.com/​download/​canusb_setup_win64_v_2_2.zip|64-bit driver for the CANUSB DLL API]]. ​
  
-Once you saved the settings by clicking ​the "**OK**"​-button twiceMicroboot is now ready for action!+Note though that the installer has a problem: it might not properly install ​the actuall ​**canusbdrv64.dll** file. To fix this problemyou can [[http://​www.canusb.com/​download/​canusbdrv64.zip|download this DLL]] separately and manually copy it to the **C:​\Program Files\LAWICEL\CANUSB\libs** directory.
  
 +When using an OpenBLT version from before 1.14, the included Windows binaries are still 32-bit. In this case, you should download and install the [[http://​www.can232.com/​download/​canusb_setup_win32_v_2_2.zip|32-bit driver for the CANUSB DLL API]].
  
 +==== Peak Systems ====
  
-===== Downloading the user program ===== +When using the Peak Systems PCAN-USB interface, the [[https://www.peak-system.com/PCAN-Basic.239.0.html?​L=1|PCAN-Basic API]] should be installed. Refer to the included Readme.txt of the PCAN-Basic API for instructions on how to install the PCANBasic.dll onto your Windows system.
- +
-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_stm32e407_can_download.gif?​|}} +
- +
- +
- +
-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 ===== +
- +
-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. +
- +
-When using the Lawical CANUSB ​interface, the [[http://www.can232.com/download/​canusb_setup_win32_v_2_2.zip|32-bit driver for the CANUSB DLL API]] should be installed. ​+
manual/can_demo.1481971965.txt.gz · Last modified: 2019/09/24 22:11 (external edit)