boards/arm/samv7/samv71-xult: Add mcuboot update example configs
Add MCUboot Update Agent and Slot Confirm configurations. It uses ethernet with dhcp client to perform download of new image into internal flash memory. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
This commit is contained in:
parent
2965345e14
commit
6740ec3fee
@ -2650,3 +2650,99 @@ Configuration sub-directories
|
||||
|
||||
CONFIG_SAMV7_FORMAT_MCUBOOT=y
|
||||
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
||||
|
||||
mcuboot-agent:
|
||||
This configuration exercises the MCUboot firmware upgrade example. The
|
||||
application is NuttX nsh with some special commands.
|
||||
|
||||
Generate signed binaries for MCUboot compatible application:
|
||||
|
||||
./apps/boot/mcuboot/mcuboot/scripts/imgtool.py sign \
|
||||
--key apps/boot/mcuboot/mcuboot/root-rsa-2048.pem --align 8 \
|
||||
--version 1.0.0 --header-size 0x200 --pad-header --slot-size 0xe0000 \
|
||||
--confirm nuttx/nuttx.bin mcuboot_nuttx.update.agent.bin
|
||||
|
||||
Flash agent application at MCUboot Slot-0:
|
||||
|
||||
openocd -f interface/cmsis-dap.cfg \
|
||||
-c 'transport select swd' \
|
||||
-c 'set CHIPNAME atsamv71q21' \
|
||||
-f target/atsamv.cfg \
|
||||
-c 'reset_config srst_only' \
|
||||
-c init -c targets \
|
||||
-c 'reset halt' \
|
||||
-c 'program mcuboot_nuttx.update.agent.bin 0x420000' \
|
||||
-c 'reset halt' \
|
||||
-c 'atsamv gpnvm set 1' \
|
||||
-c 'reset run' -c shutdown
|
||||
|
||||
The board is ready to perform an upgrade. However, this example requires
|
||||
use an image to be used as new application. You can use the Confirm example,
|
||||
which will be used in the download process.
|
||||
|
||||
See mcuboot-confirm for more information.
|
||||
|
||||
Relevant configuration settings:
|
||||
|
||||
CONFIG_EXAMPLES_MCUBOOT_UPDATE_AGENT=y
|
||||
|
||||
CONFIG_SAMV7_FORMAT_MCUBOOT=y
|
||||
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
||||
|
||||
mcuboot-confirm:
|
||||
|
||||
./apps/boot/mcuboot/mcuboot/scripts/imgtool.py sign \
|
||||
--key apps/boot/mcuboot/mcuboot/root-rsa-2048.pem --align 8 \
|
||||
--version 2.0.0 --header-size 0x200 --pad-header --slot-size 0xe0000 \
|
||||
nuttx/nuttx.bin mcuboot_nuttx.slot.confirm.bin
|
||||
|
||||
The mcuboot_nuttx.app.confirm.bin would be used at http server in your
|
||||
network to be downloaded by Agent at MCUboot Slot-1.
|
||||
|
||||
Using Python to create a http server at your NuttX workspace:
|
||||
|
||||
sudo python -m http.server 8080 &
|
||||
|
||||
Test download:
|
||||
|
||||
wget <your PC IP>:8080/mcuboot_nuttx.slot.confirm.bin -O test.bin
|
||||
|
||||
Check MD5:
|
||||
|
||||
md5sum mcuboot_nuttx.slot.confirm.bin test.bin
|
||||
958b523f1049696aba73354615868b7f mcuboot_nuttx.slot.confirm.bin test.bin
|
||||
958b523f1049696aba73354615868b7f test.bin
|
||||
rm test.bin
|
||||
|
||||
The OTA config uses DHCP client to get local ip address. This way your board
|
||||
will have automatically access to your network. Let's check board.
|
||||
|
||||
ping <your PC IP>
|
||||
PING xxx.xxx.xxx.xxx 56 bytes of data
|
||||
56 bytes from xxx.xxx.xxx.xxx: icmp_seq=0 time=0 ms
|
||||
56 bytes from xxx.xxx.xxx.xxx: icmp_seq=1 time=0 ms
|
||||
...
|
||||
56 bytes from xxx.xxx.xxx.xxx: icmp_seq=9 time=0 ms
|
||||
10 packets transmitted, 10 received, 0% packet loss, time 10100 ms
|
||||
|
||||
nsh> mcuboot_agent http://xxx.xxx.xxx.xxx:8080/mcuboot_nuttx.slot.confirm.bin
|
||||
MCUboot Update Agen192.168.10.104 - - [16/Dec/2021 19:29:08]
|
||||
"GET /mcuboot_nuttx.slot.confirm.bin HTTP/1.0" 200 -t example
|
||||
Downloading from http://xxx.xxx.xxx.xxx:8080/signedv2.bin
|
||||
Firmware Update size: 194464 bytes
|
||||
Received: 512 of 194464 bytes [0%]
|
||||
Received: 1024 of 194464 bytes [0%]
|
||||
...
|
||||
Received: 194048 of 194464 bytes [99%]
|
||||
Received: 194468 of 194468 bytes [100%]
|
||||
Application Image successfully downloaded!
|
||||
Requested update for next boot. Restarting...
|
||||
*** Booting MCUboot build 7c890f4b075aed73e4c825ccf875b2fb9ebf2ded ***
|
||||
Application Image successfully confirmed!
|
||||
|
||||
Relevant configuration settings:
|
||||
|
||||
CONFIG_EXAMPLES_MCUBOOT_SLOT_CONFIRM=y
|
||||
|
||||
CONFIG_SAMV7_FORMAT_MCUBOOT=y
|
||||
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
||||
|
@ -0,0 +1,62 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_SAMV7_UART0 is not set
|
||||
# CONFIG_SAMV7_UART2 is not set
|
||||
# CONFIG_SAMV7_UART4 is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="samv71-xult"
|
||||
CONFIG_ARCH_BOARD_COMMON=y
|
||||
CONFIG_ARCH_BOARD_SAMV71_XULT=y
|
||||
CONFIG_ARCH_BUTTONS=y
|
||||
CONFIG_ARCH_CHIP="samv7"
|
||||
CONFIG_ARCH_CHIP_SAMV71=y
|
||||
CONFIG_ARCH_CHIP_SAMV71Q21=y
|
||||
CONFIG_ARCH_CHIP_SAMV71Q=y
|
||||
CONFIG_ARCH_CHIP_SAMV7=y
|
||||
CONFIG_ARCH_CHIP_SAMV7_MEM_FLASH=0x200000
|
||||
CONFIG_ARCH_CHIP_SAMV7_MEM_RAM=0x60000
|
||||
CONFIG_ARCH_INTERRUPTSTACK=2048
|
||||
CONFIG_ARCH_IRQBUTTONS=y
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARMV7M_DCACHE=y
|
||||
CONFIG_ARMV7M_ICACHE=y
|
||||
CONFIG_ARMV7M_LAZYFPU=y
|
||||
CONFIG_BOARDCTL_RESET=y
|
||||
CONFIG_BOARD_LATE_INITIALIZE=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=51262
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_EXAMPLES_MCUBOOT_SLOT_CONFIRM=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_FILEIOSIZE=512
|
||||
CONFIG_NSH_LINELEN=64
|
||||
CONFIG_NSH_READLINE=y
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
CONFIG_PTABLE_PARTITION=y
|
||||
CONFIG_RAM_SIZE=393216
|
||||
CONFIG_RAM_START=0x20400000
|
||||
CONFIG_RAW_BINARY=y
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_SAMV7_FORMAT_MCUBOOT=y
|
||||
CONFIG_SAMV7_GPIOA_IRQ=y
|
||||
CONFIG_SAMV7_GPIOB_IRQ=y
|
||||
CONFIG_SAMV7_GPIOD_IRQ=y
|
||||
CONFIG_SAMV7_GPIO_IRQ=y
|
||||
CONFIG_SAMV7_SYSTEMRESET=y
|
||||
CONFIG_SAMV7_USART1=y
|
||||
CONFIG_SAMV7_XDMAC=y
|
||||
CONFIG_SCHED_HPWORK=y
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_START_DAY=10
|
||||
CONFIG_START_MONTH=3
|
||||
CONFIG_START_YEAR=2014
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_SYSTEM_RAMTEST=y
|
||||
CONFIG_USART1_SERIAL_CONSOLE=y
|
@ -0,0 +1,118 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_MMCSD_MMCSUPPORT is not set
|
||||
# CONFIG_MMCSD_SPI is not set
|
||||
# CONFIG_SAMV7_UART0 is not set
|
||||
# CONFIG_SAMV7_UART2 is not set
|
||||
# CONFIG_SAMV7_UART4 is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="samv71-xult"
|
||||
CONFIG_ARCH_BOARD_COMMON=y
|
||||
CONFIG_ARCH_BOARD_SAMV71_XULT=y
|
||||
CONFIG_ARCH_BUTTONS=y
|
||||
CONFIG_ARCH_CHIP="samv7"
|
||||
CONFIG_ARCH_CHIP_SAMV71=y
|
||||
CONFIG_ARCH_CHIP_SAMV71Q21=y
|
||||
CONFIG_ARCH_CHIP_SAMV71Q=y
|
||||
CONFIG_ARCH_CHIP_SAMV7=y
|
||||
CONFIG_ARCH_CHIP_SAMV7_MEM_FLASH=0x200000
|
||||
CONFIG_ARCH_CHIP_SAMV7_MEM_RAM=0x60000
|
||||
CONFIG_ARCH_INTERRUPTSTACK=2048
|
||||
CONFIG_ARCH_IRQBUTTONS=y
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARMV7M_DCACHE=y
|
||||
CONFIG_ARMV7M_ICACHE=y
|
||||
CONFIG_ARMV7M_LAZYFPU=y
|
||||
CONFIG_AT24XX_ADDR=0x57
|
||||
CONFIG_AT24XX_EXTENDED=y
|
||||
CONFIG_AT24XX_EXTSIZE=160
|
||||
CONFIG_AT24XX_SIZE=2
|
||||
CONFIG_BOARDCTL_RESET=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=51262
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DEBUG_CUSTOMOPT=y
|
||||
CONFIG_ETH0_PHY_KSZ8061=y
|
||||
CONFIG_EXAMPLES_MCUBOOT_UPDATE_AGENT=y
|
||||
CONFIG_EXAMPLES_MCUBOOT_UPDATE_AGENT_DL_BUFFER_SIZE=4096
|
||||
CONFIG_FAT_LCNAMES=y
|
||||
CONFIG_FAT_LFN=y
|
||||
CONFIG_FS_FAT=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_I2CTOOL_MAXBUS=0
|
||||
CONFIG_LIBC_HOSTNAME="SAMV71-XULT"
|
||||
CONFIG_MMCSD_SDIO=y
|
||||
CONFIG_MTD_AT24XX=y
|
||||
CONFIG_MTD_AT25=y
|
||||
CONFIG_MTD_CONFIG=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_NETDB_DNSCLIENT=y
|
||||
CONFIG_NETDEV_PHY_IOCTL=y
|
||||
CONFIG_NETDEV_STATISTICS=y
|
||||
CONFIG_NETDOWN_NOTIFIER=y
|
||||
CONFIG_NETINIT_DHCPC=y
|
||||
CONFIG_NETINIT_DNS=y
|
||||
CONFIG_NETINIT_MONITOR=y
|
||||
CONFIG_NETINIT_THREAD=y
|
||||
CONFIG_NETLINK_ROUTE=y
|
||||
CONFIG_NETUTILS_DHCPC=y
|
||||
CONFIG_NETUTILS_TELNETD=y
|
||||
CONFIG_NETUTILS_TFTPC=y
|
||||
CONFIG_NETUTILS_WEBCLIENT=y
|
||||
CONFIG_NET_ARP_SEND=y
|
||||
CONFIG_NET_BROADCAST=y
|
||||
CONFIG_NET_ICMP=y
|
||||
CONFIG_NET_ICMP_SOCKET=y
|
||||
CONFIG_NET_NETLINK=y
|
||||
CONFIG_NET_ROUTE=y
|
||||
CONFIG_NET_STATISTICS=y
|
||||
CONFIG_NET_TCP=y
|
||||
CONFIG_NET_TCPBACKLOG=y
|
||||
CONFIG_NET_TCP_KEEPALIVE=y
|
||||
CONFIG_NET_TCP_WRITE_BUFFERS=y
|
||||
CONFIG_NET_UDP=y
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_FILEIOSIZE=512
|
||||
CONFIG_NSH_LINELEN=64
|
||||
CONFIG_NSH_READLINE=y
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
CONFIG_RAM_SIZE=393216
|
||||
CONFIG_RAM_START=0x20400000
|
||||
CONFIG_RAW_BINARY=y
|
||||
CONFIG_READLINE_CMD_HISTORY=y
|
||||
CONFIG_READLINE_TABCOMPLETION=y
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_SAMV7_EMAC0=y
|
||||
CONFIG_SAMV7_EMAC0_PHYSR=30
|
||||
CONFIG_SAMV7_EMAC0_PHYSR_100FD=0x6
|
||||
CONFIG_SAMV7_EMAC0_PHYSR_100HD=0x2
|
||||
CONFIG_SAMV7_EMAC0_PHYSR_10FD=0x5
|
||||
CONFIG_SAMV7_EMAC0_PHYSR_10HD=0x1
|
||||
CONFIG_SAMV7_EMAC0_PHYSR_ALTCONFIG=y
|
||||
CONFIG_SAMV7_EMAC0_PHYSR_ALTMODE=0x7
|
||||
CONFIG_SAMV7_EMAC0_RMII=y
|
||||
CONFIG_SAMV7_FORMAT_MCUBOOT=y
|
||||
CONFIG_SAMV7_GPIOA_IRQ=y
|
||||
CONFIG_SAMV7_GPIOB_IRQ=y
|
||||
CONFIG_SAMV7_GPIOD_IRQ=y
|
||||
CONFIG_SAMV7_GPIO_IRQ=y
|
||||
CONFIG_SAMV7_HSMCI0=y
|
||||
CONFIG_SAMV7_SYSTEMRESET=y
|
||||
CONFIG_SAMV7_TWIHS0=y
|
||||
CONFIG_SAMV7_USART1=y
|
||||
CONFIG_SAMV7_XDMAC=y
|
||||
CONFIG_SCHED_HPWORK=y
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SDIO_BLOCKSETUP=y
|
||||
CONFIG_START_DAY=10
|
||||
CONFIG_START_MONTH=3
|
||||
CONFIG_START_YEAR=2014
|
||||
CONFIG_SYSTEM_I2CTOOL=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_SYSTEM_PING=y
|
||||
CONFIG_USART1_SERIAL_CONSOLE=y
|
Loading…
x
Reference in New Issue
Block a user