SWupdate procedure for imx8mp

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

SWupdate procedure for imx8mp

415 Views
Marco_Savo
Contributor II

I am looking into a simple update solution for our custom OS for a custom board using a SMARC module based on imx8mp processor (SECO, congatec). I am already aware of AN13872 document, that is quite exaustive, but there is no mention of imx8mp, and seems overly complicated. I want to do a single image update procedure from an USB stick. Where can I find an exhaustive tutorial for that. I found many options and I could only break out the build in the process.

What I've done successfully, so far:

 

repo init -u <...>
repo sync
cd sources/
git clone https://github.com/sbabic/meta-swupdate.git -b kirkstone
git clone https://github.com/nxp-imx-support/meta-swupdate-imx.git -b kirkstone_5.15.32_2.0.0
cd ../build_dir
echo "BBLAYERS += \"\${BSPDIR}/sources/meta-swupdate\"" >> conf/bblayers.conf
echo "BBLAYERS += \"\${BSPDIR}/sources/meta-swupdate-imx\"" >> conf/bblayers.conf

echo "IMAGE_INSTALL:append = \" lua swupdate swupdate-www swupdate-progress swupdate-client swupdate-tools-ipc u-boot-imx u-boot-fw-utils systemd-swusys json-c\"" >> conf/local.conf
echo "IMAGE_FSTYPES = \" ext4 ext4.gz wic.bmap wic.gz\"" >> conf/local.conf

 

At this point, the documentation is not clear.

bitbake swupdate-image, what's for, exactly?

What's the next step? I see in the tutorial the use of swu_update_image_build.sh, but I could not find it in the repository

 

Tags (2)
0 Kudos
Reply
5 Replies

353 Views
Marco_Savo
Contributor II

So I was able tu run:

bitbake swupdate

And:

bitbake swupdate-image

For this to run I had to comment:

#EXTRA_IMAGE_FEATURES += "tools-debug tools-profile tools-testapps ssh-server-openssh"

In local.conf

I can successfully configure swupdate in yocto with:

bitbake -c menuconfig swupdate

Now I have built:

swupdate-image-imx8mp-cgtsx8p.ext4.gz.u-boot
swupdate-image-imx8mp-cgtsx8p.ext4

But shouldn't I have a .swu file in order to use swupdate?

0 Kudos
Reply

320 Views
Marco_Savo
Contributor II

So, now I have, built:

swupdate-image-imx8mp-cgtsx8p.ext4.gz.u-boot
swupdate-image-imx8mp-cgtsx8p.ext4
core-image-base-imx8mp-cgtsx8p.ext4.gz
bootcontainer__imx8mp-cgtsx8p__sd.bin
core-image-base-imx8mp-cgtsx8p.wic.bz2

So, I understand that I can use to create the .swu file:

pip install swugenerator

Can I use this as sw-description?

software =
{
	version = "0.1.0";

	imx8mp-dart = {
		hardware-compatibility: [ "1.0" ];

		files: (
			{
				filename = "core-image-base-imx8mp-cgtsx8p.ext4.gz";
				type = "archive";
				compressed = true;
				device = "/dev/update";
				filesystem = "ext4";
				path = "/";
			}
		);

		scripts: (
			{
				filename = "update.sh";
				type = "shellscript";
			}
		);
	};
}

Is this correct?

0 Kudos
Reply

289 Views
Alejandro_Salas
NXP TechSupport
NXP TechSupport

Hello @Marco_Savo 

One can try to refer to chapter 6 in AN13872 (Creating a base image and an update image) and 6.1 (swupdate-script repository).

 

Also it is useful to check the SWUpdate syntax examples.

 

Best regards,

--... ...--

Salas.

0 Kudos
Reply

176 Views
Marco_Savo
Contributor II

OK, I am then able to create this .sdcard file that I can flash into the board with the uuu tool. For that, I had to modify the boards in the script repository, but also the swupdate-imx repository, to include imx8mp.

still, the result is:

Disk /dev/mmcblk2: 14.6 GiB, 15678308352 bytes, 30621696 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2b59b9ca

Device Boot Start End Sectors Size Id Type
/dev/mmcblk2p1 204800 450559 245760 120M c W95 FAT32 (LBA)
/dev/mmcblk2p2 450560 6594559 6144000 2.9G 83 Linux
/dev/mmcblk2p3 6594560 6840319 245760 120M c W95 FAT32 (LBA)
/dev/mmcblk2p4 6840320 12984319 6144000 2.9G 83 Linux

 

I want to do a singlecopy image with rescue image; the document explains it, but there is no script for doing it.

Plus, this is crating a filesystem with 4 partitions that uses 7.5 GB. So, why? what's going on with the additional 7.5 Gb not used?

 

0 Kudos
Reply

364 Views
Marco_Savo
Contributor II

The compiler (doing a bitbake -v core-image-base), would complain about u-boot-imx; seems that I should use the board configuration, for example in my case u-boot-congatec-sx8p

0 Kudos
Reply