Need help running FreeBSD aarch64 on Nanopi R2S-Plus

As mentioned in the title. I need help to run FreeBSD aarch64 on nanopi r2s-plus. This hardware listed in hardware compatibility list and I want to run FreeBSD on this router. I have downloaded the Rock64 image, write it to microSD and try to boot it. But it is failed. In debug serial output, there is an error : "no find partition:uboot".

With that I installed u-boot nanopi r2s from freebsd package and then write idbloader.img and u-boot.itb to the card. But again, it won't boot to FreeBSD. Is there a specific tutorial to run FreeBSD on nanopi r2s plus?
 

Attachments

  • Screenshot_2025-09-10_16-41-12.png
    Screenshot_2025-09-10_16-41-12.png
    26.6 KB · Views: 34
Thread about a slightly different model NanoPi, but it may provide some clues to get it working on your model.

 
if the board has a serial flash chip it may default to boot from it. i assume that u-boot from ports have efi configured but if not it might be problem
make patch in the port dir then add
CONFIG_EFI_LOADER=y at the bottom of configs/nanopi-r2s-rk3328_defconfig
then run make [install]
 
Thread about a slightly different model NanoPi, but it may provide some clues to get it working on your model.

I am going to test is asap.
if the board has a serial flash chip it may default to boot from it. i assume that u-boot from ports have efi configured but if not it might be problem
make patch in the port dir then add
CONFIG_EFI_LOADER=y at the bottom of configs/nanopi-r2s-rk3328_defconfig
then run make [install]
Thank you for the recommendation. I will try this after SirDice's advice
 
I have tried SirDice's advice, but unfortunately, it cannot read my USB mass storage. I think the problem lies in the U-Boot partition, which does not exist in the Rock64 image

EDIT: nanopi detected the USB and start booting. However the boot process stopped halfway
 

Attachments

  • Screenshot_2025-09-11_12-31-40.png
    Screenshot_2025-09-11_12-31-40.png
    435.5 KB · Views: 40
I think the problem lies in the U-Boot partition, which does not exist in the Rock64 image
On rockchip there is no U-Boot partition. These platform use a 16Meg area at beginning of disk for u-boot. Not visible.

What I suggest is building u-boot from ports tree and make a custom u-boot for your board. If that is what you are capable of doing I will help you.
It involves making one directory and two files in that directory. I will give you the text. So basically you have to compile a custom 'slave' port for your board.

Getting u-boot working from microSD card is first step. I really don't know how your USB stick booted. You must have had a microSD with ROCK64 involved.
You cannot boot directly from USB on most rockchip boards.

Usually having a USB Serial console cable is needed but RK3288 has HDMI support. So you may be ok.
Seeing early boot messages like u-boot is really helpful in bringing up a new board.
 
On rockchip there is no U-Boot partition. These platform use a 16Meg area at beginning of disk for u-boot. Not visible.

What I suggest is building u-boot from ports tree and make a custom u-boot for your board. If that is what you are capable of doing I will help you.
It involves making one directory and two files in that directory. I will give you the text. So basically you have to compile a custom 'slave' port for your board.

Getting u-boot working from microSD card is first step. I really don't know how your USB stick booted. You must have had a microSD with ROCK64 involved.
You cannot boot directly from USB on most rockchip boards.

Usually having a USB Serial console cable is needed but RK3288 has HDMI support. So you may be ok.
Seeing early boot messages like u-boot is really helpful in bringing up a new board.
I think that is my knowledge limit to create custom u-boot. But that's okay, I have found a workaround by installing official rom to its internal e-mmc and flash NetBSD image to my sd card. By interrupting u-boot process I can boot to NetBSD manually. I wish I can boot FreeBSD with this method but as you can see in my previous post, the boot process stopped halfway.
 
On rockchip there is no U-Boot partition. These platform use a 16Meg area at beginning of disk for u-boot. Not visible.

What I suggest is building u-boot from ports tree and make a custom u-boot for your board. If that is what you are capable of doing I will help you.
It involves making one directory and two files in that directory. I will give you the text. So basically you have to compile a custom 'slave' port for your board.

Getting u-boot working from microSD card is first step. I really don't know how your USB stick booted. You must have had a microSD with ROCK64 involved.
You cannot boot directly from USB on most rockchip boards.

Usually having a USB Serial console cable is needed but RK3288 has HDMI support. So you may be ok.
Seeing early boot messages like u-boot is really helpful in bringing up a new board.
After some investigations, I found that Nanopi R2s Plus needs u-boot partition to be visible. In original firmware, this partition is viewable through lsblk command. However, in both FreeBSD and NetBSD images, this partition is not available. Meanwhile, FreeBSD provided u-boot files are pseudo partitions which weren't visible.
 
I find this to be highly unlikely. All CPU of a class will boot the same way.

But rolling with it if you build U-Boot for this platform on FreeBSD from (your custom) ports it will create the 'bin' file needed for a partition style fat32 boot partition. Like iMX6/7/8 uses.

You see when you build u-boot from ports it builds all possible files.
So you get a SPI flash bin file along with every other style of booting file.

You need to carefully study the names of the files in root of u-boot build. It is not readily apparent.
 
I will document how to build your own custom port for Nano-Pi R2S. This does not guarantee that everything will work but it is a start.
I am going to leave the method you install ports tree up to you. There are many.

So the first step for me is to find if U-Boot supports this platform.
I am looking at previous build source code on my computer for a "defconfig" file. This is the support file needed for a platform to build.
All U-Boot defconfig's are found in U-Boot source tree in a directory name /configs.
So I move to a recent build on my computer and search.
I like to manually look instead of grepping. The file can be named strangely. I see what I need.

nanopi-r2s-plus-rk3328_defconfig

OK so U-Boot supports this platform. We can build a custom port on FreeBSD.

Create a new directory for your custom port. Since there is already a R2S (Non-Plus model) we will annotate our directory name.
mkdir /usr/ports/sysutils/u-boot-nanopi-r2s-plus
So we build a new port by adding a directory under /usr/ports/sysutils directory.
Doing so will allow our custom port to adopt the settings of u-boot-master. This is the parent port and your custom port is a child.

Now in this directory we need to add two new files. One is the build director file. Aptly named Makefile. The other is a description of this port along with instructions.
Both are raw text files and can be created with an editor that we will use to create our two files. I like to use ee but some users may prefer vi or nano.

Lets move the the new directory you have created.
cd /usr/ports/sysutils/u-boot-nanopi-r2s-plus

Now that I am under my custom ports directory I will create the two needed files. Their names: Makefile and pkg-descr

ee Makefile
Code:
MASTERDIR=      ${.CURDIR}/../u-boot-master

MODEL=          nanopi-r2s-plus
BOARD_CONFIG=   nanopi-r2s-plus-rk3328_defconfig
FAMILY=         rk3328

UBOOT_EXTRA_TARGETS=    u-boot.itb

.include "${MASTERDIR}/Makefile"
After you insert this properly to your new file hit <ESC> key to save and exit.

Notice the directive here. EXTRA_TARGETS. It probably means something about how it boots.
I simply took the R2S Makefile and added the defconfig for R2S-plus.
There is a good chance the board works similar to R2S.

OK now for the second file. The ports package description file and package notes. pkg-descr

ee pkg-descr
Code:
U-Boot loader and related files for the Nanopi R2S-plus.

To install this bootloader on an sdcard just do:
dd if=/usr/local/share/u-boot/u-boot-nanopi-r2s-plus/idbloader.img of=/path/to/sdcarddevice seek=64 bs=512 conv=sync
dd if=/usr/local/share/u-boot/u-boot-nanopi-r2s-plus/u-boot.itb of=/path/to/sdcarddevice seek=16384 bs=512 conv=sync
Once again I have copied this file from R2S and changed name and paths.

Notice how the port instructions work? There is no partition to add. These instructions come right from R2S build.

OK so now you have a port structure you can build your port.
make install

Follow the instructions for the port to flash to MicroSD card.
 
some linux "board installers" (even some of the "first-party" ones) will create those partitions
but they are just for convenience and not having to dealing with offsets when you dd u-boot components
 
I was going to post something related from DietPi but Linux is a hot mess and would distract.
Successful build:
====> Compressing man pages (compress-man)
===> Installing for u-boot-nanopi-r2s-plus-2025.07
===> Checking if u-boot-nanopi-r2s-plus is already installed
===> Registering installation for u-boot-nanopi-r2s-plus-2025.07
Installing u-boot-nanopi-r2s-plus-2025.07...
You don't have to worry about DTB files because they are baked into your build. DTB provided by EFI which sources from U-Boot.
 
I will document how to build your own custom port for Nano-Pi R2S. This does not guarantee that everything will work but it is a start.
I am going to leave the method you install ports tree up to you. There are many.

So the first step for me is to find if U-Boot supports this platform.
I am looking at previous build source code on my computer for a "defconfig" file. This is the support file needed for a platform to build.
All U-Boot defconfig's are found in U-Boot source tree in a directory name /configs.
So I move to a recent build on my computer and search.
I like to manually look instead of grepping. The file can be named strangely. I see what I need.

nanopi-r2s-plus-rk3328_defconfig

OK so U-Boot supports this platform. We can build a custom port on FreeBSD.

Create a new directory for your custom port. Since there is already a R2S (Non-Plus model) we will annotate our directory name.
mkdir /usr/ports/sysutils/u-boot-nanopi-r2s-plus
So we build a new port by adding a directory under /usr/ports/sysutils directory.
Doing so will allow our custom port to adopt the settings of u-boot-master. This is the parent port and your custom port is a child.

Now in this directory we need to add two new files. One is the build director file. Aptly named Makefile. The other is a description of this port along with instructions.
Both are raw text files and can be created with an editor that we will use to create our two files. I like to use ee but some users may prefer vi or nano.

Lets move the the new directory you have created.
cd /usr/ports/sysutils/u-boot-nanopi-r2s-plus

Now that I am under my custom ports directory I will create the two needed files. Their names: Makefile and pkg-descr

ee Makefile
Code:
MASTERDIR=      ${.CURDIR}/../u-boot-master

MODEL=          nanopi-r2s-plus
BOARD_CONFIG=   nanopi-r2s-plus-rk3328_defconfig
FAMILY=         rk3328

UBOOT_EXTRA_TARGETS=    u-boot.itb

.include "${MASTERDIR}/Makefile"
After you insert this properly to your new file hit <ESC> key to save and exit.

Notice the directive here. EXTRA_TARGETS. It probably means something about how it boots.
I simply took the R2S Makefile and added the defconfig for R2S-plus.
There is a good chance the board works similar to R2S.

OK now for the second file. The ports package description file and package notes. pkg-descr

ee pkg-descr
Code:
U-Boot loader and related files for the Nanopi R2S-plus.

To install this bootloader on an sdcard just do:
dd if=/usr/local/share/u-boot/u-boot-nanopi-r2s-plus/idbloader.img of=/path/to/sdcarddevice seek=64 bs=512 conv=sync
dd if=/usr/local/share/u-boot/u-boot-nanopi-r2s-plus/u-boot.itb of=/path/to/sdcarddevice seek=16384 bs=512 conv=sync
Once again I have copied this file from R2S and changed name and paths.

Notice how the port instructions work? There is no partition to add. These instructions come right from R2S build.

OK so now you have a port structure you can build your port.
make install

Follow the instructions for the port to flash to MicroSD card.
thank you for the instruction. I will try this immediately and report to you soon.

EDIT: weird. the port compilation is success. But after flashing to microSD, nanopi still cannot find u-boot and unable to boot to FreeBSD. I copied dtb file to EFI partition and hook manually from original firmware's u-boot still cause clk errors
 
Is there a chance that this is a clone version or actual NanoPi? There are some on Amazon from WayPonDEV and not FriendlyElec.I saw another china knock off too.
Maybe they are using a different clock chip.
I am really just guessing now.
From my reading there are not major differences between Plus and NonPlus. M.2 SDIO Wifi. Something else.
Not enough to change the way it boots. Something sounds broken. My first go to is Armbian. Checkout how they do it.
Here is that DietPi thread. Lots of extraneous information but worth a glance.
Youyeetoo? I like these made up names...
 
Is there a chance that this is a clone version or actual NanoPi? There are some on Amazon from WayPonDEV and not FriendlyElec.I saw another china knock off too.
Maybe they are using a different clock chip.
I am really just guessing now.
From my reading there are not major differences between Plus and NonPlus. M.2 SDIO Wifi. Something else.
Not enough to change the way it boots. Something sounds broken. My first go to is Armbian. Checkout how they do it.
Here is that DietPi thread. Lots of extraneous information but worth a glance.
Youyeetoo? I like these made up names...
I tried to run armbian and I found something interesting. This image also experience no find partition:u-boot but still booting like normal. When I checked the partition, only 1 partition exist (no u-boot partition at all). This is definitely interesting to investigate. I will grab some files from /boot folder to verify some stuffs. Here is a text file contains interesting information that I logged during cu session.
 

Attachments

Building u-boot and trust.img using friendlyelec toolchain and source is the answer for unbootable sd card. I have successfully booted the sdcard automatically. However, FreeBSD cannot find the root (maybe no driver?). When i tried to query the available disk, only internal e-mmc being detected.
 
When i tried to query the available disk, only internal e-mmc being detected.
Generally things on Arm are not detected. There is no plug'n'play. The DTB has to have the correct entries to create structures.

So maybe try other dtb files ? Checkout OpenWRT images for their DTB. They had a build for this board.
 
I have had good luck with GENERIC-MMCCAM kernel build on some Arm boxes. (Rock64 comes to mind)

It has same problem and RK3288. Disk is available at loader stage but bombs out. Try the MMCCAM kernel build.
 
I have had good luck with GENERIC-MMCCAM kernel build on some Arm boxes. (Rock64 comes to mind)

It has same problem and RK3288. Disk is available at loader stage but bombs out. Try the MMCCAM kernel build.
I have solved the problem with ROCK64 image. Actually, the problem lies on the u-boot and dtb. I have fixed this by using friendlyelec source code. I have fully booted FreeBSD from sdcard with small boot intervention. But that's okay, I have workaround for that. Now my current problem is the LAN port not detected by FreeBSD, apparently the required clock is not correct for usb480m_phy.
 
Back
Top