====== Deployment Yocto ====== ===== Images Yocto ===== - All images are intended for the usage on a @stk_name@ - The symlinks point to the files of the last build {{section>.:..:..:data#images_yocto&noheader}} ---- ===== Create SD Card with BSP Image ===== Use an SD card to install a new firmware. \\ The following commands write the image from the host system to the SD card: $ cd /platform-/images $ sudo dd if=@bsp_image_name@-.rootfs.wic of=/dev/sdc bs=1M conv=fsync #Assuming the SD card is assigned to /dev/sdc The image must be written to the RAW device of the SD Card (e.g. /dev/sdc) and not into a partition (e.g. /dev/sdc1) ! To identify the SD card in Linux the shell command dmesg can be used: - Open a new terminal - Execute the following command without plugged SD Card\\ $ dmesg | tail -n 15 - Insert SD Card and wait a few seconds - Run the command from step two again $ dmesg | tail -n 15 #plug in SD Card into the reader $ dmesg | tail -n 15 \\ \\ ---- ===== Updating existing firmware over ethernet ===== \\ One approach to update the firmare components U-Boot,Linux kernel and devicetree in a running system it to load them from a tftp server in U-Boot. \\ This process requires a running TFTP server in your network, please see the following page [[en:general_information:tftp|how to setup TFTP Server]]. After setting up the TFTP server, the binaries to be updated must be copied into the TFTP directory. ==== Update Process ==== 1. Setup the Starterkit to boot from eMMC or SD 2. Connect the kit to the network with TFTP server supplying the binaries via ethernet on connector@eth_prime@ \\ 3. Power up the system and interrupt the boot process in U-Boot\\ Hit any key to stop autoboot: 0 => 3. Setup the ethernet interface: ++++ Set network settings manually | Provide the correct network configuration in U-Boot: * => setenv autoload no * => setenv serverip (IP address of your TFTP server e.g.: setenv serverip 192.168.100.110) * => setenv ipaddr (e.g.: setenv ipaddr 192.168.100.111) * => setenv netmask (e.g.: setenv netmask 255.255.255.0) ++++ ++++ Set network settings using DHCP | If a DHCP server is available in the network, the interface can be configured by the server: * => setenv autoload no * => setenv serverip (IP address of your TFTP server e.g.: setenv serverip 192.168.100.110) * => dhcp (get IP from server) ++++ \\ 4. Set U-Boot variable **mmcdev** according to the drive you want to write to. => setenv mmcdev {{section>.:..:..:data#device_assignment&noheader}} 5. Set the file name of the binary to update in U-Boot : * For U-Boot update: => setenv uboot \\ e.g. //setenv uboot @uboot_default@// \\ * For devicetree update: => setenv fdt_file \\ e.g. //setenv fdt_file @fdt_default@// \\ * For Linux kernel update: => setenv image \\ e.g. //setenv image @kernel_default@// \\ The binaries (U-Boot, devicetree, Linux kernel) that are generated when building the the BSP are listed in section **[[en: @mod_arch@:@mod_name@:@bsp_name@:@build_system@:deployment_yocto#images_yocto|Images Yocto]]**. \\ \\ 6. Perform Update by running the update command: * U-Boot update: => run update_uboot \\ * Device Tree update:=> run update_fdt\\ * Kernel update:=> run update_kernel\\ The U-Boot environment variables can be saved with the command **saveenv** to keep the values permanently. ---- ===== Copy Firmware from SD card to eMMC using U-Boot ===== * Write Image to SD card (use dd command under linux or Win32diskImager under Windows) * Set Starterkit to boot from SD, please see [[en:arm:@mod_name_code@:@mb_name_code@:dip_switches|DIP Switch Settings]] * Interrupt the boot process to get to the U-Boot prompt * Use the following commands to copy the SD card to eMMMC {{section>.:..:..:data#yocto_specific_command_update_emmc&noheader}} \\ 2. Save the U-Boot environment vari with the saveenv command (optional): => saveenv \\ 3. run the following command to start the update procedure: => run install_firmware ---- ===== Using NFS boot ===== === Prerequisites === * [[en:nfs|How to setup the NFS Server on your Host Computer]] * [[en:tftp|How to setup the TFTP Server on your Host Computer]] To boot the @mod_name@ from network you need a working bootloader in eMMC/SD-card or SPI-NOR (placement option on @mod_name@ ) which is able to get the kernel image over tftp and to provide the kernel with commandline settings for NFS. The dtb-file and kernel image have to be provided via tftp and the rootfs via nfs. === Configuration of U-Boot Environment === The bootloader environment needs to be modified to work with your tftp-server and your nfs-server.\\ \\ 1. Prepare network interface: ++++ Set network settings manually | Provide the correct network configuration in U-Boot: * => setenv autoload no * => setenv serverip (e.g.: setenv serverip 192.168.100.110) * => setenv ipaddr (e.g.: setenv ipaddr 192.168.100.111) * => setenv netmask (e.g.: setenv netmask 255.255.255.0) ++++ ++++ Set network settings using DHCP | If a DHCP server is available in the network, the interface can be configured by the server: * => setenv autoload no * => setenv serverip (e.g.: setenv serverip 192.168.100.110) * => dhcp (get IP from server) ++++ 2. set the Uboot variables for TFTP and NFS: * setenv rootpath (NFS directory has to set in /etc/exports on the Computer that runs the NFS server first) * setenv fdt_file (name of devicetree file to be downloaded from the tftp server) * setenv image (name of the Linux kernel image to be downloaded from the tftp server) 3. Run the uboot script to boot from nfs: {{section>.:..:..:data##uboot_command_to_start_netboot&noheader}}