This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM437X: UBI attach error

Part Number: PROCESSOR-SDK-AM437X

Hello,

We are facing critical issue after changing memory layout of our board.

Initial memory layout was

SPL

SPL1

SPL2

Uboot

Uboot Env

Kernel

FileSystem

New Memory Layout details :

SPL

SPL1

SPL2

Uboot.Env

Uboot.Active

Uboot.Backup

Uboot.backup

          Kernel.Active

Kernel.Backup.

         File System.Active

         File System.Backup

During development :

Whenever we want to flash new image in FileSystem.Active partition after erasing that partition only we are getting this error:

2.393675] omap_i2c 44e0b000.i2c: bus 0 rev0.12 at 100 kHz
[ 2.401238] omap_i2c 4802a000.i2c: bus 1 rev0.12 at 100 kHz
[ 2.408572] ubi0: attaching mtd10
[ 2.420499] ubi0 error: ubi_attach: bad image sequence number 594926531 in PEB 14, expected 2113451616
[ 2.429952] Erase counter header dump:
[ 2.433721] magic 0x55424923
[ 2.437539] version 1
[ 2.440522] ec 0
[ 2.443500] vid_hdr_offset 4096
[ 2.446753] data_offset 8192
[ 2.450018] image_seq 594926531
[ 2.453697] hdr_crc 0xe83a6af0
[ 2.457507] erase counter header hexdump:
[ 2.461597] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd10, error -22
[ 2.468830] UBI error: cannot attach mtd10
[ 2.473345] hctosys: unable to open rtc device (rtc0)
[ 2.479255] evm_v3_3d: disabling
[ 2.482518] ALSA device list:

This error is not observed if we erase complete flash and then re-write all images in corresponding section.

Problem : We need to upgrade active partition for that we are using swupdate which does following:

erase only that section where we need to flash upgraded artifact

write new/updated artifact on partition.

ll Appreciate if anybody can help to comment on the same.

 

  • Hi Shivam,

    sounds like the issue might be with swupdate itself, not handling the change of layout correctly? I had a brief look at the swupdate code, some quick ideas here...

    1. Can you try dropping the ".active" extension from your new layout names, so that the names of the sections persists? swupdate seems to have some dependencies on that when it comes to re-size / migrate partitions. I'm not an expert in this tool but it sounds like something good to double-check.
    2. Can you try using the latest (upstream) version of swupdate, if not already, from here: https://github.com/sbabic/swupdate  It's always possible that this could carry some fixes/changes that might help in your case

    If none of that helps we have to think about how to further debug this.

    Regards, Andreas