Flash Linux image onto NAND memory

Hello everyone.

Recently i built an Linux image in Yocto, so far i have been flashing on SD Card, then U-Boot load from the SD Card. Let me ask you kindly, is there any tool to flash the Image in NAND instead? i don’t wanna use SD.

The board i use is Colibri VF61

Thanks!

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello!

To flash a Linux image onto the eMMC of your Colibri VF61 module, you can use the serial recovery mode along with the imx_uart utility. Here’s a straightforward guide to help you through the process:

  1. Prepare for Serial Recovery:

    • Connect your Colibri VF61 module to your development PC using the UART_A interface. It’s recommended to use hardware flow control with RTS/CTS signals for reliable data transfer.
    • Depending on your carrier board, connect the appropriate cables:
      • Colibri Evaluation Board: Use a null modem RS-232 cable on X25 or a regular USB cable on X27.
      • Iris Carrier Board: Connect UART_A on X13 to your PC.
      • Aster Carrier Board: Use the Micro USB (X4) for both power and UART_A connection.
  2. Enter Recovery Mode:

    • Use the appropriate method for your setup to enter recovery mode, which typically involves a hardware mechanism.
  3. Run the Serial Recovery Utility:

    • Utilize the imx_uart utility to download the U-Boot bootloader to the module’s memory. This utility is part of the Toradex recovery package.
    • If RTS/CTS are not connected, use the -n parameter with imx_uart.
    • After downloading U-Boot, a serial console should appear, which you can access using a terminal application like screen or minicom.
  4. Flash the Linux Image:

    • With U-Boot running, follow the standard procedure to flash the Linux image onto the eMMC using commands in the U-Boot console.
  5. Power Cycle the Module:

    • After flashing, perform a power cycle to clear the “enter recovery mode” flag, as a simple reset will not suffice.

By following these steps, you should be able to successfully flash your Linux image onto the eMMC of the Colibri VF61 module. Ensure all connections are secure and that you have the necessary software tools installed on your development PC.

Best regards,
Toradex AI Assistant.

Please, also check if these links can help you solve your problem:

https://community.toradex.com/tag/flash

Updating NAND-based modules from userspace | Toradex Developer Center.

I cannot find a solution to flash onto NAND memory of VF module…Easy installter is not available for VF modules so, how can i flash from my SD Card to NAND memory?

Don’t you have legacy image like this one?

You need to sudo tar -xjvf it, then ./update.sh -o to create update media. On update media under colibri_vf you need to replace ubifs.img, zImage and your *.dtb files. Put it to Colibri carrier board and from U-Boot run setupdate ; run update

As well, if you are able to boot from SD, you may
ubiattach --p /dev/mtd3
and then ubiupdatevol zImage, DTB and ubifs.img to respective UBI volumes. Which exactly volumes, like /dev/ubi0_? may be found using ubinfo -a

If you have no /dev/mtdN devices when booting from SD, then perhaps kernel command line misses information about MTD partitioning. Try booting from NAND and see if you have in /proc/cmdline something like mtdparts= . Add that to defargs when booting from SD and you should have those /dev/mtd’s.

SO,

after execute update.sh -0 media (SD CARD)
i need to inster the SD on the board, and then, from U-Boot, need execute run setupdate, isn’t?

yes, install update.sh prepared media (either SD or USB drive (though USB may not work on older VF U-Boot)), then from U-Boot run setupdate and run update

First of all, thanks for replying!
:slight_smile:
I did those steps, i recive this message:

ARP Retry count exceeded; starting again
Colibri VFxx # run setupdate
reading colibri_vf/flash_blk.img
** Unable to read file colibri_vf/flash_blk.img **
** Bad device usb 0 **
Using FEC device
TFTP from server 192.168.10.1; our IP address is 192.168.10.2
Filename ‘colibri_vf/flash_eth.img’.
Load address: 0x80008000
Loading: *
ARP Retry count exceeded; starting again

do i need to set the board in recovery mode?

I replaced the files from the colibri_VF_bin folder with the yocto image files (.dtb .bin .img…) then SD preparation is success, but when i run “run setupdate” this message appears…do i need a UART cable with RTS tied to CTS?

thanks

So are you files on USB drive? Perhaps your U-Boot is unable to read then when on your carrier board. Try with SD card.
IIRC update.sh doesn’t format media. SD/USB driver should be FAT32 formatted.

Replacing files, did you wipe flash_blk.img? You should replace only *.dtb, zImage and ubifs.img.

I saw the problem, it is solved, but, there something i don’t understand…in colibri_vf_bin i need put files you mentioned…
in rootfs folder, what i should to put? Yocto generate some files such as .imx .bin and zImage, i just copy all files from image generated by yocto and copy to colibri_vf bin foler, then i click “replace them” that should be enought, right?

But in folder colibri _vf_bin there are other files that doesn’t exist in yocto’s folder

rootfs comes with update.sh, no such folder on your update media, which you make with update.sh -o. Was I unclear that you need to replace zImage, *.dtb and ubifs.img on your update media?

You should leave unmentioned files as they are. Only what you are going to replace on your target, kernel, compiled DT and rootfs (ubifs.img). If you are sure, U-Boot you bake in Yocto is OK, then you may as well replace u-boot-nand.imx. File names should be not altered, zImage to replace zImage, vf610-colibri-eval-v3.dtb to replace vf610-colibri-eval-v3.dtb and so on.

Well,

I did all the steps, no mistakes in the process, but still runs Angstrom console OS…

In the SD i can see the files that update.sh script creates and put in, but there is something i don’t underdstand…yocto generates a .wic file which is almost 200MB… it is: core-image-minimal-xfce-colibri-vf-20241210081801.rootfs.wic file, it makes sense due to XFCE OS with desktop etc…but in the sdCard the zImage is just 9MB…how is that possible? do i need to bitbake the imagen on yocto with some params…? maybe i miss some step in yocto but usually i use bitbake core-image-minimal-xfce, and it generates the .wic image.

zImage is just the Linux kernel. And your wic includes whole rootfs, zImage and dtb’s.
Isn’t bitbake creating *.ubifs file in build/deploy/images/colibri-vf ? That’s your rootfs image for UBI. You need to overwrite with this file colibri_vf/ubifs.img on your update media.
You may as well try to overwrite whole rootfs folder, which comes along with update.sh. Then, if update.sh doesn’t get upset by something missing, it should create ubifs.img on update media from files in rootfs folder.