Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A64 => Topic started by: tbultel on March 01, 2020, 11:11:21 PM

Title: emmc issue
Post by: tbultel on March 01, 2020, 11:11:21 PM
With my A64, I am facing this issue when performing write operations to the
mmcblk2p1 partition:

[  342.101294] sunxi-mmc 1c11000.mmc: data error, sending stop command
[  343.099726] sunxi-mmc 1c11000.mmc: send stop command failed

Looking on the web, this seems to be a known issue with the A20, but
apparently A64 is affected as well.
That makes my 16G mmc unusable.
Title: Re: emmc issue
Post by: JohnS on March 01, 2020, 11:36:54 PM
A software issue - yes?

The hardware "just works" - also yes?

John
Title: Re: emmc issue
Post by: tbultel on March 02, 2020, 10:03:42 AM
The history of such a message on the other existing boards deal with a hardware issue, related to a capacitor.
When this happens, the console is frozen (CTRL-C does not work), and the mmc cannot
be accessed any longer
Title: Re: emmc issue
Post by: LubOlimex on March 02, 2020, 11:11:41 AM
Try to disable HS200 mode of operation for the eMMC. This might be done via overlay I think. Try to remove the following line from the dtb:

mmc-hs200-1_8v;

Edit: Without testing (paths need checking), it can be done with something like

dtc -I dtb -O dts -o 1.tmp /boot/dtb/sun50i-a64-olinuxino-emmc.dtb
sed -i '/mmc-hs200/d' 1.tmp
dtc -I dts -O dtb -o /boot/dtb/sun50i-a64-olinuxino-emmc.dtb 1.tmp
Title: Re: emmc issue
Post by: JohnS on March 02, 2020, 11:13:25 AM
Quote from: tbultel on March 02, 2020, 10:03:42 AMThe history of such a message on the other existing boards deal with a hardware issue, related to a capacitor.
When this happens, the console is frozen (CTRL-C does not work), and the mmc cannot
be accessed any longer
You may need to post URLs as the ones I found were all software issues.

John
Title: Re: emmc issue
Post by: tbultel on March 03, 2020, 10:48:23 PM
Quote from: LubOlimex on March 02, 2020, 11:11:41 AMTry to disable HS200 mode of operation for the eMMC. This might be done via overlay I think. Try to remove the following line from the dtb:

mmc-hs200-1_8v;

Edit: Without testing (paths need checking), it can be done with something like

dtc -I dtb -O dts -o 1.tmp /boot/dtb/sun50i-a64-olinuxino-emmc.dtb
sed -i '/mmc-hs200/d' 1.tmp
dtc -I dts -O dtb -o /boot/dtb/sun50i-a64-olinuxino-emmc.dtb 1.tmp

Thanks, this seems to work, in my case I had to modify sun50i-a64-olinuxino-1Ge16GW.dtb

But that workaround has an impact on performances, right ?
Title: Re: emmc issue
Post by: LubOlimex on March 04, 2020, 08:30:32 AM
Yes, the data access rate to the eMMC would be slower but not much can be done until the HS200 driver gets improved.
Title: Re: emmc issue
Post by: LubOlimex on March 12, 2020, 02:51:26 PM
What image are you using OP? How do you test the eMMC write?

My tests with A64-OLinuXino-1Ge16GW don't show any problems with the eMMC. I use this image: ftp://staging.olimex.com/Allwinner_Images/a64-olinuxino/linux/1.latest_images/bionic/images/Armbian_5.92.1_Olinuxino-a64_Ubuntu_bionic_next_5.2.5_desktop.7z

I ran nand-sata-install script on multiple boards but no such problem appeared. Can you try the same image and script as me?
Title: Re: emmc issue
Post by: tbultel on March 17, 2020, 10:44:01 AM
Hi,
I am using exactly the same version as yours.
The nand-sata-script hangs after 10% complete and the kernel log shows the same error
message as in my test.

My eMMC write was simply done as such:

mkfs.ext4 /dev/mmcblk2p1
mount /dev/mmcblk2p1 /mnt

and then copy a big file to /mnt

Best regards
Title: Re: emmc issue
Post by: LubOlimex on March 27, 2020, 09:33:03 AM
There is a problem in the configuration for the 16GB version of the A64 board, the eMMC is set to a high speed mode that causes the instabilities. The fix is to set the eMMC to DDR52 mode (as opposed to HS-200). Do the following

1. Power up the board

2. Log in with root account or use sudo

3. Decompile the .dtb: /boot/dtb/allwinner/sun50i-a64-olinuxino-1Ge16GW.dtb

dtc -I dtb -O dts /boot/dtb/allwinner/sun50i-a64-olinuxino-1Ge16GW.dtb -o 1.dts
4. Now you have created 1.dts file in your current directory

5. Open the file with nano text editor:

nano ./1.dts
6. Go down to the block containing:

mmc@1c11000{


}

HINT: You can press Ctrl+W (search) and type "mmc@1c11000"

7. Go to the line containing:

mmc-hs200-1_8v;
and replace it with:

mmc-ddr-1_8v;
8. Press Ctrl+A Ctrl+Q to exit nano and then press Y to save the changes you made

9. Compile the updated dts file:

dtc -I dts -O dtb ./1.dts -o /boot/dtb/allwinner/sun50i-a64-olinuxino-1Ge16GW.dtb
or if you are not logged as root:

sudo dtc -I dts -O dtb ./1.dts -o /boot/dtb/allwinner/sun50i-a64-olinuxino-1Ge16GW.dtb
10. Reboot