Project

General

Profile

Recommended quick method to install Linux image on EMMC storage for high volume products

Added by Tim Troester about 1 month ago

I was wondering if there is any recommended quick way to install Linux images on the EMMC storage for high volume products? I followed the guide on the wiki to do this and it takes a little while and requires familiarity with Linux. We plan to produce a large number of this product each year and was hoping there is a quicker and easier way for non-technical staff to install our image.

Tim


Replies (8)

RE: Recommended quick method to install Linux image on EMMC storage for high volume products - Added by Jonathan Cormier about 1 month ago

Tim Troester wrote:

I was wondering if there is any recommended quick way to install Linux images on the EMMC storage for high volume products? I followed the guide on the wiki to do this and it takes a little while and requires familiarity with Linux. We plan to produce a large number of this product each year and was hoping there is a quicker and easier way for non-technical staff to install our image.

Were you trying the dfu usb process? I know we noticed it was pretty slow. We could likely come up with a hybrid approach where you boot over dfu and then flash the image using Android's "fastboot" tool or download the image over ethernet.

That can be run from Windows and you'd probably want to write a small GUI that automates it. And ideally lets you plug in multiple units at once.

Something like either of the following, though I have not used either. They just came up in google. Neither is likely to be plug and play ready but might be a interesting starting point
https://github.com/kiibohd/kii-dfu
https://github.com/sourcebox/dfu-buddy

Tim

Does your board have an sdcard slot? We have in the past created "programmer" sdcards that boot, flash the emmc, and then power down. The biggest downside to this method is tracking any errors that might occur and production forgetting to take out the sdcard when its done.

Also if possible we can work to shrink your emmc image. Less data to flash, will speed up whatever method you end up using.

RE: Recommended quick method to install Linux image on EMMC storage for high volume products - Added by Tim Troester about 1 month ago

I was using the "Boot EMMC" instructions from the wiki. I didn't realize the dfu usb process was an option, thanks for pointing it out.

I tried to follow the dfu instructions but the step about modifying 62x-build.sh doesn't work for me. My 62x-build.sh script from the tip of oe-layersetup is different. Is there another version of the file I should be modifying?

In the end the slower speed of the dfu approach may make it not viable for us. I am leaning towards the "programmer" micro SD card approach since we have the card slot and our production staff is more familiar with this type of approach. The image over Ethernet could also be a nice option but I am not sure how to get something like that started.

For the SD card approach, will I need to create 2 images? One for the boot area (mmcblk0boot0) and one for the root file system (mmcblk0). If so how would I go about creating the emmc boot image from YOCTO? I wasn't able to find any examples of setting up an emmc image for mmcblk0boot0.

Tim

RE: Recommended quick method to install Linux image on EMMC storage for high volume products - Added by Jonathan Cormier about 1 month ago

Tim Troester wrote in RE: Recommended quick method to install Linux image on EM...:

I was using the "Boot EMMC" instructions from the wiki. I didn't realize the dfu usb process was an option, thanks for pointing it out.

I tried to follow the dfu instructions but the step about modifying 62x-build.sh doesn't work for me. My 62x-build.sh script from the tip of oe-layersetup is different. Is there another version of the file I should be modifying?

Okay we are looking into it. We are on the cusp of releasing the SDK 10 this week and I suspect the instructions were written with that in mind.

Note: TI has stated there are several improvements to the PLL configuration in the sysfw for the 10 SDK that they implied were crucial, even though their release notes don't make it sound so dire. It would be a good idea to use the SDK 10 (2024 u-boot and 6.6 kernel) for your product release. However since its short notice, they did provide some instructions for using the updated sysfw on the SDK 9 release. Let me know if this is something you would like to pursue.

Note in our testing we've not noticed a difference between the two firmware version but TI seemed concerned about it.

In the end the slower speed of the dfu approach may make it not viable for us.

Understandable. Though you can parallelize it to some extent, since we aren't hitting USB2 bandwidth limits.

I am leaning towards the "programmer" micro SD card approach since we have the card slot and our production staff is more familiar with this type of approach. The image over Ethernet could also be a nice option but I am not sure how to get something like that started.

For the SD card approach, will I need to create 2 images? One for the boot area (mmcblk0boot0) and one for the root file system (mmcblk0). If so how would I go about creating the emmc boot image from YOCTO? I wasn't able to find any examples of setting up an emmc image for mmcblk0boot0.

If you are programming from Linux booted on the board, I would follow the steps outlined in the boot emmc wiki, as yocto outputs all the files required.
We can provide a flash.sh script that runs through the steps and checks for errors if that would be helpful.

root@mitysom-am62x:~# dd if=tiboot3.bin of=/dev/mmcblk0boot0 bs=512 seek=0
root@mitysom-am62x:~# dd if=tispl.bin of=/dev/mmcblk0boot0 bs=512 seek=1024
root@mitysom-am62x:~# dd if=u-boot.img  of=/dev/mmcblk0boot0 bs=512 seek=5120
Optional if you want to set the environment
root@mitysom-am62x:~# dd if=<uboot env blob> of=/dev/mmcblk0boot0 bs=512 seek=7944

It would make a lot of sense to have a separate flash-emmc-image.bb that creates an sdcard image with the script and dependencies. And just needs the appropriate files to be copied to the sdcard. Note: I'm not sure how hard it would be to have a yocto filesystem image, depend on a different filesystem image and auto copy those files...

one for the root file system (mmcblk0)

If you want a rootfs image file for emmc, there should be a wks image file that would generate a .wic image file with only one partition. However, flashing the emmc will likely be faster if you use the .tar.xz rootfs to populate the image as you won't have to write a bunch of 0's to the emmc that would be included in a .img/.wic file...

Rough outline of steps

# TODO Partition /dev/mmcblk0 with single partition using sfdisk
root@mitysom-am62x:~# mkdir -p /mnt/emmc-rootfs
root@mitysom-am62x:~# mkfs.ext4 /dev/mmcblk0p1
root@mitysom-am62x:~# mount /dev/mmcblk0p1 /mnt/emmc-rootfs/
root@mitysom-am62x:~# tar -C /mnt/emmc-rootfs/ -xf tisdk-default-image-mitysom-am62x-XXX.rootfs.tar.xz
root@mitysom-am62x:~# umount /mnt/emmc-rootfs/

RE: Recommended quick method to install Linux image on EMMC storage for high volume products - Added by Joshua Bourgeot about 1 month ago

Tim Troester wrote in RE: Recommended quick method to install Linux image on EM...:

I tried to follow the dfu instructions but the step about modifying 62x-build.sh doesn't work for me. My 62x-build.sh script from the tip of oe-layersetup is different. Is there another version of the file I should be modifying?

I've taken a look at the dfu boot page and it was in fact written with the 10 sdk in mind. The am62x_r5_usbdfu.config file referenced is a new thing in the 10 sdk. I've just copied it over to our branch for the 9.2 sdk, so if you pull the latest commit from mitysom-u-boot-2023.04, that should be there.

As far as the 62x-build.sh script, the patch had the wrong line number. You can go in and simply append am62x_r5_usbdfu.config to the first R5 make line:

-make -j"$(nproc)" "$MV" ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- O="$R5_BUILDDIR" "${MACHINE}_r5_defconfig" 
+make -j"$(nproc)" "$MV" ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- O="$R5_BUILDDIR" "${MACHINE}_r5_defconfig" am62x_r5_usbdfu.config

Everything else should work fine and the rest of the instructions are the same for the 9.2 and the 10 sdk.

RE: Recommended quick method to install Linux image on EMMC storage for high volume products - Added by Tim Troester 29 days ago

Thanks Jonathan and Joshua for the info.

We will wait for you to release the updates for version 10 of the SDK, then merge it with our yocto layer.

We are interested in taking Jonathan up on the offer to "provide a flash.sh script that runs through the steps and checks for errors", if he is willing. We can integrate that into our SD card image which will boot up and flash the emmc with the OS and our custom software.

Tim

RE: Recommended quick method to install Linux image on EMMC storage for high volume products - Added by Jonathan Cormier 27 days ago

Hi Tim, still working on releasing the 10 SDK but I did push the mitysom-auto-flash-emmc image to the kirkstone meta-mitysom repo.

https://support.criticallink.com/gitweb/?p=meta-mitysom.git;a=commit;h=72802113c772aa5c8697846984a2e81a4ee5302d

Let us know if you have any feedback.

It would be nice if the script could blink an LED or something to indicate it was successful.

RE: Recommended quick method to install Linux image on EMMC storage for high volume products - Added by Tim Troester 15 days ago

Thank you, Jonathan. We were able to adapt the mitysom-auto-flash-emmc image and use it in our layer to flash the emmc. It only takes about 90 seconds after boot to flash it.

Tim

    (1-8/8)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)