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-J721S2: The first ota will lose the boot part and boot dev param.

Part Number: PROCESSOR-SDK-J721S2

We use boot0 bootmode to boot the spl system on emmc via the uEnv.txt's uenvcmd command to boot switch between the 5th partition and the 6th partition.

The uenvcmd is "uenvcmd=set bootpart 0:5; set mmcdev 0;" and "uenvcmd=set bootpart 0:6; set mmcdev 0;".

The default emmc's mmcdev is also set to 0.

First, we do the partition follow the mksdboot.sh to emmc, our partition part is:

dd if=/dev/zero of=$device bs=1024 count=1024

sync

cat << END | fdisk $device
n
p
1

+128M
n
p
2

+128M
n
e
3


n

+2G
n

+2G
n

+512M
n

+512M
n

+256M
n

+256M
n

+1G
n

+64M
n

+64M
n

+16M
n


t
1
c
t
2
c
a
1
a
2
w
END

...

# make partitions.
echo "Formatting ${device} ..."
if [ -b ${PARTITION1} ]; then
	mkfs.vfat -F 32 -n "BOOT" ${PARTITION1}
else
	echo "Cant find boot partition in /dev"
fi

if [ -b ${PARTITION2} ]; then
	mkfs.vfat -F 32 -n "BOOTB" ${PARTITION2}
else
	echo "Cant find bootb partition in /dev"
fi

if [ -b ${PARTITION5} ]; then
	mkfs.ext4 -L "rootfs" ${PARTITION5}
else
	echo "Cant find rootfs partition in /dev"
fi

if [ -b ${PARTITION6} ]; then
	mkfs.ext4 -L "rootfsb" ${PARTITION6}
else
	echo "Cant find rootfsb partition in /dev"
fi

...


Second, we extract the boot.tar.gz and rootfs.tar.gz to the BOOT BOOTB rootfs rootfsB partition.The first reboot will boot to rootfs.

Third, we extract the boot.tar.gz which uEnv.txt's uenvcmd will lead to boot to rootfsB, but it's next first reboot stay in the uboot.

The bootpart and mmcdev param restore to default 1:2 and 1.

Why this occurred? We need your help, please.

  • HI Renf 

    Can you elaborate more on your usecase what you are trying to achieve here ?

    Regards
    Diwakar

  • Hi Diwakar,

    We use double partitions to avoid the risk of updating the file system. In this case, we set rootfsB as the backup area of rootfs, and the same rootfs is the backup of rootfsB.

    Every time updating the system, we write the backup area of current running partition.

    So we need to switch to the other rootfs when updating finished.

  • HI Renf 

    So far what i understood is that you are creating four partition 

    BOOT

    BOOTB --> Backup boot images 

    Rootfs

    RootfsB --> backup rootfs images 

    now in the first boot you are able to boot upto linux 

    after that i am not clear what you are doing 

    Third, we extract the boot.tar.gz which uEnv.txt's uenvcmd will lead to boot to rootfsB, but it's next first reboot stay in the uboot.

    why again need to extract the images as you already extracted the images in the second step 

    Second, we extract the boot.tar.gz and rootfs.tar.gz to the BOOT BOOTB rootfs rootfsB partition.The first reboot will boot to rootfs.

    Also under what circumstances  and how you are switching between the BOOT <--> BOOTB and rootfs <-->rootfsB.

    Regards
    Diwakar

  • Hi Diwakar,

    The spl boot from emmc is via boot0 partition. So the boot order is:

    boot0   ( tiboot3.bin  tispl.bin u-boot.img)

    ->

    BOOT ( BOOTB is not used)

    ->

    rootfs/rootfsB

    We now only use BOOT's uEnv.txt to control entering which rootfs. The uenvcmd command  in uEnv.txt acts this.

    All the flow is:

    boot via spl sd card to uboot-> set boot param and save to emmc (set mmcdev 0;saveenv)  -> boot to linux of sd card (set bootpart 1:2; set mmcdev 1; boot) -> Clear the emmc -> do partition to emmc -> write partitions of emmc -> boot to linux of emmc card ( via the uenvcmd of BOOT)-> write the BOOT again -> reboot   

    Then we found the emmc's boot param has been reset to default (print shows mmcdev 1)

    Why the saved param( mmcdev 0) changed to default( mmcdev 1) ?

    It only happens one time. Then we set and save the boot param to emmc again, and It goes well in repeating writing to BOOT partition to change uenvcmd to boot to rootfs or rootfsB. 

    Once we clear the emmc and do the flow, it will happen again.

    We need to update the rootfs/rootfsB through OTA. So we need a backup rootfs to do the updating when another rootfs is running. When the updating is ended, it should switch boot to backup rootfs.

  • HI Renf 

    I summarised my understanding and question 

    can you add the answer and more detail in this form it is easy to understand 

    or if you okay with the quick sync up that is fine so that i can better understand the issue .

    Regards
    Diwakar

  • Hi Diwakar,

    In step 5, boot mode can be changed by Switch settings which shown in links:

    1、https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-j721s2/09_00_00_08/exports/docs/linux/How_to_Guides/Hardware_Setup_with_CCS/J721S2_EVM_Hardware_Setup.html

    2、https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-j721s2/latest/exports/docs/linux/Foundational_Components/U-Boot/UG-Memory.html

    3.1.1.5.5. Booting tiboot3.bin, tispl.bin and u-boot.img from eMMC boot partition

     

    In setp 7, we want to change to boot to another rootfs which is diffent from step3. 

    We need to change the rootfs, because we write to another filesystem(rootfs) every time of ota.

  • HI Renf ,

    Which SDK you are using 

    in the recent SDK saveenv command got removed 

    is saveenv is getting succeeded ?

    Regards
    Diwakar

  • Hi Diwakar,

    We are using: ti-processor-sdk-linux-j721s2-evm-08_06_00_10 and ti-processor-sdk-rtos-j721s2-evm-08_06_00_11.

    I added the saveenv to uboot and verified it's ok.

  • HI Renf,

    I added the saveenv to uboot and verified it's ok.

    Understood 

    i am assuming in step 2 you are saving the envoirment variable which tell to pick the rootfs from the emmc 

    and the in STEP7 you writing the Boot images to the emmc and rebooting 

    Am i correct ?

    Regards
    Diwakar