Skip to main content

ab分区切换

一 烧录配置

1

分区划分:

uboot:spl引导文件, 目录位于/freertos/xburst2/soc-ad100/spl

nor选择 ad100-spl-sfc-nor-ota-1200M-600M-uart2.bin

nand选择 ad100-spl-sfc-nand-ota-1200M-600M-uart2.bin

rtos 及rtos_ota分区名不可修改, 烧录两份不同的镜像zero.bin

ota分区名不可修改, 通过ota分区内容判断从rtos 分区启动还是rtos_ota, 默认从rtos分区启动, 烧录内容可为空

2

3

二 分区切换

默认从rtos分区启动

U-Boot SPL 2013.07-00040-g8888ecfa7-dirty (May 29 2024 - 20:30:56)
ERROR EPC 8001d3e4
CPA_CPAPCR:0320490d
CPM_CPMPCR:0320490d
CPM_CPEPCR:0190510d
CPM_CPCCR:9a073310
DDR clk rate 600000000
DDR: M14F5121632A type is : DDR2
DDR_PAR of eFuse: 00000000 00000000
AD100 InnoPhy skew Settings...
GD25Q256DYIG 00c84019 00c84019
[0.000091] gpio: VDDIO_SD(PD00~PD05) = 3.3V
[0.000507] sfc_nor: find chip:GD25Q256DYIG id:0xc84019
[0.000733] mount file system (rootfs) failed
[0.000938] rtos //rtos分区烧录的zero.bin加的打印

需要从rtos_ota启动的话,要往ota分区写入信息ota:rtos_ota

nor_write 0x240000 0x6f 0x74 0x61 0x3a 0x72 0x74 0x6f 0x73  0x5f 0x6f 0x74 0x61

0x240000 #ota分区offset

6f 74 61 3a 72 74 6f 73 5f 6f 74 61 0a |ota:rtos_ota.|
U-Boot SPL 2013.07-00040-g8888ecfa7-dirty (May 29 2024 - 20:30:56)
ERROR EPC 8001d3e4
CPA_CPAPCR:0320490d
CPM_CPMPCR:0320490d
CPM_CPEPCR:0190510d
CPM_CPCCR:9a073310
DDR clk rate 600000000
DDR: M14F5121632A type is : DDR2
DDR_PAR of eFuse: 00000000 00000000
AD100 InnoPhy skew Settings...
GD25Q256DYIG 00c84019 00c84019
[0.000093] gpio: VDDIO_SD(PD00~PD05) = 3.3V
[0.000510] sfc_nor: find chip:GD25Q256DYIG id:0xc84019
[0.000735] mount file system (rootfs) failed
[0.000939] rtos_ota //rtos_ota分区烧录的zero1.bin加的打印

三 双分区bin文件对应配置

文件位于linux工程bootloader/uboot-x2000/include/configs/ad100_base_common.h

#ifdef CONFIG_BOOT_RTOS_OTA
#define CONFIG_SPL_RTOS_OTA_NAME "rtos_ota" //rtos_ota分区
#ifndef CONFIG_SPL_OTA_NAME
#define CONFIG_SPL_OTA_NAME "ota" //ota分区
#endif

#ifndef CONFIG_SPL_RTOS_OTA_INFO
#define CONFIG_SPL_RTOS_OTA_INFO "ota:rtos_ota" //进入rtos_ota分区的条件
#endif

#ifdef CONFIG_SPL_RTOS_BOOT
#ifndef CONFIG_SPL_RTOS_NAME
#define CONFIG_SPL_RTOS_NAME "rtos" //rtos分区
#endif
#endif /* CONFIG_SPL_RTOS_BOOT */

nand 配置 ad100_base_rtos_sfc_nand_ota

nor 配置 ad100_base_rtos_sfc_nor_ota

编译, 以nor为例

bhu@bhu-PC:~/ad100/bootloader/uboot-x2000$ make distclean
bhu@bhu-PC:~/ad100/bootloader/uboot-x2000$ make ad100_base_rtos_sfc_nor_ota

生成文件

bhu@bhu-PC:~/ad100/bootloader/uboot-x2000/spl$ ls -l u-boot-spl.bin
-rwxr-xr-x 1 bhu bhu 17612 531 17:52 u-boot-spl.bin //uboot分区烧录的文件