How to set IMx8 to boot OS from MSATA SSD or 4Bit SD slot?

Hello, how to configure the boot device of the Apalis IMX8 to boot OS from other device like MSATA SSD or the 4bit SD card?
Thank you.

What exact hardware (module and carrier board) and software versions of things are you talking about?

Hello,
Hardware: IMX8QM APALIS,
Software: Last Bring Up image downloaded yesterday from your guide.
We are using a custom carrier board but connecting to the serial port we see the boot messages like : “cannot load DT”
Same thing happen if we put an empty-formatted uSD.
How can we select the boot device, like MSATA SSD?
thank you

Hello, Hardware: IMX8QM APALIS,

So far there are Apalis iMX8QM V1.0A or V1.0B. So which one exactly?

https://developer.toradex.com/products/apalis-som-family/modules/apalis-imx8#revision-history

Software: Last Bring Up image downloaded yesterday from your guide.

Which guide exactly? Please be more specific.

We are using a custom carrier board but connecting to the serial port we see the boot messages like : “cannot load DT”

Please attach full serial debug console output as a textual file.

Same thing happen if we put an empty-formatted uSD.

That sounds wired but really depends on the exact hardware revision.

How can we select the boot device, like MSATA SSD? thank you

No such selection is possible. V1.0A early access samples exclusively boot from SD card while V1.0B and later boot from on-module eMMC. Of course, once the boot loader started you may load any further parts like device tree, Linux kernel and/or root file system from pretty much anywhere else. However, I don’t think current U-Boot supports loading anything from mSATA.

Ok, we finally loaded the OS from the internal eMMC!
Now I have another question:
In the U-boot configuration, we changed some variables with setenv but we cannot do a saveenv because it returns “failed” how can we do that?
Thank you

If you are still talking about V1.0A, the U-Boot environment would still live on the SD card. Again, if you expect us to help you we would really need full serial debug console output attached as a textual log file. Otherwise, I can only hypothesise that you may have a faulty SD card.