swupdate-scripts : imx8mm modified partition

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

swupdate-scripts : imx8mm modified partition

1,112 Views
DennisTseng
Contributor II

Hi team,

I'm following  swupdate-scripts in AN13872 Enabling SWUpdate on i.MX 6ULL and https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/SWUpdate-OTA-i-MX8MM-EVK-i-MX8QXP-MEK/ta...

It mentioned the ramdisk of partition table need to fill into 42M:100M

But after Yocto build, my swupdate-image-imx8mm-XXXX.rootfs.cpio.gz.u-boot include some package and tools and the size up to 120M, so I shift the table in cfg_imx8mm_base.cfg.

And then the device cannot work.

Here is my question : 

  1. Can I shift the table ?

  2. Is the boot start address is a hardcore address (100M) ?
    I can not find the configuration or wks.in file descript it.

  3.  Slot A and slot B can flexibly define larger sizes to prevent upgrades to new files from exceeding space ?

 

DennisTseng_0-1744095712695.png

Labels (1)
0 Kudos
Reply
7 Replies

1,080 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hello,

Please share your modifcation

Best Regards,
Zhiming

0 Kudos
Reply

1,062 Views
DennisTseng
Contributor II
#!/usr/bin/bash

# Name of the SoC.
# This name will be used to source this board specific cfg file.
SOC_NAME=imx8mm

#############################################
# Used to generate base image.
#############################################
# Partition table format, MBR or GPT.
IMAGE_PT_TBL_FMT="MBR"

# Path of MBR file. If -m is specified in command option, this file will be regenerated.
IMAGE_PT_TBL_PATH="${WRK_DIR}/common/swu_dualslot_7.5G.pt"
# Information of MBR file. Format is [FILENAME:<OFFSET_START>:<OFFSET_END>]
IMAGE_PT_TBL="${IMAGE_PT_TBL_PATH}:0:7500M"
# MBR header length. For MBR, this is always 512.
IMAGE_PT_TBL_LENGTH=512
# MBR partition information. When the MBR need to be regenerated, this struct will be used to generate a new MBR.
# Format: [PARTITION_NAME:<OFFSET_START>:<OFFSET_END>:<Filesystem Type>]
# Numbers and fs type in this struct will be passed to command directly.
# sudo parted <PARTITION_NAME> unit MiB mkpart primary <Filesystem Type> <OFFSET_START> <OFFSET_END>
IMAGE_PT_TABLE_STRUCT="
1:SLOTA_BOOT_PT:100:220:fat32
2:SLOTA_ROOTFS:220:3220:ext4
3:SLOTB_BOOT_PT:3220:3340:fat32
4:SLOTB_ROOTFS:3340:6340:ext4
"

# Header of a image.
# Contains MBR, bootloader and padding.
# Format: [FILEPATH:<OFFSET_START>:<OFFSET_END>]
IMAGES_HEADER="
${IMAGE_PT_TBL_PATH}:0:33K
${WRK_DIR}/slota/imx-boot-imx8mmevk-sd.bin-flash_evk:33K:8M
"

# SWUpdate image.
# Contains zImage, dtb and ramfs for SWUpdate.
# Format: [FILEPATH:<OFFSET_START>:<OFFSET_END>]
IMAGES_SWUPDATE="
${WRK_DIR}/slota/Image:8M:38M
${WRK_DIR}/slota/imx8mm-ddr4-evk-revb.dtb:38M:42M
${WRK_DIR}/slota/swupdate-image-imx8mmevk.cpio.gz.u-boot:42M:250M
"

# SlotA boot partion files list, which will be copied into slotb boot partition.
SLOTA_BOOT_PT_FILES="
${WRK_DIR}/slota/imx8mm-ddr4-evk-revb.dtb
${WRK_DIR}/slota/Image
"
# SLOTA images
# Contains boot partition and rootfs.
# Format: [FILEPATH:<OFFSET_START>:<OFFSET_END>]
SLOTA_BOOT_PT="${WRK_DIR}/common/slota_boot_pt_120M.mirror:250M:370M"
SLOTA_ROOTFS="${WRK_DIR}/slota/imx-image-multimedia-imx8mmevk.ext4:370M:3370M"
SLOTA_IMAGES="
${SLOTA_BOOT_PT}
${SLOTA_ROOTFS}
"

# SlotB boot partion files list, which will be copied into slotb boot partition.
SLOTB_BOOT_PT_FILES="
${WRK_DIR}/slotb/imx8mm-ddr4-evk-revb.dtb
${WRK_DIR}/slotb/Image
"
# SLOTB images
# Contains boot partition and rootfs.
# Format: [FILEPATH:<OFFSET_START>:<OFFSET_END>]
SLOTB_BOOT_PT="${WRK_DIR}/common/slotb_boot_pt_120M.mirror:3370M:3490M"
SLOTB_ROOTFS="${WRK_DIR}/slotb/imx-image-multimedia-imx8mmevk.ext4:3490M:6490M"
SLOTB_IMAGES="
${SLOTB_BOOT_PT}
${SLOTB_ROOTFS}
"
0 Kudos
Reply

1,042 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hello,

Please also modify here and other PT table address referring your image layout.

Zhiming_Liu_0-1744361663133.png

Your image layout like this:

250:370

370:3370

3370:3490

3490:6490


Best Regards,
Zhiming

0 Kudos
Reply

994 Views
DennisTseng
Contributor II
U-Boot 2022.04-lf_v2022.04+g16e84141939 (Oct 08 2022 - 13:33:43 +0000)

CPU:   i.MX8MMQ rev1.0 at 1200MHz
CPU:   Commercial temperature grade (0C to 95C) at 25C
Reset cause: POR
Model: NXP i.MX8MM EVK board
DRAM:  2 GiB
TCPC:  Vendor ID [0x1fc9], Product ID [0x5110], Addr [I2C1 0x52]
SNK.Power3.0 on CC1
PDO 0: type 0, 5000 mV, 3000 mA [E]
PDO 1: type 0, 9000 mV, 3000 mA []
PDO 2: type 0, 10000 mV, 2250 mA []
PDO 3: type 0, 12000 mV, 2500 mA []
PDO 4: type 0, 15000 mV, 2000 mA []
PDO 5: type 0, 20000 mV, 1500 mA []
PDO 6: type 3, undefined
Requesting PDO 1: 9000 mV, 3000 mA
Source accept request
PD source ready!
tcpc_pd_receive_message: Polling ALERT register, TCPC_ALERT_RX_STATUS bit failed, ret = -62
Power supply on USB2
TCPC:  Vendor ID [0x1fc9], Product ID [0x5110], Addr [I2C1 0x50]
Core:  170 devices, 30 uclasses, devicetree: separate
MMC:   FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... *** Warning - bad CRC, using default environment

[*]-Video Link 0adv7535_mipi2hdmi adv7535@3d: Can't find cec device id=0x3c
fail to probe panel device adv7535@3d
mxs_video lcdif@32e00000: failed to get any video link display timings
probe video device failed, ret -22

        [0] lcdif@32e00000, video
        [1] mipi_dsi@32e10000, video_bridge
        [2] adv7535@3d, panel
adv7535_mipi2hdmi adv7535@3d: Can't find cec device id=0x3c
fail to probe panel device adv7535@3d
mxs_video lcdif@32e00000: failed to get any video link display timings
probe video device failed, ret -22
In:    serial
Out:   serial
Err:   serial
SEC0:  RNG instantiated

 BuildInfo:
  - ATF 9202efc

switch to partitions #0, OK
mmc1 is current device
flash target is MMC:1
Net:   eth0: ethernet@30be0000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0
starting USB...
Bus usb@32e40000: Port not available.
USB is stopped. Please issue 'usb start' first.
switch to partitions #0, OK
mmc1 is current device
switch to partitions #0, OK
mmc2(part 0) is current device
Scanning mmc 2:1...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk mmc@30b50000.blk...
Scanning disk mmc@30b60000.blk...
Found 10 disks
Unable to open OP-TEE session (err=-5)
mm_communicate failed!
Error: Cannot initialize UEFI sub-system, r = 3
Running BSP bootcmd ...
RootFs Slot A
switch to partitions #0, OK
mmc1 is current device
Can't set block device
Can't set block device
Booting from net ...
ethernet@30be0000 Waiting for PHY auto negotiation to complete......................................... TIMEOUT !
Could not initialize PHY ethernet@30be0000
BOOTP broadcast 1
BOOTP broadcast 2


Still the same, not getting better.

0 Kudos
Reply

980 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Did you use -m to regenerate the MBR?

Zhiming_Liu_0-1744700040785.png

 

0 Kudos
Reply

961 Views
DennisTseng
Contributor II
$ ./assemble_base_image.sh -d -m -b imx8mm
No output image name specified! Use default name!
Output image name is: swu_doublecopy_rescue_imx8mm_sd_20250415.sdcard
Delete existing swu_doublecopy_rescue_imx8mm_sd_20250415.sdcard...DONE
>>>> Check partition table file...>>>> Regenerate or overwrite partition table...
Delete existed partition table /swupdate-scripts/base_image_assembling/common/swu_dualslot_7.5G.pt
Generating /swupdate-scripts/base_image_assembling/common/swu_dualslot_7.5G.pt
Partition Disk Label: swu_dualslot_7.5G.pt
Partition File Size:  7500M
Partition Format:     MBR
Model:  (file)
Disk /swupdate-scripts/base_image_assembling/common/swu_dualslot_7.5G.pt: 7500MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start    End      Size     Type     File system  Flags
 1      238MiB   370MiB   132MiB   primary               lba
 2      370MiB   3370MiB  3000MiB  primary
 3      3370MiB  3490MiB  120MiB   primary               lba
 4      3490MiB  6490MiB  3000MiB  primary

/swupdate-scripts/base_image_assembling
DONE
DONE
>>>> Check slota boot partition mirror...DONE
>>>> Check slotb boot partition mirror...DONE
>>>> Check slota link...DONE
>>>> Check slotb link...DONE
>>>> Making header...
pad_base: 0
pad_filename: /swupdate-scripts/base_image_assembling/common/swu_dualslot_7.5G.pt
pad_size: 33K
output_pad_file: ./tmp.bin
33280 need to add to pad to 33792
pad_base: 33K
pad_filename: /swupdate-scripts/base_image_assembling/slota/imx-boot-imx8mm-evk-sd.bin-flash_evk
pad_size: 8M
output_pad_file: ./tmp.bin
6319504 need to add to pad to 8388608
DONE
>>>> Making swupdate...
pad_base: 8M
pad_filename: /swupdate-scripts/base_image_assembling/slota/Image
pad_size: 38M
output_pad_file: ./tmp.bin
185856 need to add to pad to 39845888
pad_base: 38M
pad_filename: /swupdate-scripts/base_image_assembling/slota/imx8mm-evk-imx8mm-evk.dtb
pad_size: 42M
output_pad_file: ./tmp.bin
4146236 need to add to pad to 44040192
pad_base: 42M
pad_filename: /swupdate-scripts/base_image_assembling/slota/swupdate-image-imx8mm-evk.cpio.gz.u-boot
pad_size: 250M
output_pad_file: ./tmp.bin
179333583 need to add to pad to 262144000
DONE
>>>> Making slota...
boot_pt: /swupdate-scripts/base_image_assembling/common/slota_boot_pt_120M.mirror
slot: slota
mkfs.fat 4.1 (2017-01-24)
 Volume in drive : has no label
 Volume Serial Number is 3939-06E2
Directory for ::/

No files
                        125 564 928 bytes free

 Volume in drive : has no label
 Volume Serial Number is 3939-06E2
Directory for ::/

IMX8MM~1 DTB     48068 2025-04-15   3:23  imx8mm-evk-imx8mm-evk.dtb
IMAGE         31271424 2025-04-15   3:23  Image
        2 files          31 319 492 bytes
                         94 242 816 bytes free

pt_size_num: 3145728000
Calculated partition size: 3145728000
e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/swupdate-scripts/base_image_assembling/slota/imx-image-multimedia-imx8mm-evk.ext4: 43746/784896 files (0.1% non-contiguous), 562984/768000 blocks
resize2fs 1.47.0 (5-Feb-2023)
The filesystem is already 768000 (4k) blocks long.  Nothing to do!

DONE
>>>> Making slotb...
boot_pt: /swupdate-scripts/base_image_assembling/common/slotb_boot_pt_120M.mirror
slot: slotb
mkfs.fat 4.1 (2017-01-24)
 Volume in drive : has no label
 Volume Serial Number is 416B-B0BF
Directory for ::/

No files
                        125 564 928 bytes free

 Volume in drive : has no label
 Volume Serial Number is 416B-B0BF
Directory for ::/

IMX8MM~1 DTB     48068 2025-04-15   3:25  imx8mm-evk-imx8mm-evk.dtb
IMAGE         31271424 2025-04-15   3:25  Image
        2 files          31 319 492 bytes
                         94 242 816 bytes free

pt_size_num: 3145728000
Calculated partition size: 3145728000
e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/swupdate-scripts/base_image_assembling/slotb/imx-image-multimedia-imx8mm-evk.ext4: 43746/784896 files (0.1% non-contiguous), 562984/768000 blocks
resize2fs 1.47.0 (5-Feb-2023)
The filesystem is already 768000 (4k) blocks long.  Nothing to do!

DONE
Checking partition image ...
No extra image map found, ignored!
DONE
Checking image tail for GPT...
Not using GPT, ignored!
DONE
===========================================================================
Create base image swu_doublecopy_rescue_imx8mm_sd_20250415.sdcard successfully
===========================================================================

yes, but no effect

 

0 Kudos
Reply

935 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hello,

 

I did a quick test on i.MX93(emmc), just modify the image layout, can work.

diff --git a/boards/cfg_imx93_base.cfg b/boards/cfg_imx93_base.cfg
index 07f5891..422f4c4 100644
--- a/boards/cfg_imx93_base.cfg
+++ b/boards/cfg_imx93_base.cfg
@@ -21,10 +21,10 @@ IMAGE_PT_TBL_LENGTH=512
 # Numbers and fs type in this struct will be passed to command directly.
 # sudo parted <PARTITION_NAME> unit MiB mkpart primary <Filesystem Type> <OFFSET_START> <OFFSET_END>
 IMAGE_PT_TABLE_STRUCT="
-1:SLOTA_BOOT_PT:120:240:fat32
-2:SLOTA_ROOTFS:240:3240:ext4
-3:SLOTB_BOOT_PT:3240:3360:fat32
-4:SLOTB_ROOTFS:3360:6360:ext4
+1:SLOTA_BOOT_PT:150:300:fat32
+2:SLOTA_ROOTFS:300:3300:ext4
+3:SLOTB_BOOT_PT:3300:3450:fat32
+4:SLOTB_ROOTFS:3450:6450:ext4
 "
 
 # Header of a image.
@@ -32,7 +32,7 @@ IMAGE_PT_TABLE_STRUCT="
 # Format: [FILEPATH:<OFFSET_START>:<OFFSET_END>]
 IMAGES_HEADER="
 ${IMAGE_PT_TBL_PATH}:0:32K
-${WRK_DIR}/slota/imx-boot-imx93evk-sd.bin-flash_singleboot:32K:8M
+${WRK_DIR}/slota/imx-boot-imx93-11x11-lpddr4x-evk-sd.bin-flash_singleboot:32K:8M
 "
 
 # SWUpdate image.
@@ -41,7 +41,7 @@ ${WRK_DIR}/slota/imx-boot-imx93evk-sd.bin-flash_singleboot:32K:8M
 IMAGES_SWUPDATE="
 ${WRK_DIR}/slota/Image:8M:50M
 ${WRK_DIR}/slota/imx93-11x11-evk.dtb:50M:54M
 ${SLOTA_ROOTFS}
@@ -67,8 +67,8 @@ ${WRK_DIR}/slotb/Image
 # SLOTB images
 # Contains boot partition and rootfs.
 # Format: [FILEPATH:<OFFSET_START>:<OFFSET_END>]
-SLOTB_BOOT_PT="${WRK_DIR}/common/slotb_boot_pt_120M.mirror:3220M:3340M"
-SLOTB_ROOTFS="${WRK_DIR}/slotb/core-image-base-imx93evk.ext4:3340M:6340M"
+SLOTB_BOOT_PT="${WRK_DIR}/common/slotb_boot_pt_150M.mirror:3300M:3450M"
+SLOTB_ROOTFS="${WRK_DIR}/slotb/core-image-base-imx93-11x11-lpddr4x-evk.ext4:3450M:6450M"
 SLOTB_IMAGES="
 ${SLOTB_BOOT_PT}
 ${SLOTB_ROOTFS}




Best Regards,
Zhiming

0 Kudos
Reply