Flashing
AIoT tools
AIoT tools is a set of tools to configure or interact with MediaTek boards.
Note
This page is only a short introduction to using the AIoT tools, it is strongly advised to fully read the AIoT tools manual in order to get the most out of the AIoT tools.
AIoT tools installation
RITY flashing process requires you to install the AIoT tools.
Prerequisites
In order to flash your images, your host machine must be able talk to the board SoC. You need to make sure that the user session on your host machine has the right permission to talk to the SoC via USB.
You can check if your host machine is correctly configured to talk to the SoC by running aiot-config. In the case that your host machine is not correctly configured, aiot-config will give you instructions on how to correctly configure your host machine.
Warning
On Windows, aiot-config is unable to fully check the correct system configuration. Please follow the AIoT tools documentation to make sure it is correctly configured.
Enter download mode
In order to be able to flash, you often need to set the SoC in download mode, which will allow the AIoT tools to download on the SoC’s SRAM a binary that will provide a fastboot interface.
To enter download mode you need to press the board buttons as follows:
press and keep pressing the volume up button
press and release the reset button
release the volume up button
Note
volume up is sometimes called KPCOL0
Flashing an image
To flash a entire image, please run the command below. <machine> should be replace to contain the value of the MACHINE variable that was used to build the SDK.
cd rity/build/tmp/deploy/images/<machine>
aiot-flash -i rity-demo-image
Yocto Image:
name: Rity Demo Image (rity-demo-image)
distro: Rity demo 21.1-dev (rity-demo)
codename: gatesgarth
machine: i300a-pumpkin
overlays: []
Looking for a MediaTek SoC matching USB device 0e8d:0003
Once you see Looking for a MediaTek SoC, please enter download mode.
press and keep pressing the volume up button
press and release the reset button
release the volume up button
You should see the board getting flash immediately after releasing the volume up button.
Flashing only one partition
To flash just one partition, you can run the following command:
cd rity/build/tmp/deploy/images/<machine>
aiot-bootrom
<enter download mode>
fastboot flash <partition> <file>
<partition> should be replaced with one of the partition present in the wic file:
1# SHORT-description: Create an image for MediaTek SoC based boards 2# long-description: Creates a partitioned image for MediaTek SoC based boards. 3 4bootloader --ptable gpt --timeout=0 5part --source rawcopy --sourceparams="file=fip.bin" --part-name bootloaders --align 512 --fixed-size 4M 6part --source rawcopy --sourceparams="file=fitImage" --part-name kernel --size 15M 7part / --source rootfs --fstype=ext4 --label rootfs --part-name rootfs --part-type B921B045-1DF0-41C3-AF44-4C6F280D3FAE --active --exclude-path=home/ 8part /home --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --fstype=ext4 --label home --part-name home --part-type 933AC7E1-2EB4-4F13-B844-0E14E2AEF915 --use-uuid --size ${IMAGE_HOME_SIZE} --mkfs-extraopts "-b ${WIC_BLOCK_SIZE}"
In addition to the partitions defined in the wic, some special partitions are also available: mmc0, mmc0boot0, and mmc0boot1.
Partition name |
File |
---|---|
mmc0 |
MBR_EMMC |
mmc0boot0 |
bl2.img |
mmc0boot1 |
u-boot-env.bin |
bootloaders |
fip.bin |
kernel |
fitImage |
rootfs |
<image>-<machine>.ext4 |