• Hardware
  • Banana Pi M2 Zero (Allwinner H2+)

Yes, of course, I tested the LT version, but unfortunately, the result is also disappointing.

U-Boot SPL 2024.01 (Apr 16 2024 - 07:27:07 +0000)
DRAM: 512 MiB
Trying to boot from MMC1

U-Boot 2024.01 (Apr 16 2024 - 07:27:07 +0000) Allwinner Technology

CPU: Allwinner H3 (SUN8I 1680)
Model: Xunlong Orange Pi Lite
DRAM: 512 MiB
Core: 66 devices, 19 uclasses, devicetree: separate
WDT: Not starting watchdog@1c20ca0
MMC: mmc@1c0f000: 0, mmc@1c10000: 1
Loading Environment from FAT... MMC: no card present
** Bad device specification mmc 0 **
In: serial,usbkbd
Out: serial,vidconsole
Err: serial,vidconsole
Net: No ethernet found.
Hit any key to stop autoboot: 0
MMC: no card present
starting USB...
Bus usb@1c1b000: USB EHCI 1.00
Bus usb@1c1b400: USB OHCI 1.0
Bus usb@1c1c000: USB EHCI 1.00
Bus usb@1c1c400: USB OHCI 1.0
scanning bus usb@1c1b000 for devices... 1 USB Device(s) found
scanning bus usb@1c1b400 for devices... 1 USB Device(s) found
scanning bus usb@1c1c000 for devices... 1 USB Device(s) found
scanning bus usb@1c1c400 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
No ethernet found.
missing environment variable: pxeuuid
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
Retrieving file: pxelinux.cfg/000000
No ethernet found.
Retrieving file: pxelinux.cfg/00000
No ethernet found.
Retrieving file: pxelinux.cfg/0000
No ethernet found.
Retrieving file: pxelinux.cfg/000
No ethernet found.
Retrieving file: pxelinux.cfg/00
No ethernet found.
Retrieving file: pxelinux.cfg/0
No ethernet found.
Retrieving file: pxelinux.cfg/default-arm-sunxi-sunxi
No ethernet found.
Retrieving file: pxelinux.cfg/default-arm-sunxi
No ethernet found.
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
No ethernet found.
No ethernet found.
=>

  • uli replied to this.

    CityAceE Yes, of course, I tested the LT version, but unfortunately, the result is also disappointing.

    Thanks for testing. I suppose that's another shortcut coming to bite me...

    On H616, every board needs its own image, but I assumed that all H3/H2+ boards are similar enough that one bootloader will fit them all. It looks like that isn't the case after all...

    I'll see if I can get around to figure this out. If you want to try it yourself, you can clone the basicengine-buildroot and do a make basicengine_h3_defconfig and then change BR2_TARGET_UBOOT_BOARD_DEFCONFIG in .config to bananapi_m2_zero and make and see if that works (image will be in output/images/sdcard.img).

    (Looking at my shell history, building basicengine-buildroot needs the following non-obvious packages in addition to all the usual stuff buildroot needs: p7zip ninja-build gettext python3 python3-polib asciidoctor libsdl2-dev libgpiod-dev texi2html texinfo libncurses-dev help2man)

    If that works, I'll have to fix the git build script to create multiple H3 images (just like the H616), and we'll have to read through the device trees to see which board has which MMC config...

    Either way, thanks for your help.

      uli I'll see if I can get around to figure this out. If you want to try it yourself, you can clone the basicengine-buildroot and do a make basicengine_h3_defconfig and then change BR2_TARGET_UBOOT_BOARD_DEFCONFIG in .config to bananapi_m2_zero and make and see if that works (image will be in output/images/sdcard.img).

      You won't believe it, but I've already done this and many other experiments. Unfortunately, it has not yet been possible to achieve the necessary result.

      What you are offering will not be enough. At least in the basicengine_h3_defconfig file (and probably in orangepi_lite_defconfig) in the BR2_LINUX_KERNEL_INTREE_DTS_NAME section, add a link to the sun8i-h2-plus-bananapi-m2-zero tree. And also sun8i-h2-plus-bananapi-m2-zero.dtb to the list in the file board/basicengine/h3/genimage.cfg. You also need to edit the start menu boot.scr and add Banana Pi M2 Zero to it.

      Only in this case, the project will compile successfully and all the necessary files will be in their places. However, all this will not allow you to run this build on Banana Pi.

      The maximum result will be achieved if the path to boot.scr from Banana Pi is replaced in the basicengine_h3_defconfig file in the BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOLS_SCRIPT_SOURCE section.

      By experimentation, I found out that Banana Pi halts if there is a string setenv fdt_high ffffffff in boot.scr. Also, the string mmc dev 0 is missing to successfully load Banana Pi. So the ideal option is to use boot.scr from Banana Pi.

      If you do all this and successfully compile the project, then Banana Pi will boot. We will see the boot log in the console and on the monitor for a short time. Then the monitor will turn off and boot log will continue only to the UART console. The necessary partitions will be created on the SD. However, the BASIC section will not be filled with the necessary data. It all ends with a command line prompt. And you can even log in as root without a password.

      That's all I've been able to achieve so far. But I don't have any more ideas. My knowledge is not enough.

      • uli replied to this.

        CityAceE At least in the basicengine_h3_defconfig file (and probably in orangepi_lite_defconfig) in the BR2_LINUX_KERNEL_INTREE_DTS_NAME section, add a link to the sun8i-h2-plus-bananapi-m2-zero tree. And also sun8i-h2-plus-bananapi-m2-zero.dtb to the list in the file board/basicengine/h3/genimage.cfg. You also need to edit the start menu boot.scr and add Banana Pi M2 Zero to it.

        I simply assumed I had dumped all the H2+/H3 device trees into the image already. Must have missed that one.
        That said, I just checked linux-sunxi.org, and what they say is this:

        Despite its name the M2 Zero is totally incompatible to Banana Pi/M1/M1+/Pro/M2/M2U/M3/M64 due to a different SoC - requiring different boot loaders and drivers. It's another attempt to cash-in on the Banana Pi's popularity with a SBC sharing only Brand-name, form factor and GPIO header.

        (Thanks to libv for not mincing words here. 🙂 )

        So I don't think I will be engaging with this thing any further when it comes to a bare-metal (RX) implementation.

        With LT that is another matter, though. If you are willing to take on the job of bending the basicengine_h3_lt_defconfig into something that works on the BPi M2 Zero, I'd be more than happy to include the result in the repo and the git builds.

        CityAceE If you do all this and successfully compile the project, then Banana Pi will boot. We will see the boot log in the console and on the monitor for a short time. Then the monitor will turn off and boot log will continue only to the UART console. The necessary partitions will be created on the SD. However, the BASIC section will not be filled with the necessary data. It all ends with a command line prompt. And you can even log in as root without a password.

        That is a bit strange. There is nothing that in any way depends on the flavor (RX or LT), board, CPU or anything hardware-related when it comes to partitioning. Could you perhaps go and edit /etc/init.d/S30part and add set -x in the second line? Then we would be able to see what's going on in that script.

        Maybe it's simply the reboot that fails. The sequence is:

        • create partition
        • create a file named /make_vfat file in the root directory
        • reboot
        • create FAT32 file system
        • remove /make_vfat
        • mount FAT32 file system
        • extract data

        If the reboot fails, you will end up with an SD card with the right partitions, but no file system on the BASIC partition and a /make_vfat file on the root partition. In that case, simply power cycling the board should do the trick.

          uli Despite its name the M2 Zero is totally incompatible to Banana Pi/M1/M1+/Pro/M2/M2U/M3/M64 due to a different SoC - requiring different boot loaders and drivers.

          I have realized that it would be impossible to add M2 Zero as an additional device. Therefore, I am now focusing on building a system for only one device.

          uli So I don't think I will be engaging with this thing any further when it comes to a bare-metal (RX) implementation.

          I'm sorry to hear that, but I understand your situation.

          uli If you are willing to take on the job of bending the basicengine_h3_lt_defconfig into something that works on the BPi M2 Zero, I'd be more than happy to include the result in the repo and the git builds.

          I will try my best to do everything within the limits of my knowledge and experience.

          uli extract data

          It seems to me that the problem is somewhere in this place. But it needs to be checked.

          I'm experimenting with the same SD cards. Interestingly, after recreating the file system, the same files that I recorded earlier remain on the BASIC section, for example, video recording files of the process. I have not studied why this happens, but I have noticed this behavior.

          uli Could you perhaps go and edit /etc/init.d/S30part and add set -x in the second line? Then we would be able to see what's going on in that script.

          I will conduct such an experiment at a later date. I will also record a video of the boot process for you to watch.

          • uli replied to this.

            CityAceE I'm experimenting with the same SD cards. Interestingly, after recreating the file system, the same files that I recorded earlier remain on the BASIC section, for example, video recording files of the process. I have not studied why this happens, but I have noticed this behavior.

            That is intentional so you can update to a later version without losing your files. The setup code will only create a new file system if there isn't one already, and it will only unpack the system files if there is no sys directory.

              uli

              I've made the final build. I also formatted the BASIC partition in NTFS just in case and changed its name. Next, I deployed sdcard.img to this SD. After launching on Banana Pi M2 Zero, everything went down, the FAT32 partition was created with the correct name and content. There are no errors at any stage. I filmed the download process for you. And as I understand it, this is the finish line. Basic Engine RX will not work on Banana PiM 2 Zero due to differences in hardware from other computers with H2+/H3, which is programmed in the Bare Metal style.

              https://youtu.be/XiUCXH_gCfM?si=0hcMAeNmB9Yh7-mB

              uli

              I'm trying to build H3_LT so far just by default, without any changes. I get an error. What could be wrong?

              generate_png_fonts.c:25:10: fatal error: png.h: No such file or directory
              25 | #include <png.h>

              UPD:
              Fixed by installation of libpng-dev package.

              Excellent. Please post the config here so I can add it.

              Also, please try to reproduce the hangs without "quiet" in the bootargs so we can see where it happens. (I added that to silence the boot messages because the serial port is slow enough to slow down the boot process noticeably.)

                uli Please post the config here so I can add it.

                Here is.

                basicengine-buildroot-banana-pi-m2-zero.zip
                3kB

                Also here is a link to the compiled disk image for Banana Pi M2 Zero:
                https://disk.yandex.ru/d/OZtEt75p5Hh-DA

                uli Also, please try to reproduce the hangs without "quiet" in the bootargs so we can see where it happens. (I added that to silence the boot messages because the serial port is slow enough to slow down the boot process noticeably.)

                1.

                [ 3.065243] mmc0: new high speed SDIO card at address 0001
                [ 3.074368] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 6.06
                [ 3.082761] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
                [ 3.090058] usb usb3: Product: Generic Platform OHCI controller
                [ 3.096019] usb usb3: Manufacturer: Linux 6.6.21 ohci_hcd
                [ 3.101461] usb usb3: SerialNumber: 1c1a400.usb
                [ 3.106771] hub 3-0:1.0: USB hub found
                [ 3.110614] hub 3-0:1.0: 1 port detected
                [ 3.115294] Waiting for root device /dev/mmcblk0p2...
                [ 3.584204] usb 3-1: new low-speed USB device number 2 using ohci-platform
                [ 3.821233] usb 3-1: New USB device found, idVendor=1a81, idProduct=1004, bcdDevice= 0.01
                [ 3.829491] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
                [ 3.836654] usb 3-1: Product: Wireless Dongle
                [ 3.841029] usb 3-1: Manufacturer: G-Tech
                [ 3.853718] input: G-Tech Wireless Dongle as /devices/platform/soc/1c1a400.usb/usb3/3-1/3-1:1.0/0003:1A81:1004.0001/input/input1
                [ 3.924983] hid-generic 0003:1A81:1004.0001: input,hidraw0: USB HID v1.11 Keyboard [G-Tech Wireless Dongle] on usb-1c1a400.usb-1/input0
                [ 3.950206] input: G-Tech Wireless Dongle Mouse as /devices/platform/soc/1c1a400.usb/usb3/3-1/3-1:1.1/0003:1A81:1004.0002/input/input2
                [ 3.962528] input: G-Tech Wireless Dongle as /devices/platform/soc/1c1a400.usb/usb3/3-1/3-1:1.1/0003:1A81:1004.0002/input/input3
                [ 3.974338] input: G-Tech Wireless Dongle Consumer Control as /devices/platform/soc/1c1a400.usb/usb3/3-1/3-1:1.1/0003:1A81:1004.0002/input/input4
                [ 4.044361] input: G-Tech Wireless Dongle System Control as /devices/platform/soc/1c1a400.usb/usb3/3-1/3-1:1.1/0003:1A81:1004.0002/input/input5
                [ 4.057762] hid-generic 0003:1A81:1004.0002: input,hiddev96,hidraw1: USB HID v1.11 Mouse [G-Tech Wireless Dongle] on usb-1c1a400.usb-1/input1

                1. Then I turned off the USB dongle and restart Banana Pi:

                [ 3.167428] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 6.06
                [ 3.175742] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
                [ 3.182990] usb usb3: Product: Generic Platform OHCI controller
                [ 3.188939] usb usb3: Manufacturer: Linux 6.6.21 ohci_hcd
                [ 3.194362] usb usb3: SerialNumber: 1c1a400.usb
                [ 3.199684] hub 3-0:1.0: USB hub found
                [ 3.203541] hub 3-0:1.0: 1 port detected
                [ 3.208257] Waiting for root device /dev/mmcblk0p2...

                Next, the computer cannot be loaded, it freezes every time after clicking on the reset. But if you turn off the computer and then turn it on, then the kernel can boot. If you insert a USB dongle during "freezing", then information will be recorded in the log, and it will also be recorded if you remove the dongle. However, there is still no further loading of the kernel. I've tried recording to different SD cards, but the behavior is always the same. This is repeated whenever there is no "quiet" option. When there is a "quiet", then freezes are not so frequent and halt can be defeated by pressing reset.

                • uli replied to this.

                  CityAceE Next, the computer cannot be loaded, it freezes every time after clicking on the reset. But if you turn off the computer and then turn it on, then the kernel can boot. If you insert a USB dongle during "freezing", then information will be recorded in the log, and it will also be recorded if you remove the dongle. However, there is still no further loading of the kernel. I've tried recording to different SD cards, but the behavior is always the same. This is repeated whenever there is no "quiet" option. When there is a "quiet", then freezes are not so frequent and halt can be defeated by pressing reset.

                  If found this post on the Banana Pi forum:
                  https://forum.banana-pi.org/t/waiting-for-root-mmc-device/16676

                  So adding

                                 mmc0 = &mmc0;
                                 mmc1 = &mmc1;
                                 mmc2 = &mmc2;

                  to the aliases block in the device tree is supposed to fix this. And I actually think it would. In the boot log you posted there is this line:

                  CityAceE [ 3.065243] mmc0: new high speed SDIO card at address 0001

                  So the MMC controller that the WiFi chip is connected to is suddenly mmc0, not the one with the SD card slot. Looks like the order is random and probably depends on how fast the MMC controllers are responding. That explains why seemingly random changes to the system cause boot failures.

                  If you could try adding these statements to the aliases block dts file and check if it work then, I can just add another patch (probably best to do it for all Allwinner boards) and we're good. (Apparently the "correct" way to handle this is using UUIDs to mount file systems, I might have to look into that as well.)

                    uli If you could try adding these statements to the aliases block dts file and check if it work

                    I have not come up with another way to convert DTS to DTS in the copiled image, make changes there and convert back DTS to DTB.

                    I received errors during the reverse conversion process.

                    root@builder:/mnt/cityacee/1# dtc -I dts -O dtb -f sun8i-h2-plus-bananapi-m2-zero.dts -o sun8i-h2-plus-bananapi-m2-zero.dtb
                    sun8i-h2-plus-bananapi-m2-zero.dts:1465.10-1471.4: ERROR (path_references): /aliases: Reference to non-existent node or label "mmc0"

                    sun8i-h2-plus-bananapi-m2-zero.dts:1465.10-1471.4: ERROR (path_references): /aliases: Reference to non-existent node or label "mmc1"

                    sun8i-h2-plus-bananapi-m2-zero.dts:1465.10-1471.4: ERROR (path_references): /aliases: Reference to non-existent node or label "mmc2"

                    Warning: Input tree has errors, output forced

                    Unfortunately, it didn't help. The computer boots up every other time.

                    But these changes probably need to be made during the image build process. But I do not know how to do it.

                    • uli replied to this.

                      I think I figured out how to do it. I'll come back with the result later.

                      CityAceE But these changes probably need to be made during the image build process. But I do not know how to do it.

                      If you have compiled an image already, the easiest way is probably to edit the dts file, then delete output/build/linux-6.6.21/.stamp_built and run make again.

                        uli If you have compiled an image already, the easiest way is probably to edit the dts file, then delete output/build/linux-6.6.21/.stamp_built and run make again.

                        Thanks for this advice, it really works. Because everything I've tried before, including my own patch, didn't work.

                        Since I added aliases, I have never made to get the computer to freeze, no matter how hard I tried. So this solution can be called a working one.

                        uli (BTW, I have added the BPi M2 Zero config to the buildroot, but I haven't gotten around to adding the new image in the build server, so that's probably not going to happen before next week.)

                        You forgot to add basicengine-buildroot\board\basicengine\bpim2z_lt to the repository.

                        You also need to solve the problem in adding aliases into DTS.

                        Fixed both, but I don't think I have time to fix my build script before the end of the week.

                        In the meantime, please check if the aliases fix the boot issue (both RX and LT). Thanks. [Edit: I mean in the next build, i.e. tomorrow.]

                          uli Fixed both

                          Thank you very much!

                          uli please check if the aliases fix the boot issue

                          I made a clean build LT version. Everything compiled without errors and ran on Banana Pi M 2 Zero without any problems. I have not been able to reproduce the hang-up issue at startup, so I think the problem has been solved completely.

                          As for RX version, I can check it only with Orange Pi PC, because it is not suitable for Banana Pi M2 Zero.

                          Powered by: FreeFlarum.
                          (remove this footer)