Ethernet camera module build log #4 – Storage
Buildroot is a simple, efficient, easy-to-use tool to generate embedded Linux systems. Allwinner S3 system can boot from:
- SD Card 0 / SDC0
- SD Card 2 / SDC2
- SPI NOR Flash / SPI0
- SPI NAND Flash / SPI0
- USB boot
SD Card
SOC checks each boot device in a sequence. If the boot step fails, the next device is probed. SD card is the fastest way to switch operating systems and is not limited by small SPI NOR/NAND Flash size. While it’s a bit more complicated than copying a file, It does not require special tools or knowledge to flash an SD card. There are plenty of tools. To name a few:
- Win32DiskImager, Open Balena Etcher, Raspberry Pi Imager for Windows. All of them are GUI based as self explanatory.
- Linux: dd. This is command line tool with syntax like:
sudo dd if=output/images/sdcard.img of=/dev/mmcblkX bs=1M status=progress
NAND and NOR Flash
To save space, onboard flash is much more suitable. Allwinner S3 allows flashing firmware over USB (if none of the boot devices contains a valid bootloader, it jumps to USB boot mode automatically). sunxi-tools is the tool to flash soldered flash chips without desoldering them.
Some tricks can be utilized to speed up development. Unsolder flash from the module and use an external one connected with wires. It can be rapidly removed and flashed with a standalone Flash programmer. One step ahead – when SOC is in the reset/sleep mode, most likely, it will not clamp SPI signals. Extra pigtail to the programmer could save flash swapping procedure and allow automate testing.
While USB flashing seems to be a good idea, it is slow. Flash time with sunxi-tools is about 2h, and flashing chip with standalone programmer takes about 2-3min.