Can not write new partition to eMMC


1 1

Recommended Posts

Hello Everybody:


I'm having problems to create and save a new partition to eMMC on BPI M2Ultra board.


As you can see on the attachd image below, the fdisk -l command, list the mmcblk1 with the right size (7.3 GB), them, i start creating a new partition (n command) and writing the partition table (w command), but once created the new partition never gets to the disk, and a new fdisk -l command shows the disk like it was before. Of course, whithout a partition i can not format the eMMC and can not use nand-sata-install.


This doesn't happen with bananapi original images as there was no issue to create the partition and save it to the disk like mmcblk1p1; and the disk is not write protected as you can see with hdparm command.


root@bananapim2ultra:~# sudo hdparm -r0 /dev/mmcblk1

 setting readonly to 0 (off)
 readonly      =  0 (off)

If the eMMC disk has been partitioned with BPI images and it has not been formatted again (that means that mmcblk1p1 exist on that eMMC flash memory), i really don't know why armbian (or kernel) can not see that partition that was done with BPI images if it is Ext4?


PD: The eMMC memory reference is Samsung KLM8G1WEPD-B031


Any ideas? all your help will be appreciated.




Mauricio F.



Link to post
Share on other sites

Donate and support the project!

Please post dmesg output after changes are committed to emmc (with "w"). I had exactly the same issue - dmesg was reporting a lot of serious write errors. I already assumed that emmc is not usable anymore, however, after couple of weeks... I tried again and everything was OK. I am not sure if this was really hardware issue or software.


So, please check dmesg output...


Link to post
Share on other sites

Hi Guys:


I decided to start again from the begining, so, modified DTB file to disabled MMC1 (WIFI), and just leaving the MMC2 (eMMC 1c11000) enable "okay".


        mmc@1c11000 {
            compatible = "allwinner,sun8i-r40-emmc\0allwinner,sun50i-a64-emmc";
            reg = < 0x1c11000 0x1000 >;
            clocks = < 0x07 0x22 0x07 0x6d >;
            clock-names = "ahb\0mmc";
            resets = < 0x07 0x0a >;
            reset-names = "ahb";
            pinctrl-0 = < 0x12 >;
            pinctrl-names = "default";
            interrupts = < 0x00 0x22 0x04 >;
            status = "okay";
            #address-cells = < 0x01 >;
            #size-cells = < 0x00 >;
            vmmc-supply = < 0x0c >;
            vqmmc-supply = < 0x0c >;
            bus-width = < 0x08 >;
            phandle = < 0x3d >;


Doing that, now i can see the device partition mmcblk1p1 with fdisk -l, but when i try make any change wth fdisk or format de partition, the console stops (conflict).


[    4.611521] mmc1: new DDR MMC card at address 0001
[    4.617642] mmcblk1: mmc1:0001 8WPD3R 7.28 GiB
[    4.623098] mmcblk1boot0: mmc1:0001 8WPD3R partition 1 4.00 MiB
[    4.629997] mmcblk1boot1: mmc1:0001 8WPD3R partition 2 4.00 MiB
[    4.678318]  mmcblk1: p1
[    5.550366] sunxi-mmc 1c11000.mmc: data error, sending stop command
[    6.553221] sunxi-mmc 1c11000.mmc: send stop command failed

So, if it is not a conflict with the Wifi module as it is disabled, what else is doind this conflict? by the way, if i change the bus width to 4, and that way the errors above are no longer show on dmesg even as eMMC is correctly detected, but again it stops when trying do write anything to the flash memory.


Kernel is not the problem as fdisk works well to creata a partition on a SATA external drive and The eMMC memory is not damaged as it works perfectly with the original BPI images, so, do you have any ideas on how to solve this mistery?


I already cheked the schematic again, and the pins are ok, pins = "PC5\0PC6\0PC7\0PC8\0PC9\0PC10\0PC11\0PC12\0PC13\0PC14\0PC15\0PC24";

vmmc-supply = < 0x0c >; to vcc-3v0 is ok too.
vqmmc-supply = < 0x0c >;  to vcc-3v0 is ok too.


I don't have any idea where to look. Any help will be much appreciated.


Thanks and best Regards,


Mauricio F.

Link to post
Share on other sites

Holy Mother of God, i found the problem.


I found on web blog that for eMMC as they are DDR they need a drive-strength of 40 instead of 30 like it was.


            mmc2-pins {
                pins = "PC5\0PC6\0PC7\0PC8\0PC9\0PC10\0PC11\0PC12\0PC13\0PC14\0PC15\0PC24";
                function = "mmc2";
                drive-strength = < 0x28 >; => equual to 40 in decimal
                phandle = < 0x12 >;

So, i guess that now somebody has to update the DTB with a patch.




Mauricio F.

Link to post
Share on other sites

Dear martinayotte,


on you BPI M2U board did you use the the eMMC memory to boot?


Have you ever saw these error on your dmesg:

sunxi-mmc 1c11000.mmc: data error, sending stop command
sunxi-mmc 1c11000.mmc: send stop command failed


My board is working most of the time, and i already installed armbian on eMMC with nand-sata-install, but from time to time at reboot it shows me again the same same errors, so i have to rebbot again.




Mauricio F.



Link to post
Share on other sites

This topic is now closed to further replies.

1 1