Updating raw NAND PEB

36 views
Skip to first unread message

Sheikh Bakir

unread,
Jul 31, 2024, 4:48:57 PM7/31/24
to swupdate
Hi All,

I need to update a raw NAND partition. The raw nand partition fits into single PEB, due to bad block management I reserved extra PEB for this specific partition. Now I need to identify and check if a particular PEB is good/bad before installing image in run time.

I am new to swupdate and after reading the documentation, I am thinking to do this way.
  • Write embedded-script lua script to find the offset of first good PEB from the reserved 4 PEB.
  • Add offset attribute to the image table
Example:
images =
    (
        {
            filename = "<image_name>";
            device = "/dev/block/platform/<partition_name>";
            type = "raw";
            installed-directly = True
            hook = "set_offset"
        },
        ..
        ..
        ..
    )
function 
set_offset(image)
    //set offset="query the good PEB offset from the device"
end


Does this sound right or I am missing something from the doc to handle this in better way. 
Thanks you! and appropriate for any help. 

Stefano Babic

unread,
Aug 1, 2024, 2:22:45 AM8/1/24
to Sheikh Bakir, swupdate
Hi Sheikh,

On 31.07.24 22:38, Sheikh Bakir wrote:
> Hi All,
>
> I need to update a raw NAND partition. The raw nand partition fits into
> single PEB, due to bad block management I reserved extra PEB for this
> specific partition. Now I need to identify and check if a particular PEB
> is good/bad before installing image in run time.
>
> I am new to swupdate and after reading the documentation, I am thinking
> to do this way.
>
> * Write embedded-script lua script to find the offset of first good
> PEB from the reserved 4 PEB.
> * Add *offset* attribute to the image table
>
> Example:
> /images =
>     (
>         {
>             filename = "<image_name>";
>             device = "/dev/block/platform/<partition_name>";
>             type = "raw";

Wrong.

>             installed-directly = True
>             hook = "set_offset"
>         },
>         ..
>         ..
>         ..
>     )
> function //set_offset//(image)
>     //set offset="query the good PEB offset from the device"
> end/
> /
> /
> Does this sound right

No.

SWUpdate is able to manage bad blocks. You just need to pass the MTD
device where the artifact should be installed. There is a specific
handler "flash" to be used, and this will skip bad blocks. No need to
work with offsets.

Best regards,
Stefano Babic

Sheikh Bakir

unread,
Aug 1, 2024, 12:20:09 PM8/1/24
to swupdate
Thank you very much Stefano, this is exactly what I was looking for. I appreciate your quick response. 

Best regards,
- Sheikh 

Sheikh Bakir

unread,
Aug 1, 2024, 3:41:40 PM8/1/24
to swupdate
Hi Stefano,

Actually I need the offset value to generate some headers and set some Boot ROM register - so seems like using only flash handler won't work for this. In that case can I explicitly set the offset  using embedded-lua script with type=flash? Thanks 

BR,
- Sheikh 

Reply all
Reply to author
Forward
0 new messages