User Tools

Site Tools


manual:net_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:net_demo [2018/07/27 23:19]
voorburg [Notes]
manual:net_demo [2019/09/24 22:03] (current)
Line 15: Line 15:
   * 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 TCP/​IP**"​ from the "​Interface selection"​ dropdown box.   * Click the "​**Settings**"​-button and select "**XCP on TCP/​IP**"​ from the "​Interface selection"​ dropdown box.
-  * Set the IP address (or fully qualified domain name) of your microcontroller system on the network. ​Note that the IP address is also specified by the macro'​s ​BOOT_COM_NET_IPADDR ​in "​blt_conf.h"​.  +  * Set the IP address (or fully qualified domain name) of your microcontroller system on the network. ​ 
-    * Set the port on which the bootloader listens for firmware update connection requests. This is specified by the macro BOOT_COM_NET_PORT in "​blt_conf.h"​. Typically, this is **1000** for the demo programs.+    * Most TCP/IP demo programs have DHCP support enabled (BOOT_COM_NET_DHCP_ENABLE set to 1) for automatic assignment of an IP address by your router. Log into your router'​s admin panel to determine which IP address was assigned. In case DHCP support is disabled, ​the IP address is specified by the macro'​s ​BOOT_COM_NET_IPADDRx ​in "​blt_conf.h"​. 
 +  * Set the port on which the bootloader listens for firmware update connection requests. This is specified by the macro BOOT_COM_NET_PORT in "​blt_conf.h"​. Typically, this is **1000** for the demo programs.
  
 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!
Line 36: Line 37:
 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. 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.
  
 +===== Timeout configuration =====
 +
 +The default timeouts of the XCP communication protocol work fine in case the ping time between your PC host and microcontroller is not more than 30 milliseconds. This is for example the case when your microcontroller is connected to a local network.
 +
 +When the ping time between your PC host (or remote server) and microcontroller is more than 30 milliseconds,​ a reconfiguration of the XCP timeouts (T1, T3, T4, T5, T6 and T7) is needed. It is recommended to add 1.5 times the average ping time to the default values of the XCP timeouts.
 +
 +For example, when testing firmware updates from a Debian server in Tokyo (running BootCommander) to a microcontroller connected to a router in Germany, the ping time was about 250 ms. The XCP timeouts were incremented by 375 ms to compensate for this network latency:
 +
 +^ Timeout ^ Default value [ms] ^ Reconfigured value [ms] ^
 +| T1 | 1000 | 1375 |
 +| T3 | 2000 | 2375 |
 +| T4 | 10000 | 10375 |
 +| T5 | 1000 | 1375 |
 +| T6 | 50 | 425 |
 +| T7 | 2000 | 2375 |
 +
 +These timeouts can be configured on MicroBoot’s settings dialog or using command-line options in BootCommander:​
 +
 +{{:​manual:​xcp_timeout_configuration.png |}}
  
 ===== Notes ===== ===== Notes =====
Line 41: Line 61:
 The initialization of the TCP/IP network stack, up to the point where the bootloader can accept firmware update requests, can take several seconds. This delay occurs after each reset event, before your user program is started. Because such a long delay is typically not desired, the demo programs have the so called deferred initialization functionality enabled. This was done via configuration macro BOOT_COM_NET_DEFERRED_INIT_ENABLE in “blt_conf.h”. The initialization of the TCP/IP network stack, up to the point where the bootloader can accept firmware update requests, can take several seconds. This delay occurs after each reset event, before your user program is started. Because such a long delay is typically not desired, the demo programs have the so called deferred initialization functionality enabled. This was done via configuration macro BOOT_COM_NET_DEFERRED_INIT_ENABLE in “blt_conf.h”.
  
-With the deferred initialization enabled, the TCP/IP stack initialization is skipped during a normal reset event, unless: ​(athere is no valid user program present, or (bthe bootloader was forced to stay active. This latter case happens when the CpuUserProgramStartHook()-function is enabled and returns BLT_FALSE.+With the deferred initialization enabled, the TCP/IP stack initialization is skipped during a normal reset event, unless: ​[athere is no valid user program present, or [bthe bootloader was forced to stay active. This latter case happens when the CpuUserProgramStartHook()-function is enabled and returns BLT_FALSE.
  
-To be able to perform remote firmware updates without having to access the system, a third scenario was added in the demo programs for forcing the TCP/IP stack to be initialized. This is the case when the bootloader was started from the user program. The [[https://​www.feaser.com/​en/​blog/?​p=216|shared parameter module]] was integrated into both the demo bootloader and user program, to be able to pass information from the user program to the bootloader. After the user program detects a firmware update request from the TCP/IP network, it sets a shared parameter in RAM right before the bootloader is activated. Upon activation, the bootloader evaluates this shared parameter and initializes the TCP/IP stack when requested.+To be able to perform remote firmware updates without having to access the system, a third scenario ​[c] was added in the demo programs for forcing the TCP/IP stack to be initialized. This is the case when the bootloader was started from the user program. The [[https://​www.feaser.com/​en/​blog/?​p=216|shared parameter module]] was integrated into both the demo bootloader and user program, to be able to pass information from the user program to the bootloader. After the user program detects a firmware update request from the TCP/IP network, it sets a shared parameter in RAM right before the bootloader is activated. Upon activation, the bootloader evaluates this shared parameter and initializes the TCP/IP stack when requested.
  
  
manual/net_demo.1532726342.txt.gz · Last modified: 2019/09/24 22:11 (external edit)