STMP157-OLinuXino-LIME2 - boot from eMMC

Started by jideel, July 18, 2024, 01:58:26 PM

Previous topic - Next topic

jideel

Hello,
Here's my configuration:
- STMP157-OLinuXino-LIME2H-EXT (https://www.olimex.com/Products/OLinuXino/STMP1/STMP157-OLinuXino-LIME2/open-source-hardware)
- Flash-e32Gs16M (https://www.olimex.com/Products/OLinuXino/Accessories/Flash-e32Gs16M/)
- MOD-WIFI-RTL8188EUS-ANT (https://www.olimex.com/Products/USB-Modules/MOD-WIFI-RTL8188EUS/)
- HDMI screen, usb keyboard, USB-to-serial.

Boot with an SD card is OK.
Connection to the serial port is OK.
HDMI overlay is OK.

I'm now trying to boot from the eMMC (Flash-e32Gs16M).
I used the olinuxino-sd-to-emmc script, no obvious issue, seems to complete well.
Before running the script, I've "apt update/upgrade"
I've read
- the documentations related to the board itself and to the Olimage linux image
- this article https://olimex.wordpress.com/2024/04/19/installing-linux-on-the-external-flash-modules-for-stmp157-base-som-evb/

If i start the board without an SD card inside, nothing happens.
No serial terminal and no HDMI (expected).
At the beginning I used a 64GB SD card so I thought the issue could be that the SD card is bigger than the eMMC, so I also tried with an 32GB and finally with a 2GB SD card, it does not help.
If I stop the boot sequence and enter u-boot, the eMMC boot well with "setenv mmc_bootdev 1" and "run bootcmd". Unfortunately saveenv, well, seems to save somewhere but not where it could be useful as this setting does not persists across reboots.

Based on the wordpress article, I understand it's required to sold/unsold the jumpers to configure the boot sequence, is it really necessary ?


As I didn't wanted to go this way, I managed to find this workaround:
Let the bootloader on the SD card, with nothing else, add 'setenv mmc_bootdev "1"' to the /boot/boot.cmd file and recompile this file with mkimage.
So it's kinda chainloaded, let's say.
The board boots with the minimal bootloader on the SD card and then u-boot switches to the internal eMMC.
The SD card can be mounted from Linux and used as some additional storage.
Obviously an SD card is still needed, but at least Linux boots from the eMMC, no soldering is required and the then-added storage can be much bigger than 32GB.
I had to put the HDMI dtbo on the SD card to keep the HDMI overlay loading, however.

It's a rather dirty trick, would you have a smarter/cleaner solution (not involving a soldering device if possible) ?

LubOlimex

Yeah it is nice software trick but you have to use the SMT jumpers. Basically boot from SD is the default position of the jumper (1-0-1). Boot from eMMC requires changing the state of all three jumpers to 0-1-0, as shown in the table. If you are in RD phase and have to change position often maybe separate all jumpers (0-0-0) and solder switches to the pads so you can easily test different modes.

In STMP157-BASE-SOM we've placed a switch for the boot modes (instead of SMT jumpers): https://www.olimex.com/Products/SOM/STMP1/STMP157-BASE-SOM-EVB/open-source-hardware
Technical support and documentation manager at Olimex