# Flashing The LAA arrives from the factory pre-flashed with the factory validation OS on the eMMC. In order to operate properly, each LAA should be flashed with the production OS on the NVMe. The factory validation OS is able to automatically flash the production OS on NVMe as long as it's able to download a file called `torizon-docker-verdin-imx8mp.ota.tar.zst` from `http://laa-tezi.local`. If for some reason, flashing from network is impossible, you can [reflash from scratch](#reflashing-from-scratch). ## Network flashing ### Network setup Connect the LAA to the flashing network using the `Main Eth` ethernet port. By default, the LAA is expecting to get an IP from a dhcp server. ### Flashing server The flashing server should be reachable at http://laa-tezi.local in the flashing network. #### Avahi server Configure avahi-server to answer to laa-tezi.local. In `/etc/avahi/avahi-daemon.conf` add: ```ini [server] host-name=laa-tezi ``` The restart avahi-daemon: ```shell sudo systemctl restart avahi-daemon ``` #### HTTP server Download the latest firmware to flash from [baklava-manifest registry](https://gitlab.com/LinaroLtd/lava/appliance/baklava-firmware/baklava-manifest/-/packages), extract it and serve it over http: ```shell tar tf torizon-docker-verdin-imx8mp-Tezi.tar cd torizon-docker-verdin-imx8mp-Tezi_1.0/ sudo python -m http.server 80 ``` You can now check the http service works well with: ```shell curl -o /dev/null http://laa-tezi.local/torizon-docker-verdin-imx8mp.ota.tar.zst ``` ### LAA flashing You can now power-on the LAA. The factory validation OS will boot, detect the presence of the laa-tezi.local http server and start the flashing process. During flashing, the OLED display will show progress of the process. At the end of the flashing, the LAA will reboot to the prodution OS, ready to be [registered](registration.md). ## Reflashing from scratch ```{admonition} Reflashing :class: note If for some reason, flashing from network is impossible, you can reflash the LAA from scratch. ``` ### LAA SDCard In order to reflash the LAA, a specific SDCard should be created with the [disk image](https://gitlab.com/api/v4/projects/43713736/packages/generic/firmware/v1.0/torizon-docker-verdin-imx8mp-Tezi.tar) ```{admonition} SDCard size" :class: warning The SDCard should be larger than 1GB. ``` :::{admonition} Partition :class: tip If the SDCard is available at `/dev/sdb`, you can automatically create the partition with `fdisk`: ``` shell echo "n\n\n\n\n\nw\n" | sudo fdisk /dev/sdb ``` ::: Extract the content of the tar archive into the SDCard partition. ```shell wget https://gitlab.com/api/v4/projects/43713736/packages/generic/firmware/v1.0/torizon-docker-verdin-imx8mp-Tezi.tar mount /dev/sdb1 /media/data tar xf torizon-docker-verdin-imx8mp-Tezi.tar --strip-components=1 -C /media/data umount /media/data ``` ### Reflashing software Download the [recovery software](https://gitlab.com/api/v4/projects/43713736/packages/generic/tezi/7.1.0-devel-202412+build.3/tezi.zip) and extract it. ```shell wget https://gitlab.com/api/v4/projects/43713736/packages/generic/tezi/7.1.0-devel-202412+build.3/tezi.zip unzip tezi.zip ``` ### Recovery To reflash the LAA you should: * connect LAA `USB OTG` port to USB port * Insert the SDCard on the LAA * Enter recovery: hold down `flash recovery`, reset the board and release the button after 2s. * Load recovery software into memory ```shell cd Verdin-iMX8MP_ToradexEasyInstaller_7.1.0-devel-202412+build.3/ ./recovery-linux.sh ``` The recovery software will boot, flash the LAA OS on the NVMe and reboot. You can see the progress by connecting to the serial: * connect the LAA `Con` port to a USB port * launch `sudo tio /dev/ttyUSB0`