Writing VisionSOM-x2L system image to eMMC memory
From SomLabs Wiki
Writing system image to VisionSOM-x2L eMMC memory
Contents
Prerequisites
- Extracted wic system image (somlabs-image-visionsom-x2l-cb.wic) - to flash Linux system image
- First stage loader binary (bl2_bp-visionsom-x2l-cb.bin) - to flash u-boot bootloader
- U-boot bootloader binary (fip-visionsom-x2l-cb.bin) - to flash first stage loader
All of these files can be found in the Yocto build subdirectory tmp/deploy/images/visionsom-x2l-cb/. The x2l suffix in all names should be changed to g2l of v2l depending on used module variant.
The files should be located on a USB flash drive formatted as a single FAT32 partition.
The programming process may include only one of the mentioned files. In this case only the corresponding file - image, u-boot or loader should be present on the USB flash storage.
Programming eMMC
- Power-on the board with serial console connected to PC (Console uUSB port on VisionCB-G2L/V2L-STD): bitrate 115200, 8N1, no parity.
- Stop u-boot booting during counting by pressing any key in the terminal.
- Connect the flash USB drive to USB0 port on VisionCB-G2L/V2L-STD board.
- Execute run usbflash command.
The programming procedure will look for one or more of the files to update (image, u-boot, loader) and flash its content to the eMMC memory.
Recovering u-boot or loader
In case u-boot could not be loaded there exists a recovery solution to write the first stage loader and u-boot using the processor ROM firmware. The recovery process may be done using two different methods - using SoMLabs or Renesas tools.
Recovery with SoMLabs tools
Required files
- Flash loader scripts: https://github.com/SoMLabs/rzx2l-loader
- Boot partition image file generated by Yocto or according to loader instructions: boot-visionsom-x2l-cb.img (change the x2l name to g2l or v2l)
- Optional: custom flash writer binary (https://github.com/SoMLabs/rzg2_flash_writer)
Recovery process
Before starting boot partition programming, the VisionCB-G2L/V2L-STD board should be connected to host PC using Console port and the RECOVERY pins should be connected together with a jumper.
The rzx2l-loader repository contains scripts that help with programming the boot partition on the eMMC memory of VisionSOM-x2L modules. After downloading the sources from github page (https://github.com/SoMLabs/rzx2l-loader) the programming script can be called:
./rzx2l-loader.py -p <serial port> -l <loader> --image <boot image>
- serial port - should be selected according to the port connected to Console uUSB on VisionCB-G2L/V2L-STD board
- loader - one of the provided loaders:
- Flash_Writer_SCIF_VSOM_G2L_1GB_DDR4_1GB_1PCS.mot
- Flash_Writer_SCIF_VSOM_V2L_1GB_DDR4_1GB_1PCS.mot
- or custom one build from the source code: https://github.com/SoMLabs/rzg2_flash_writer
- boot image - boot partition image generated by Yocto
- boot-visionsom-x2l-cb.img
- or custom one created according to instruction https://github.com/SoMLabs/rzx2l-loader/blob/master/README.md
After he script finishes writing the whole boot partition the RECOVERY jumper pins should be disconnected and the board can be reset.
Recovery with Renesas tools
Required files
- Flash loader application: Renesas_recovery_flash_writer.zip
- Loader S-record file: bl2_bp-visionsom-x2l-cb.srec (change the x2l name to g2l or v2l)
- U-boot S-record file: fip-visionsom-x2l-cb.srec (change the x2l name to g2l or v2l)
Recovery process
- Open the serial terminal application that allows for file transmission in ascii format.
- Power-on the board with connected RECOVERY jumper and serial console connected to PC (Console uUSB port on VisionCB-G2L/V2L-STD): bitrate 115200, 8N1, no parity.
- Send the Flash_Writer_SCIF_VSOM_x2L_1GB_DDR4_1GB_1PCS.mot file (change the x2L name to G2L or V2L).
- Use EM_W command to send bl2_bp-visionsom-x2l-cb.srec file
- Area: 1, Start Address: 1, Program Start Address: 11E00
- Use EM_W command to send fip-visionsom-x2l-cb.srec file
- Area: 1, Start Address: 100, Program Start Address: 0