Using SDP together with UMS to bootstrap an i.MX 8M Mini?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using SDP together with UMS to bootstrap an i.MX 8M Mini?

1,571 Views
akoch
Contributor II

We're currently in the design phase of a device that aims to use an i.MX 8M Mini as SoC and an eMMC for storage.

For getting content to the eMMC during manufacturing, we would like to load U-Boot via serial download over USB and then instruct it to make the eMMC available to a host PC via USB Mass Storage protocol (UMS). The host PC would then write an image. This way we would not need to have the eMMC be provisioned with an initial bootloader so it can come empty into manufacturing.

Using the 8M Mini LPD4 EVK board I have tried to assemble a technical proof-of-concept for this bootstrapping process but unfortunately I'm stuck with a CPU reset; let me explain.

With the board set to boot from eMMC I can run U-Boot and use

u-boot=> ums 0 mmc 2

 to export it as USB mass storage device. It is recognized by the host PC so that's working fine so far.

What also works is setting the board into Serial Download mode and loading U-Boot via SDP using uuu.

 

What does not seem to work is the combination of both. So if I try to provision the UMS command inside the uuu script

 

uuu_version 1.2.39

SDP: boot -f imx-boot-imx8mmevk-sd.bin-flash_evk
SDPS: boot -f imx-boot-imx8mmevk-sd.bin-flash_evk
SDPU: delay 1000
SDPU: write -f imx-boot-imx8mmevk-sd.bin-flash_evk -offset 0x57c00
SDPU: jump
SDPV: delay 1000
SDPV: write -f imx-boot-imx8mmevk-sd.bin-flash_evk -skipspl
SDPV: jump

FB: ucmd mmc dev 2
FB: ucmd ums 0 mmc 2

 

 

I see my commands are executed but the UMS command (which used to work previously) now fails:

Run fastboot ...
switch to partitions #0, OK
mmc2(part 0) is current device
Detect USB boot. Will enter fastboot mode!
starting USB mass storage mode
Detect USB boot. Will enter fastboot mode!
UMS: LUN 0, dev mmc 2, hwpart 0, sector 0x0, count 0x3a3e000
g_dnl_register: failed!, error: -22
g_dnl_register failed
"Synchronous Abort" handler, esr 0x02000000
elr: ffffffff83508aac lr : ffffffff83508000 (reloc)
elr: 0000000000000aac lr : 0000000000000000
x0 : 0000000000000000 x1 : 0000000000000000
x2 : 0000000000000000 x3 : 0000000000000000
x4 : 0000000000000000 x5 : 0000000000000000
x6 : 0000000000000000 x7 : 0000000000000000
x8 : 0000000000000000 x9 : 0000000000000000
x10: 0000000000000000 x11: 0000000000000000
x12: 0000000000000000 x13: 0000000000000000
x14: 0000000000000000 x15: 0000000000000000
x16: 0000000000000000 x17: 0000000000000000
x18: 0000000000000000 x19: 0000000000000000
x20: 0000000000000000 x21: 0000000000000000
x22: 0000000000000000 x23: 0000000000000000
x24: 0000000000000000 x25: 0000000000000000
x26: 0000000000000000 x27: 0000000000000000
x28: 0000000000000000 x29: 0000000000000000

Code: d50344ff d2800008 d50343df 58000100 (d51ec000)
Resetting CPU ...

 (full log see attached)

I've been digging through U-Boot sources trying to understand what error -22 from g_dnl_register() means but unfortunately found no answer.

So I'm wondering: is it even possible to use UMS mode in combination with an U-Boot instance loaded via Serial Download or is there something that causes some kind of incompatibility between the two?

 

I know we could use uuu to write the image to the eMMC directly without going into UMS mode. But we would like to see the eMMC as USB mass storage, that's easier for the rest of our tooling.

Thanks in advance for any help!

Labels (1)
Tags (4)
0 Kudos
Reply
2 Replies

1,557 Views
josephzhou1
Contributor V

shld be cnt ! otherwise  u do urself  uuu and u-boot.

Best Regards,
Joseph Zhou Jianhui / Senior Embedded Software Engineer, Singapore
0 Kudos
Reply

1,532 Views
akoch
Contributor II

Hi Joseph,

thank you very much for your answer.

I'm sorry but could you please explain what you mean by "shld be cnt"?

 

Best regards,

Alex

0 Kudos
Reply