Installing Linux Images to Flash |
It should be noted that all STM32F7 SOMs come with a default Linux image preloaded to the Flash. This is the same networking.uImage that is included in the Emcraft software distribution (refer to STM32F7 System-On-Module Release Materials). Clearly, as you proceed to develop your Linux applications against your specific requirements, you will need a way to install an updated Linux image to the target for deployment. This note explains how to do that. The example below refers to networking.uImage. This image is included as a prebuilt binary in the software distribution so you can always use it to revert to the factory default software, should you decide to do that for some reason. For instance, you may want to do that in order to validate an I/O interface supported by the networking project. As mentioned above though, the process below will work for any uImage you build using the Emcraft software distribution. Before you proceed to install an uImage to the NOR Flash, it probably makes sense to verify that what you have is indeed a bootable Linux image. You can do that by loading the image to the target from the network using the run netboot command (refer to Loading Linux Images via Ethernet and TFTP). It is important to understand that the same uImage that you load via TFTP can be loaded from the Flash as well. It doesn't make sense to install an uImage to the Flash unless you have validated the image by loading it via Ethernet and TFTP. The U-Boot command sequence required to install a uImage to the NOR Flash is defined for you by the U-Boot environment variable called update. Here is how update is defined in U-Boot by default: STM32F7-SOM> print update You will notice that the first command in update is a tftpboot command to download an image from the network via Ethernet and TFTP. Please refer to Loading Linux Images via Ethernet and TFTP for detailed information on how to set up your target and the development host for loading images from TFTP. Following tftp, there is a sequence of commands that erase those Flash sections where the Linux image will be installed to and then copy the image to the Flash. Here is a snapshot showing how update is used to install networking.uImage to the Flash: STM32F7-SOM> setenv image vlad/networking.uImage Having installed an image to the Flash, just hit the Reset button on the baseboard to boot the newly installed image from Flash: U-Boot 2010.03-linux-cortexm-1.13.0 (Feb 17 2015 - 13:58:38) On deployed units, you will probably want to optimize the boot time by setting the U-Boot bootdelay variable to 0. Please refer to Running U-Boot for detailed information on how to do that.
|