AB-partiton.zip
(4.75 KB)
以boot from SD为例
1、新建一个header-sdcard_b.json文件,里面内容参考header-sdcard.json,然后修改版本号和bl2.dtb、bl2.bin的offset:
{
"header":
{
"version": "0x20230823",
"spiinfo":
{
"pagesize": "2048",
"sparearea": "64",
"pageperblk": "64",
"quadread": "0x6B",
"readsts": "0x05",
"writests": "0x01",
"stsvalue": "0x02",
"dummy1": "0",
"dummy2": "1",
"suspintvl": "1"
},
"secureboot": "no",
"entrypoint": "0x28000000",
"aeskey" : "5E76953BF598581F925B7995157844747FABE669ABF000345E0EE21B63624D59",
"ecdsakey": "5E76953BF598581F925B7995157844747FABE669ABF000345E0EE21B63624D59",
"image":
[
{
"offset": "0x28000",
"loadaddr": "0x28023000",
"type": "3",
"file": "bl2_b.dtb"
},
{
"offset": "0x50000",
"loadaddr": "0x28000000",
"type": "4",
"file": "bl2_b.bin"
}
]
}
}
2、用nuweriter工具将header-sdcard_b.json转换成header.bin,然后重命名为header_b.bin,把这个bin放到output/images目录
3、修改pack-sdcard.json(目录:board/nuvoton/ma35d1/nuwriter/pack-sdcard.json)添加b 分区的image:
对于SD卡,hearder_b.bin需要放在sector3.
{
"offset": "0x600",
"file": "header_b.bin",
"type": 0
},
{
"offset": "0x28000",
"file": "bl2_b.dtb",
"type": 0
},
{
"offset": "0x50000",
"file": "bl2_b.bin",
"type": 0
},
4、修改post-image.sh(目录:board/nuvoton/ma35d1/post-image.sh)
在IMAGE_CMD_sdcard里面添加b分区的image:
#0x600
dd if=${BINARIES_DIR}/header_b.bin of=${SDCARD} conv=notrunc seek=3 bs=512 &>${NULLDEV}
# 0x28000
dd if=${BINARIES_DIR}/bl2_b.dtb of=${SDCARD} conv=notrunc seek=320 bs=512 &>${NULLDEV}
# 0x50000
dd if=${BINARIES_DIR}/bl2_b.bin of=${SDCARD} conv=notrunc seek=640 bs=512 &>${NULLDEV}
5、编译
|