Embedded TCP/IP stack
4.7.0
|
Tools used during this quick start:
Follow these steps to run the FNET Bootloader:
[Start]->[Programs]->[Tftpd32]->[Tftpd32]C:\TFTP-Root
): fnet\fnet_demos\build\<board_name>\shell_boot_app\bm\<compiler_name>\
C:\TFTP-Root
).fnet\fnet_demos\build\<board_name>\shell_boot\bm\<compiler_name>\
************************************************ FNET Bootloader ************************************************ FNET TCP/IP Stack for MK64FN1 Version 4.0.0 Built Oct 26 2017 at 16:32:22 by IAR Enter '?' for command list. ************************************************ [FAPP] Application parameters loaded from Flash. Startup script: tftp ************************************************ TFTP Server started. IPv4 Address : 192.168.0.22 ************************************************ BOOT>
info
shell command: BOOT> info Ethernet Interface <default>: Name : eth0 ScopeID : 1 Media State : connected IPv4 Address : 192.168.0.22 <manual> IPv4 Subnet mask : 255.255.255.0 IPv4 Gateway : 0.0.0.0 DHCP Client : off Services: TFTP Server : on BOOT>
? command to display a list of all commands available within the shell of the Bootloader: BOOT> ? > ? - Display this help message > set [<parameter> <value>] - Set parameter > get [<parameter>] - Get parameters > info [-n <if name>] - Show interface info > dhcpc [-n <if name>] [release|autoip] - Start DHCP client > tftpc [<image name>[<server ip>[<type>]]]- TFTP firmware loader >tftpcup [<image name>[<server ip>[<type>]]]- TFTP firmware uploader > tftp [release] - TFTP firmware server > mem - Show memory map > erase all|[0x<erase address> <bytes>] - Erase flash memory > save - Save parameters to the FLASH > go [0x<address>] - Start application at address > reset - Reset the board BOOT>
get
command to see the parameter values: get ip : 192.168.0.22 netmask : 255.255.255.0 gateway : 0.0.0.0 mac : 00:11:22:33:44:55 boot : stop delay : 5 script : dhcpc; erase all; tftpc; set boot go; save; go tftp : 192.168.0.200 image : fnet_firmware.srec type : srec go : 0x0 BOOT>
set
command should be used. To understand its syntax, enter the set
command without parameters: BOOT> set Valid 'set' options: ip : <default-if IPv4 address> netmask : <default-if IPv4 netmask address> gateway : <default-if IPv4 gateway address> mac : <default-if Ethernet address> boot : <stop|go|script> delay : <seconds> script : <command script> tftp : <TFTP server IP address> image : <Image-file name to load with TFTP> type : <srec|hex|bin|raw> go : 0x<entry point address> BOOT>
ip
: Default IPv4 address of the board.netmask
: Default IPv4 Network netmask.gateway
: Default IPv4 address of the gateway.mac
: Ethernet MAC address.boot
: Bootloader booting modes:stop
= the bootloader stops at the shell prompt.go
= the bootloader jumps to the entry point address defined by the go
parameter.script
= the bootloder executes a command script located in the script
parameter.delay
: After the bootup, the bootloader will wait specified number of seconds before it executes the boot-mode defined by the boot
parameter. During this time a countdown is printed, which can be interrupted by pressing any key. It is ignored for the stop
booting mode.script
: The command script is automatically executed when the boot
parameter is set to the script
value and the initial countdown is not interrupted. This script may contain any command supported by the application shell. The commands must be split by semicolon operator.go
: Default entry point address to start execution at. It is used by the bootloader in the go
booting mode as the default entry point. Also it is used as the default address for the go
shell command if no address is provided as an argument. srec
value. The S-record file format contains the entry point information.tftp
: This is the default TFTP server IP address to be used for network download if no address is provided for the tftpc
shell command.image
: This is the default file name to download if no file name is provided for the tftpc
shell command.type
: Type of the file to download by the TFTP loader:srec
= S-record file (default type). This file format contains both the address data as well as the entry point information.hex
= Intel HEX file. This file format does not contain the entry point, so go
parameter must be set additionally.bin
= CodeWarrior binary file. This file format does not contain the entry point, so go
parameter must be set additionallyraw
= Raw binary file. For this type of file, the raw
parameter (load address) must be set before the TFTP loader start.raw
: Load address for a raw-binary file used by the TFTP loader. It's used only if the type parameter is set to the raw
value.BOOT> set tftp 10.171.88.219 tftp : 10.171.88.219 BOOT>
script
parameter (use the backslash-escape symbol before each semicolon): BOOT> set script 'erase all\; tftpc\; set boot go\; save\; reset' script : erase all; tftpc; set boot go; save; reset BOOT>
boot
parameter to the script
value. BOOT> set boot script boot : script BOOT>
save
command to save all run-time parameters to a non-volatile memory (it is located in the last erase page of the on-chip flash memory). BOOT> save Application parameters saved BOOT>NOTE: The
save
command does not save the ip
parameter in case it was allocated by a DHCP IPv4 server to avoid IPv4 address conflict during the system startup.script
booting mode.dhcpc; erase all; tftpc; set boot go; save; goThis script has the following steps:
dhcpc
= starts DHCP client service on the default interface and tries to update the IPv4 parameters (ip
, gateway
and netmask
) from DHCP server. If the DHCP service will fail to retrieve the IP parameter from a DHCP server, the bootloder will continue with the old IP settings.erase
all
= erases all Flash memory blocks. To see the memory map enter the mem
command:BOOT> mem Memory type Start End ---------------------------------------- FLASH 0x00000000 0x0007FFFF BOOT>
image
parameter) from the TFTP server (the server ip address defined by the tftp
parameter), loads it to the Flash memory, checks if the written data are correct. Also, it checks a checksum and updates the go
parameter if the type is set to the srec
value. set
boot
go
= Changes the bootloder booting mode to the go
mode.save
= Saves all run-time parameters to persistent memory to be available during the next startup. save
command does not save the ip
parameter in case it was allocated by a DHCP server to avoid IP address conflict during the system startup.go
parameter is updated automatically.************************************************ FNET Bootloader ************************************************ FNET TCP/IP Stack for MK64FN1 Version 4.0.0dev Built Oct 26 2017 at 16:48:56 by IAR Enter '?' for command list. ************************************************ [FAPP] Application parameters loaded from Flash. Press any key to stop (script): 0 dhcpc; erase all; tftpc; set boot go; save; go ************************************************ DHCPv4 Client started. Interface : eth0 ************************************************ Press [Ctr+C] to cancel. [DHCP] Discovering... ************************************************ IPv4 parameters updated : ************************************************ Ethernet Interface <default>: Name : eth0 ScopeID : 1 Media State : connected IPv4 Address : 192.168.0.102 <dhcp> IPv4 Subnet mask : 255.255.255.0 IPv4 Gateway : 192.168.0.1 DHCP Client : on DHCP Server Address : 192.168.0.1 Erasing... 0x0000d000 to 0x000fefff erased Press [Ctr+C] to cancel. TFTP downloading 'fnet_firmware.srec' (srec) from 192.168.0.200 : \ Entry point set to 0x0002703d TFTP completed (307618 bytes) boot : go Application parameters saved go 0x0002703d ************************************************ FNET Shell Demo (bootloader aware) ************************************************ FNET TCP/IP Stack for MK64FN1 Version 4.0.0dev Built Oct 26 2017 at 16:17:57 by IAR Enter '?' for command list. ************************************************ [FAPP] Application parameters loaded from Flash. SHELLB> [LINK] eth0: connected => Script: dhcpc autoip -n eth0; mdns -n eth0; llmnr -n eth0; ************************************************ DHCPv4 Client started. Interface : eth0 ************************************************ Press [Ctr+C] to cancel. [DHCP] Discovering... ************************************************ IPv4 parameters updated : ************************************************ Ethernet Interface <default>: Name : eth0 ScopeID : 1 Media State : connected IPv4 Address : 192.168.0.102 <dhcp> IPv6 Address : fe80::211:22ff:fe33:4455 <autoconfigurable> IPv4 Subnet mask : 255.255.255.0 IPv4 Gateway : 192.168.0.1 IPv4 DNS : 192.168.0.1 DHCP Client : on DHCP Server Address : 192.168.0.1 AUTOIP Service : off LLMNR Server : off MDNS Server : off ************************************************ mDNS server started. Interface : eth0 Host Name : fnet ************************************************ ************************************************ LLMNR server started. Interface : eth0 Host Name : fnet ************************************************ SHELLB>
go
mode and every time on the system reset it will start the loaded application automatically.tftpcup
command is useful for the firmware backup before it gets overwritten in the Flash memory. This feature enables to restore the system in case the new firmware has issues. tftp
parameter. The image-file name on the remote TFTP server is defined by the image
parameter. Format of the created file (S-record, CodeWarrior binary or raw binary) is defined by type
parameter.fnet_user_config.h
.The TFTP server is started automatically during the bootloader start-up in normal boot
mode. It allows to update or backup the firmware from a remote TFTP client running on host PC without the serial-console command line interface. Format of the image file (S-record, CodeWarrior binary or raw binary) is defined by type
parameter.
info
command: BOOT> info Ethernet Interface <default>: Name : eth0 ScopeID : 1 Media State : connected IPv4 Address : 192.168.0.22 <manual> IPv4 Subnet mask : 255.255.255.0 IPv4 Gateway : 192.168.0.1 DHCP Client : off Services: TFTP Server : off
tftp
command to start it: BOOT> tftp ************************************************ TFTP Server started. IPv4 Address : 192.168.0.22 ************************************************
[Start]->[Programs]->[Tftpd32]->[Tftpd32]69
.image
. By default it is set to the shell_boot_intflash.elf.S19 value.Default
or 512
.image
parameter, starts the erasing of the flash memory, downloads and writes image file to the flash memory, updates the go
parameter to the new entry point, sets the boot
parameter to the go
value, saves changed parameters to the flash, and finally starts application. In the terminal window you should see: BOOT> TFTP downloading 'fnet_firmware.srec' (srec) from 192.168.0.5: Erasing... 0x00000000 to 0x0000BFFF skipped 0x0000C000 to 0x0007EFFF erased 0x0007F000 to 0x0007FFFF skipped BOOT> Entry point set to 0x00019638 TFTP completed (234244 bytes) boot : go Parameters saved go 0x00019638 ************************************************ FNET Shell Demo (bootloader aware) ************************************************ FNET TCP/IP Stack for MK64FN1 Version 4.0.0dev Built Oct 26 2017 at 16:17:57 by IAR Enter '?' for command list. ************************************************ [FAPP] Application parameters loaded from Flash. SHELLB> [LINK] eth0: connected => Script: dhcpc autoip -n eth0; mdns -n eth0; llmnr -n eth0; ************************************************ DHCPv4 Client started. Interface : eth0 ************************************************ Press [Ctr+C] to cancel. [DHCP] Discovering... ************************************************ IPv4 parameters updated : ************************************************ Ethernet Interface <default>: Name : eth0 ScopeID : 1 Media State : connected IPv4 Address : 192.168.0.102 <dhcp> IPv6 Address : fe80::211:22ff:fe33:4455 <autoconfigurable> IPv4 Subnet mask : 255.255.255.0 IPv4 Gateway : 192.168.0.1 IPv4 DNS : 192.168.0.1 DHCP Client : on DHCP Server Address : 192.168.0.1 AUTOIP Service : off LLMNR Server : off MDNS Server : off ************************************************ mDNS server started. Interface : eth0 Host Name : fnet ************************************************ ************************************************ LLMNR server started. Interface : eth0 Host Name : fnet ************************************************ SHELLB>
BOOT> info Ethernet Interface <default>: Name : eth0 ScopeID : 1 Media State : connected IPv4 Address : 192.168.0.22 <manual> IPv4 Subnet mask : 255.255.255.0 IPv4 Gateway : 192.168.0.1 DHCP Client : off Services: TFTP Server : on BOOT>
69
.image
. By default it is set to the shell_boot_intflash.elf.S19 value.Default
or 512
.image
parameter, generates image file and uploads it to the remote TFTP client. In the terminal window you should see: BOOT> TFTP uploading 'fnet_firmware.srec' (srec) to 10.198.0.5: TFTP completed (1211274 bytes)