anaelorlinski / OpenWrt-NanoPi-R2S-R4S-Builds

OpenWRT Builds for NanoPi R2S & R4S from official Openwrt source code with minimal set of patches
MIT License
170 stars 57 forks source link

Does this also work for NanoPi R4SE? #34

Closed TheSwede86 closed 1 year ago

TheSwede86 commented 1 year ago

Hello,

Just wondering if this build also supports NanoPi R4SE w. embedded eMMC?

Best Regards

anaelorlinski commented 1 year ago

There is a high probability it will work out of the box with a SD card but I don't own a R4SE so I could not test. There is a trick to force boot from the SD card. I recommend to read this thread that was made for R2C with eMMC : https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/issues/23

TheSwede86 commented 1 year ago

There is a high probability it will work out of the box with a SD card but I don't own a R4SE so I could not test. There is a trick to force boot from the SD card. I recommend to read this thread that was made for R2C with eMMC : #23

Thanks!

I am waiting for the R4SE to be delivered and will update this thread when I have it.

TheSwede86 commented 1 year ago

There is a high probability it will work out of the box with a SD card but I don't own a R4SE so I could not test. There is a trick to force boot from the SD card. I recommend to read this thread that was made for R2C with eMMC : #23

Thanks!

I am waiting for the R4SE to be delivered and will update this thread when I have it.

1) Downloaded "rk3399-sd-friendlywrt-22.03-docker-20220906.img.gz" from FriendlyWRTs official Google Drive; https://drive.google.com/drive/folders/1FXx761GUNFnuta2UakNdCk8wImTiZopK "01_Official images" > "01_SD card images"

2) Downloaded Win32DiskImager from here to try and get the latest version; https://sourceforge.net/projects/win32diskimager/ according to the blog here: https://launchpad.net/win32-image-writer the latest version is 1.0 and was released 2017-03-08

3) Flashed the image to the SD-card

4) Browsing to: 192.168.2.1 and logging in using root password works and the version reported is 22.03 (the version on my eMMC is 21.03 [?)) and the option "System" > "eMMC Tools" is available; https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R4SE#Option_1:_Install_OS_on_Web_Page for the R4SE the SD-card seems to take priority over the eMMC.

5) Downloaded "OpenWrt-AO-NanoPiR2C-full-22.03-20220908-squashfs.zip" from; https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/releases/tag/OpenWrtAO-22.03-20220908 and extracted the zip so I have the ".gz"-file

6) Uploaded the ".gz"-file using the forementioned webinterface

7) Seemed to have worked; "Finish!
Please eject the SD card, the device will reboot and startup from eMMC, Click the following button when the system LED is blinking and the network LED lights up again: [Go to Homepage]

WARNINGS ● the image file should be one of the following file formats: .img, .gz ● support raw image file and rockchip format firmware ● you can upload whatever you want, so be sure that you choose proper firmware image for your device" however only the "PWR"-led is lit even after waiting ~ 5min

8) Pulled out the power cable and inserted it again

9) Only "PWR" is lit, nothing else happens. Clicking the "[Go to Homepage]" results in "ERR_CONNECTION_TIMED_OUT" browsing directly to "192.168.2.1" returns the same.

10) Pulling the power / re-inserting it and re-inserting the SD-card; Being able to access the web-interface at 192.168.2.1

Any ideas on how to get the eMMC to accept your image?

thehonker commented 1 year ago

It might work, but we currently can't proceed past u-boot. It appears that the images built for the R4S are mbr/dos formatted, and the first partition doesn't have a fat32 filesystem on it (that I could mount at least). EFI booting is required for EMMC on these boards afaik.

Flashing the given image won't work as the emmc is disabled in the device tree for the r4s. Overwriting the given u-boot with vendor u-boot doesn't work as that's expecting to find a fat32 with type ef00 and some /boot/efi/bootaa64.efi file.

dts for r4se

TheSwede86 commented 1 year ago

It might work, but we currently can't proceed past u-boot. It appears that the images built for the R4S are mbr/dos formatted, and the first partition doesn't have a fat32 filesystem on it (that I could mount at least). EFI booting is required for EMMC on these boards afaik.

Flashing the given image won't work as the emmc is disabled in the device tree for the r4s. Overwriting the given u-boot with vendor u-boot doesn't work as that's expecting to find a fat32 with type ef00 and some /boot/efi/bootaa64.efi file.

dts for r4se

Thank you for your reply, if I can assist in any way please let me know (if you need to test builds / troubleshoot etc.) I'll happily collaborate using Discord etc. if you have something for me to try out so you can get the feedback instantly.

I am not that experienced in Linux and not at all (other than trying to compile packages that didn't work) when it comes to building firmware but I have the hardware and will happily help out if you guys (and girls) need it.

luoyuhao0x58 commented 1 year ago

I test flash OpenWrt-AO-NanoPiR4S-full-22.03-20220928-ext4.zip into r4se eMMC,seems unable to boot.

anaelorlinski commented 1 year ago

I don't own a R4SE so cannot test the eMMC feature but I will try to make those builds compatible if I get a device. It seems that there is support in friendlywrt and immortalwrt so in theory this is just a matter of adding the correct patches and find the correct flash procedure to make it work.

TheSwede86 commented 1 year ago

I test flash OpenWrt-AO-NanoPiR4S-full-22.03-20220928-ext4.zip into r4se eMMC,seems unable to boot.

I don't own a R4SE so cannot test the eMMC feature but I will try to make those builds compatible if I get a device. It seems that there is support in friendlywrt and immortalwrt so in theory this is just a matter of adding the correct patches and find the correct flash procedure to make it work.

I dont't know if this helps but for the "official" FriendlyWRT build I used these steps; https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R4SE#Flash_to_TF

First flashing to TF and then using the web interface to flash the sd-card image to the eMMC.

dominch commented 1 year ago

One of the best things about R4s and it's portability is that You can easily swap whole system/configuration by changing sd card :) I would rather prepare additional card that boots and start system from eMMC than boot only from eMMC and require to erase it when sd is needed. Such card can be small (few MB needed) and won't fail (no write). It would not delay boot noticeable and won't affect running system speed. Of course You need to sacrifice some old sd card, but that's not much :)

mfahk commented 1 year ago

I test flash OpenWrt-AO-NanoPiR4S-full-22.03-20220928-ext4.zip into r4se eMMC,seems unable to boot.

Hello, I have the same issue, installed, no boot, no sys, just power light, not starting from sdcard .

Any suggestion?

R4SE

anaelorlinski commented 1 year ago

I would think that the problem is related to the boot order according to this page: https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R4SE#The_Boot_order_between_eMMC_and_SD_card

You need to use the maskrom key to boot from SDCard as a temporary solution, and clear the eMMC as a more long term one.

If doing one of those solution still not boots, maybe my image is not working on R4SE but don't own a device so I cannot test further. If you have a serial console with the boot log it might help.

anaelorlinski commented 1 year ago

Just in case try the latest release 2022.10.19, it has friendlywrt u-boot patches to support R4SE

itmecho commented 1 year ago

Hi! Sorry to post on a closed comment but I think it's related so I shouldn't open a new issue!

Firstly, thank you for these builds, they're great! Everything works perfectly when booting from the SD card.

I'm trying to get this installed on the eMMC of my RS4E but I can't seem to access the eMMC when booting from the SD card. I only have one device in my fdisk -l output and it's the SD card.

I don't suppose you know if there is a driver or something I'm missing to be able to interact with the eMMC storage?

anaelorlinski commented 1 year ago

I think this needs an extra definition in the dts file for the eMMC Look how it has been implemented in immortalwrt : https://github.com/immortalwrt/immortalwrt/commit/86e1977c45a72795cda6f086c4f41ecd97a53c98

itmecho commented 1 year ago

Thanks! In the meantime, I managed to get friendlywrt back on the emmc via USB. Once I was back in there, I tried to flash your build using the friendlywrt emmc tools but after it's flashed, the R4SE won't boot. It just sits there with the power LED on and nothing else happens =/ Connecting to either of the ethernet ports also seems to do nothing.

zaadstra commented 1 year ago

To be conclusive, does it work on a R4SE if only using the SD (erasing eMMC)?
This will allow future options. The R4S and R4SE cost the same and some sites.