Jump to content
Hashimoto Kenichi

eMMC writing in u-boot

Recommended Posts

The following settings were made to save the u-boot env to eMMC.

U-Boot 2022.01
CONFIG_ENV_IS_IN_MMC=y
CONFIG_SYS_MMC_ENV_DEV=0
CONFIG_SYS_MMC_ENV_PART=0

The write operation succeeds once, but then the eMMC stops responding.
Writing by ums is also successful, so writing itself seems to be OK, but there seems to be a problem in the subsequent operation.

What are the problems with writing to eMMC?

 

Edited by Hashimoto Kenichi

Share this post


Link to post
Share on other sites
=> mmc dev 0
CMD_SEND:0
                ARG                      0x00000000
                MMC_RSP_NONE
CMD_SEND:8
                ARG                      0x000000aa
                RET                      -110
CMD_SEND:55
                ARG                      0x00000000
                RET                      -110
CMD_SEND:0
                ARG                      0x00000000
                MMC_RSP_NONE
CMD_SEND:8
                ARG                      0x000000aa
                RET                      -110
CMD_SEND:55
                ARG                      0x00000000
                RET                      -110
CMD_SEND:0
                ARG                      0x00000000
                MMC_RSP_NONE
CMD_SEND:1
                ARG                      0x00000000
                MMC_RSP_R3,4             0xffffffff
CMD_SEND:2
                ARG                      0x00000000
                RET                      -110
CMD_SEND:2
                ARG                      0x00000000
                RET                      -110
CMD_SEND:2
                ARG                      0x00000000
                RET                      -110
CMD_SEND:2
                ARG                      0x00000000
                RET                      -110
CMD_SEND:2
                ARG                      0x00000000
                RET                      -110

Enable CONFIG_MMC_TRACE

Share this post


Link to post
Share on other sites

hello @Hashimoto Kenichi

1. are you using tinker os?

On 6/5/2023 at 1:20 PM, Hashimoto Kenichi said:

but there seems to be a problem in the subsequent operation.

What are the problems with writing to eMMC?

2. what's the error you encountered?

to write in uboot:

1. connect tinker board 2s to an ubuntu machine (tinker board 2s should be in ums mode while connecting)

2. press any key during booting to enter u-boot

3. here's an example using setenv/ printenv, and then savenv

uboot-1.png

4. saveenv and reboot, printenv test and it returns the right value

uboot-2.png

Share this post


Link to post
Share on other sites

1. are you using tinker os?
No.
I am using Yocto (kirkstone) with patches.
u-boot version is 2022.01.

2. what's the error you encountered?
The second "mmc dev 0" execution results in an error.
Writing to eMMC, such as saveenv, succeeds, but distro_bootcmd executes "mmc dev 0", so it fails there.

Share this post


Link to post
Share on other sites

@Hashimoto Kenichi

one possible reason might be broken emmc, but we'll need more information to confirm if it's the cause

1, what are the results of:

printenv devnum

and

printenv devtype

?

2. where was the uboot flashed onto? (such as emmc/ sd card/ other storage ... etc)

3. is there any other storage (such as sd card/ usb flash storage ... etc) attached to tinker board 2s?

Share this post


Link to post
Share on other sites

1. what are the results of:
devnum and devtype is not set.
Because I use distro_bootcmd.

2. where was the uboot flashed onto?
eMMC

3. is there any other storage (such as sd card/ usb flash storage ... etc) attached to tinker board 2s?
SD card is removed.

Share this post


Link to post
Share on other sites

hello @Hashimoto Kenichi

devnum and devtype are set by default if you're using tinker os, may i know what's the source code you're using for compiling os/ uboot, so we can have a look at the configs?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...