Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8041

SDK • Debugging A/B Partition booting

$
0
0
How to debug A/B booting ?

I have an RP2350 with four partitions, A/B plus two others -

Code:

00000000 - 000FFFFF     1 MB "A"00100000 - 001EFFFF   960 KB "B"001F0000 - 001FFFFF    64 KB "C"00200000 - 003FFFFF     2 MB "D"
I have two apps, 'tick' and 'tock', both have the above partition table in their image and version numbers which indicate the build date and time, the higher value is latest.

I have used 'picotool load tick.uf2' and 'picotool load tock.uf2' and that appears to have worked according to 'picotool info -a'. Each load switches between A/B. After some playing about I have this -

Code:

Partition 0  tock  version 33085.5027Partition 1  tick  version 33085.5596Partition 2  NonePartition 3  None
My 'tick' has a higher version number than 'tock' so that should be the one which gets run on a reboot.

Code:

pi@Pi4B:~/mypico/partitions $ picotool info -aPartition 0 Program Information  name:                   tock  features:               USB stdin / stdout  binary start:           0x10000000  binary end:             0x100054a0  target chip:            RP2350  image type:             ARM Secure  version:                33085.5027 Fixed Pin Information  none Build Information  sdk version:            2.1.1  pico_board:             pico2  boot2_name:             boot2_w25q080  build date:             Apr 30 2025  build attributes:       Release Metadata Block 1  address:                0x10000138  next block address:     0x1000548c  block type:             image def  target chip:            RP2350  image type:             ARM Secure Metadata Block 2  address:                0x1000548c  next block address:     0x100054a0  block type:             ignored Metadata Block 3  address:                0x100054a0  next block address:     0x10005600  block type:             partition table  partition table:        non-singleton  un-partitioned space:   S(rw) NSBOOT(rw) NS(rw), uf2 { absolute }  partition 0 (A):        00000000->00100000 S(rw) NSBOOT(rw) NS(rw),                          id=0000000000000000, "A", uf2 { rp2350-arm-s },                          arm_boot 1, riscv_boot 1  partition 1 (B w/ 0):   00100000->001f0000 S(rw) NSBOOT(rw) NS(rw),                          id=0000000000000001, "B", uf2 { rp2350-arm-s },                          arm_boot 1, riscv_boot 1  partition 2 (A):        001f0000->00200000 S(rw) NSBOOT(rw) NS(rw),                          id=0000000000000002, "C", uf2 { rp2350-arm-s },                          arm_boot 1, riscv_boot 1  partition 3 (A ob/ 0):  00200000->00400000 S(rw) NSBOOT(rw) NS(rw),                          id=0000000000000003, "D", uf2 { data }, arm_boot 0,                          riscv_boot 0  version:                1.0 Metadata Block 4  address:                0x10005600  next block address:     0x10000138  block type:             image def  target chip:            RP2350  image type:             ARM Secure  version:                33085.5027  load map entry 0:       Load 0x10000000->0x10005600Partition 1 Program Information  name:                   tick  features:               USB stdin / stdout  binary start:           0x10000000  binary end:             0x100054a0  target chip:            RP2350  image type:             ARM Secure  version:                33085.5596 Fixed Pin Information  none Build Information  sdk version:            2.1.1  pico_board:             pico2  boot2_name:             boot2_w25q080  build date:             Apr 30 2025  build attributes:       Release Metadata Block 1  address:                0x10000138  next block address:     0x1000548c  block type:             image def  target chip:            RP2350  image type:             ARM Secure Metadata Block 2  address:                0x1000548c  next block address:     0x100054a0  block type:             ignored Metadata Block 3  address:                0x100054a0  next block address:     0x10005600  block type:             partition table  partition table:        non-singleton  un-partitioned space:   S(rw) NSBOOT(rw) NS(rw), uf2 { absolute }  partition 0 (A):        00000000->00100000 S(rw) NSBOOT(rw) NS(rw),                          id=0000000000000000, "A", uf2 { rp2350-arm-s },                          arm_boot 1, riscv_boot 1  partition 1 (B w/ 0):   00100000->001f0000 S(rw) NSBOOT(rw) NS(rw),                          id=0000000000000001, "B", uf2 { rp2350-arm-s },                          arm_boot 1, riscv_boot 1  partition 2 (A):        001f0000->00200000 S(rw) NSBOOT(rw) NS(rw),                          id=0000000000000002, "C", uf2 { rp2350-arm-s },                          arm_boot 1, riscv_boot 1  partition 3 (A ob/ 0):  00200000->00400000 S(rw) NSBOOT(rw) NS(rw),                          id=0000000000000003, "D", uf2 { data }, arm_boot 0,                          riscv_boot 0  version:                1.0 Metadata Block 4  address:                0x10005600  next block address:     0x10000138  block type:             image def  target chip:            RP2350  image type:             ARM Secure  version:                33085.5596  load map entry 0:       Load 0x10000000->0x10005600Partition 2 Program Information  none Fixed Pin Information  none Build Information  none Metadata Blocks  nonePartition 3 Program Information  none Fixed Pin Information  none Build Information  none Metadata Blocks  noneDevice Information type:                   RP2350 revision:               A2 package:                QFN80 chipid:                 0xc35dd24f15829a95 flash devinfo:          0x0c00 current cpu:            ARM available cpus:         ARM, RISC-V default cpu:            ARM secure boot:            0 debug enable:           1 secure debug enable:    1 boot_random:            7fc94bfe:92b82f96:9aeaa653:dce6ff2d boot type:              bootsel last booted partition:  slot 0 diagnostic source:      slot 0 last boot diagnostics:  0x0001535d reboot param 0:         0x00000000 reboot param 1:         0xffffffff rom gitrev:             0x312e22fa flash size:             16384K

Code:

{  "version"                       : [1, 0],  "unpartitioned":{    "families"                    : ["absolute"],    "permissions":{      "secure"                    : "rw",      "nonsecure"                 : "rw",      "bootloader"                : "rw"    }  },  "partitions": [    {      "name"                      : "A",      "id"                        : 0,      "start"                     : 0,      "size"                      : "1024K",      "families"                  : ["rp2350-arm-s"],      "permissions":{        "secure"                  : "rw",        "nonsecure"               : "rw",        "bootloader"              : "rw"      }    },    {      "name"                      : "B",      "id"                        : 1,      "size"                      : "960K",      "families"                  : ["rp2350-arm-s"],      "permissions":{        "secure"                  : "rw",        "nonsecure"               : "rw",        "bootloader"              : "rw"      },      "link"                      : ["a", 0]    },    {      "name"                      : "C",      "id"                        : 2,      "size"                      : "64K",      "families"                  : ["rp2350-arm-s"],      "permissions":{        "secure"                  : "rw",        "nonsecure"               : "rw",        "bootloader"              : "rw"      }    },    {      "name"                      : "D",      "id"                        : 3,      "size"                      : "2048K",      "families"                  : ["data"],      "permissions":{        "secure"                  : "rw",        "nonsecure"               : "rw",        "bootloader"              : "rw"      },      "link"                      : ["owner", 0],      "ignored_during_arm_boot"   : true,      "ignored_during_riscv_boot" : true    }  ]}
But, no matter what I do, no matter how many times I reboot or power-cycle, 'minicom' shows it always running 'tock'.

How do I figure out what's not right, what I haven't understood, why it's not working ?

Statistics: Posted by hippy — Wed Apr 30, 2025 4:54 pm



Viewing all articles
Browse latest Browse all 8041

Trending Articles