12ac07f75SDavid LechnerSummary 22ac07f75SDavid Lechner======= 32ac07f75SDavid Lechner 42ac07f75SDavid LechnerLEGO MINDSTORMS EV3 is a toy robot produced by the LEGO Group. It is based 52ac07f75SDavid Lechneron the davinci da850 evm. The EV3 has a 16MB spi flash and a SDHC microSD card 62ac07f75SDavid Lechnerreader. 72ac07f75SDavid Lechner 82ac07f75SDavid LechnerBooting 92ac07f75SDavid Lechner======= 102ac07f75SDavid Lechner 112ac07f75SDavid LechnerThe EV3 contains a bootloader in EEPROM that loads u-boot.bin from address 0x0 12*f203a479SDavid Lechnerof the SPI flash memory (with a size of 256KiB!). Because the EEPROM is read- 13*f203a479SDavid Lechneronly and it takes care of low level configuration (PLL and DDR), we don't use 14*f203a479SDavid LechnerU-Boot to produce an SPL image. 15*f203a479SDavid Lechner 16*f203a479SDavid LechnerUsing the default configuration, U-Boot had a boot scrips that works as follows: 17*f203a479SDavid Lechner 18*f203a479SDavid Lechner* Check to see if microSD card is present 19*f203a479SDavid Lechner* If it is, try to load boot.scr from the first FAT partition 20*f203a479SDavid Lechner* If loading boot.scr was successful, run it 21*f203a479SDavid Lechner* Otherwise, try loading uEnv.txt 22*f203a479SDavid Lechner* If loading uEnv.txt was successful, import it 23*f203a479SDavid Lechner* If there is a uenvcmd variable (from uEnv.txt), run it 24*f203a479SDavid Lechner* Try to load uImage from the first FAT partition 25*f203a479SDavid Lechner* If it was successful, try to load da850-lego-ev3.dtb 26*f203a479SDavid Lechner* If loading uImage was successful, boot it (DT is optional) 27*f203a479SDavid Lechner* If none of the above was successful, try booting from flash 28*f203a479SDavid Lechner 29*f203a479SDavid LechnerSuggested Flash Memory Layout 30*f203a479SDavid Lechner============================= 31*f203a479SDavid Lechner 32*f203a479SDavid LechnerThe following is based on the default U-Boot configuration: 33*f203a479SDavid Lechner 34*f203a479SDavid Lechner| Image (file) | Start Addr. | Max. Size | 35*f203a479SDavid Lechner+--------------------+-------------+-------------------+ 36*f203a479SDavid Lechner| u-boot.bin | 0x0 | 0x40000 (256KiB) | 37*f203a479SDavid Lechner| da850-lego-ev3.dtb | 0x40000 | 0x10000 (64KiB) | 38*f203a479SDavid Lechner| uImage | 0x50000 | 0x400000 (4MiB) | 39*f203a479SDavid Lechner| rootfs (squashfs) | 0x450000 | 0xa00000 (10MiB) | 402ac07f75SDavid Lechner 412ac07f75SDavid LechnerWriting image to flash 422ac07f75SDavid Lechner====================== 432ac07f75SDavid Lechner 442ac07f75SDavid LechnerThe EEPROM contains a program for uploading an image file to the flash memory. 452ac07f75SDavid LechnerThe program is started by holding down the right button on the EV3 when powering 462ac07f75SDavid Lechnerit on. You can also `run fwupdateboot` in the u-boot shell to reboot into this 472ac07f75SDavid Lechnermode. The image can then be uploaded using the official LEGO MINDSTORMS EV3 482ac07f75SDavid Lechnersoftware or a 3rd party program capable of uploading a firmware file. 492ac07f75SDavid Lechner 502ac07f75SDavid LechnerIf you are booting from the microSD card, it is enough to just write uboot.bin 512ac07f75SDavid Lechnerto the flash. If you are not using a microSD card, you will need to create an 522ac07f75SDavid Lechnerimage file using the layout described above. 53