nfstoney
Posts: 23
Joined: Fri Jul 21, 2017 2:04 pm

uSDCard can't mount after Boot Raspi over USB

Thu Dec 14, 2017 4:14 pm

Hello,
I boot up my CM3L-Module in the IO Board over an image on USB.

After booting the uSDCard don't mount and I can't use as mass storage.

In the manual for CM3L there is a hint to this issue:
Note that once booted over USB, BCM2837 needs to re-enable the SD/eMMC device (by releasing
EMMC DISABLE N) to allow access to it as mass storage. It expects to be able to do this by driving
theEMMC EN N 1V8pinLOW,whichatbootisinitiallyaninputwithapullupto1V8. Ifanenduser
wishes to add the ability to access the SD/eMMC over USB in their product, similar circuitry to that
used on the Compute Module IO Board to enable/disable the USB boot and SD/eMMC must be used;
thatis,EMMC DISABLE NpulledlowviaMOSFET(s)andreleasedagainbyMOSFET,withthegate
controlled by EMMC EN N 1V8. Ensure you use MOSFETs suitable for switching at 1.8V (i.e. use a
device with gate threshold voltage, Vt, suitable for 1.8V switching).
I don't know how to control the pin EMMC_EN_N_1V8. In another thread of this forum I read about the function raspi-gpio to control the gpio 47 (EMMC_EN_N_1V8). But this doesn't work.

How can I use the uSDCard if I boot my raspi from USB?

Thanks for your help.
--
stoney
Raspberry PI Compute Module 3 light, Raspian

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5064
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: uSDCard can't mount after Boot Raspi over USB

Thu Dec 14, 2017 4:24 pm

https://github.com/raspberrypi/linux/issues/2221 may be relevant.
Try adding "dtparam=act_led_trigger=none" to config.txt.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

nfstoney
Posts: 23
Joined: Fri Jul 21, 2017 2:04 pm

Re: uSDCard can't mount after Boot Raspi over USB

Thu Dec 14, 2017 5:14 pm

Many thanks for your answer,

after adding "dtparam=act_led_trigger=none" to config.txt
The GPIO47 is driven high.

Your link don't give more information to solve the problem.

I need some commands to control the gpio47 (set high/set low) while the system is running.
--
stoney
Raspberry PI Compute Module 3 light, Raspian

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1677
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: uSDCard can't mount after Boot Raspi over USB

Fri Dec 15, 2017 10:57 am

You can use the GPIO sysfs interface , or the relatively new IOCTL API (examples here: https://github.com/torvalds/linux/tree/ ... tools/gpio).

If you want existing command line utilities you can script there are currently raspi-gpio, wiringpi, pigpio etc.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5064
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: uSDCard can't mount after Boot Raspi over USB

Fri Dec 15, 2017 11:16 am

Firstly do not touch GPIO47 on a CM3L. Refer to the schematics.
Whilst on the CM1 GPIO47 is used for EMMC_EN_N_1V8 (as shown in Figure 1 of the datasheet), on CM3/CM3L a GPIO off an expander is used (as shown in Figure 2). GPIO47 is used for other purposes and messing with it will cause issues.

Secondly AFAIK the onboard SD card setup has no hotplug support, therefore if EMMC_EN_N_1V8 is in the correct state at boot then the kernel should find the SD card and create /dev/sda. I couldn't say for definite if there is a way to retrigger a scan of the bus.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

nfstoney
Posts: 23
Joined: Fri Jul 21, 2017 2:04 pm

Re: uSDCard can't mount after Boot Raspi over USB

Fri Dec 15, 2017 1:06 pm

Firstly do not touch GPIO47 on a CM3L. Refer to the schematics.
Whilst on the CM1 GPIO47 is used for EMMC_EN_N_1V8 (as shown in Figure 1 of the datasheet), on CM3/CM3L a GPIO off an expander is used (as shown in Figure 2). GPIO47 is used for other purposes and messing with it will cause issues.
You're right, I shouldn't touch this pin. At the time if I could control this pin it's to late anyway.
Secondly AFAIK the onboard SD card setup has no hotplug support, therefore if EMMC_EN_N_1V8 is in the correct state at boot then the kernel should find the SD card and create /dev/sda. I couldn't say for definite if there is a way to retrigger a scan of the bus.
The EMMC_EN_N_1V8 has at boot not the correct timing. The EMMC_EN_N_1V8 comes to late to low. The timing while bootup is incorrect.
First the EMMC_EN_N_1V8 should be high to boot from USB. Then the EMMC_EN_N_1V8 should be set to low before the scan of the SD Card starts. But in real the EMMC_EN_N_1V8 set to low after the scan of SD card. So the Pi boots from USB and can't see the SD Card.
--
stoney
Raspberry PI Compute Module 3 light, Raspian

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5064
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: uSDCard can't mount after Boot Raspi over USB

Fri Dec 15, 2017 1:49 pm

nfstoney wrote:
Fri Dec 15, 2017 1:06 pm
Secondly AFAIK the onboard SD card setup has no hotplug support, therefore if EMMC_EN_N_1V8 is in the correct state at boot then the kernel should find the SD card and create /dev/sda. I couldn't say for definite if there is a way to retrigger a scan of the bus.
The EMMC_EN_N_1V8 has at boot not the correct timing. The EMMC_EN_N_1V8 comes to late to low. The timing while bootup is incorrect.
First the EMMC_EN_N_1V8 should be high to boot from USB. Then the EMMC_EN_N_1V8 should be set to low before the scan of the SD Card starts. But in real the EMMC_EN_N_1V8 set to low after the scan of SD card. So the Pi boots from USB and can't see the SD Card.
I'm assuming you're McLion-Himself on github then. I'll stick with this thread to avoid repeating stuff twice.

I don't have a simple setup that can replicate this at the moment. I don't know if Phil has.

My thinking is that for boot mode detection it only matters during the bootrom and bootcode.bin phase. It's start(_x).elf that processes dt-blob.bin, so you may be able to set up dt-blob.bin to set pin 129 as

Code: Select all

pin@p129 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "active" }; // EMMC_ENABLE_N
so that start.elf will kick it before the kernel starts. You may need to remove the activitiy led section from the kernel device tree to ensure that it doesn't fiddle with it whilst the EMMC is mounted, and that's what the github issue is talking about.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

nfstoney
Posts: 23
Joined: Fri Jul 21, 2017 2:04 pm

Re: uSDCard can't mount after Boot Raspi over USB

Fri Dec 15, 2017 3:33 pm

You did it!

Add the startup_state = "active" to the pin 129 and remove the activitiy led section from the kernel device tree let the SDCard be mount after bootup from USB.

Many thanks for your help.
--
stoney
Raspberry PI Compute Module 3 light, Raspian

McLion
Posts: 60
Joined: Fri Mar 17, 2017 1:05 pm
Location: Switzerland

Re: uSDCard can't mount after Boot Raspi over USB

Fri Dec 15, 2017 3:39 pm

6by9 wrote:
Fri Dec 15, 2017 1:49 pm

I'm assuming you're McLion-Himself on github then. I'll stick with this thread to avoid repeating stuff twice.
To shed some light ... we are actually not the same but we know each other ;)
Your solution works a treat :D

Return to “Compute Module”

Who is online

Users browsing this forum: No registered users and 2 guests