Install an image to SPI Nor Flash
Meles has a SPI nor Flash on board. It contains the Bootloader and supports booting other media that the SoC download mode itself does not directly support such Micro SD card and USB.
Install an image to SPI Nor Flash via UART port
When you replace a new SPI Nor Flash or the firmware is damaged, you may need to burn an image for it. In this case, you can use the serial port to burn it.
Requirements
- Meles with proper power
- Bootloader for Meles
- Image writer
- USB to TTL serial cable
- Linux Ubuntu PC
Install tools on PC
Install yoctools
sudo pip install yoctools -U
Check version
yoc --version
2.0.74
Get image writer, iw-single-line.bin
wget https://github.com/milkv-meles/thead-bin/raw/main/image-writer/iw-single-line.bin
Get essential images
First you need to prepare the image for burning. If your Meles is the 8GB version, you need to download u-boot-with-spl-meles.bin
. If your Meles is the 4GB version, download u-boot-with-spl-meles-4g.bin
. These files can be found in the Official Image section.
Download zero image.
wget https://github.com/milkv-meles/thead-bin/raw/main/image-writer/zero-1m.img
Boot Meles to download mode
To boot Meles to download mode is simple:
- Power down Meles
- Plug USB to TTL serial cable to Meles debug port
- Press download button and hold it
- Plug USB Type-C power adapter to Meles Type-C port to power on Meles
- Release download button
Write Bootloader to SPI Nor Flash
Step 1: Check available devices with cct tool
Run the following command. /dev/ttyUSB0 is the serial port on PC.
sudo cct list -u /dev/ttyUSB0
Wait ..............
The log output "Wait ......" here means that the cct program is waiting for Meles to respond, and Meles will only respond at the moment of entering the download mode.
Do not close the terminal, and ignore the printed logs and go directly to Step 2.
Step 2: Boot Meles to download mode
- Power down Meles
- Plug USB to TTL serial cable to Meles debug port
- Press download button and hold it
- Plug USB Type-C power adapter to Meles Type-C port to power on Meles
- Release download button
- Check device
The terminal opened in Step 1 will now print a list of storage devices.
sudo cct list -u /dev/ttyUSB0
Wait ............................
Memory device list:
dev = ram0 , size = 1.1MB
dev = qspi0 , size = 16.0MB