Skip to content

feat: add support for orangepi zero3 - #336

Merged
meteyou merged 4 commits into
mainsail-crew:developfrom
meteyou:feat/orangepizero3
Sep 5, 2025
Merged

meteyou merged 4 commits into
mainsail-crew:developfrom
meteyou:feat/orangepizero3

Conversation

@meteyou

@meteyou meteyou commented Jul 7, 2025

Copy link
Copy Markdown
Member

This PR adds support for the Orangepi Zero3 (all RAM versions). It is a upgraded PR from #249 with the CustoPiZer workflow.

Signed-off-by: Stefan Dej <meteyou@gmail.com>
@meteyou meteyou mentioned this pull request Jul 7, 2025
@meteyou

meteyou commented Jul 7, 2025

Copy link
Copy Markdown
Member Author

@meganukebmp @mainmachine @depben @VectorForce3D

pls download an test this new image from the workflow here.

Signed-off-by: Stefan Dej <meteyou@gmail.com>
@meganukebmp

Copy link
Copy Markdown

Ill test asap

@meganukebmp

Copy link
Copy Markdown
U-Boot SPL 2024.01-armbian-2024.01-S866c-P4a40-H8869-V3d5b-Bb703-R448a (Jun 20 2025 - 03:00:09 +0000)
DRAM base address is defined as 0x40000000
DRAM has 16 b/raw, 10 b/col, 4 B/width, 1 #rank and 8 #bank
DRAM top address must be less than 0x80000000
DRAM top address must be less than 0x60000000
DRAM: 1536 MiB
Trying to boot from MMC1
NOTICE:  BL31: v2.12.1(debug):armbian
NOTICE:  BL31: Built : 02:59:43, Jun 20 2025
NOTICE:  BL31: Detected Allwinner H616 SoC (1823)
NOTICE:  BL31: Found U-Boot DTB at 0x4a0b25c8, model: OrangePi Zero3
INFO:    ARM GICv2 driver initialized
INFO:    Configuring SPC Controller
INFO:    Probing for PMIC on I2C:
INFO:    PMIC: found AXP313
INFO:    BL31: Platform setup done
INFO:    BL31: Initializing runtime services
INFO:    BL31: cortex_a53: CPU workaround for erratum 855873 was applied
INFO:    BL31: cortex_a53: CPU workaround for erratum 1530924 was applied
INFO:    PSCI: Suspend is unavailable
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x4a000000
INFO:    SPSR = 0x3c9
INFO:    Changed devicetree.
ns16550_serial serial@5000000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19


U-Boot 2024.01-armbian-2024.01-S866c-P4a40-H8869-V3d5b-Bb703-R448a (Jun 20 2025 - 03:00:09 +0000) Allwinner Technology

CPU:   Allwinner H616 (SUN50I)
Model: OrangePi Zero3
DRAM:  1.5 GiB
Core:  57 devices, 25 uclasses, devicetree: separate
WDT:   Not starting watchdog@30090a0
MMC:   mmc@4020000: 0
Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1...
In:    serial@5000000
Out:   serial@5000000
Err:   serial@5000000
Allwinner mUSB OTG (Peripheral)
Net:   Unsupported value 13, using default (13)
Unsupported value 13, using default (13)
eth0: ethernet@5020000using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
, eth1: usb_ether
starting USB...
Bus usb@5200000: USB EHCI 1.00
Bus usb@5200400: USB OHCI 1.0
scanning bus usb@5200000 for devices... 1 USB Device(s) found
scanning bus usb@5200400 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Autoboot in 1 seconds, press <Space> to stop

@meganukebmp

Copy link
Copy Markdown

U-Boot detects correct RAM size for 1.5G!!

@meganukebmp

meganukebmp commented Jul 11, 2025 •

Copy link
Copy Markdown

Is UART enabled? I can't get anything on the serial after booting kernel. I cannot easily test wireless currently. There is no LED after starting kernel. I also have no way of getting a screen on it since it uses some microHDMI which I don't own. This would not be an issue with the 1.5GB version, as mentioned prior only the bootloader is different, and the bootloader now correctly detects the right amount.

@meganukebmp

Copy link
Copy Markdown

Seems to have been a bad sdcard, reflashed on another. Appears to boot and see correct DRAM size

image

@meteyou

meteyou commented Jul 12, 2025

Copy link
Copy Markdown
Member Author

Is UART enabled? I can't get anything on the serial after booting kernel. I cannot easily test wireless currently. There is no LED after starting kernel. I also have no way of getting a screen on it since it uses some microHDMI which I don't own. This would not be an issue with the 1.5GB version, as mentioned prior only the bootloader is different, and the bootloader now correctly detects the right amount.

While testing, I had 1-2 times also no output and no power usage (I use a power supply with display on my desk for testing). Unplug-replug it fixed this problem (I use a 4gb version from the opi zero3). Maybe there is an issue in the bootloader sometimes?

@meteyou

meteyou commented Jul 12, 2025

Copy link
Copy Markdown
Member Author

I enabled I2C, SPI and UART5 (on the normal GPIO-Header) in this Image. It would be nice, if you can test these also: https://github.com/meteyou/MainsailOS-dev/blob/feat/orangepizero3/modules/special/20-opi-zero3#L16-L34

@meganukebmp

meganukebmp commented Jul 12, 2025 •

Copy link
Copy Markdown

While testing, I had 1-2 times also no output and no power usage (I use a power supply with display on my desk for testing). Unplug-replug it fixed this problem (I use a 4gb version from the opi zero3). Maybe there is an issue in the bootloader sometimes?

I experienced this too but I also experienced some weird glitching in the print. I dont think this is related to the bootloader, but rather the power electronics. I think this board just boots faster than the caps are charged up, and can lead to power starvation as it starts pulling current quickly. This is backed by the fact that after a few restarts the caps remain charged and I get no glitching no matter how many times I restart.

@meganukebmp

Copy link
Copy Markdown

I enabled I2C, SPI and UART5 (on the normal GPIO-Header) in this Image. It would be nice, if you can test these also: https://github.com/meteyou/MainsailOS-dev/blob/feat/orangepizero3/modules/special/20-opi-zero3#L16-L34

I'll find some devices to test whenever I can

@meteyou

meteyou commented Jul 13, 2025

Copy link
Copy Markdown
Member Author

I experienced this too but I also experienced some weird glitching in the print. I dont think this is related to the bootloader, but rather the power electronics. I think this board just boots faster than the caps are charged up, and can lead to power starvation as it starts pulling current quickly. This is backed by the fact that after a few restarts the caps remain charged and I get no glitching no matter how many times I restart.

Thanks for this detailed description! To double-check, I'll update the Armbian image on the main branch, as there are some kernel and U-Boot updates for this SBC. If this doesn't resolve the issue, we'll revert to v25.05.

@meteyou

meteyou commented Jul 13, 2025

Copy link
Copy Markdown
Member Author

Here are new generic armbian test builds: https://github.com/mainsail-crew/armbian-builds/actions/runs/16246767632?pr=70

@meteyou

meteyou commented Jul 13, 2025

Copy link
Copy Markdown
Member Author

I tested the test release with multiple downtimes between (the last one with some hours) and every time the SBC boots normally. maybe it was just right now only luck. it would be nice, if you can also double check it.

@meganukebmp

meganukebmp commented Jul 13, 2025 •

Copy link
Copy Markdown

Not sure which build I should test from the ones you linked. There are multiple for zero 3 that were built

@meteyou

meteyou commented Jul 13, 2025

Copy link
Copy Markdown
Member Author

@meganukebmp ohhh sry! this one pls: 2025-07-13-armbian-25.08.0-orangepi_zero3_bookworm.img.xz

@meganukebmp

Copy link
Copy Markdown

@meganukebmp ohhh sry! this one pls: 2025-07-13-armbian-25.08.0-orangepi_zero3_bookworm.img.xz

image Both u-boot and armbian detect correct memory and work fine

@meganukebmp

Copy link
Copy Markdown

I cannot currently test peripherals

@meteyou

meteyou commented Jul 14, 2025

Copy link
Copy Markdown
Member Author

do you have any boot issues like before, or do you think these are fixed with this image?

@meganukebmp

Copy link
Copy Markdown

do you have any boot issues like before, or do you think these are fixed with this image?

I didnt experience any, but I dont think the previous build was responsible either. In any case, newer should be better I believe.

@meteyou

meteyou commented Jul 14, 2025

Copy link
Copy Markdown
Member Author

normally, i just use the latest "stable release" from armbian. Right now, this is v25.05. the new test-image was just build from the main branch.

@meganukebmp

Copy link
Copy Markdown

@meganukebmp ohhh sry! this one pls: 2025-07-13-armbian-25.08.0-orangepi_zero3_bookworm.img.xz

The peripherals were not enabled by default in this build, so I had to enable them with armbian-config.

  • UART5 works (screen /dev/ttyS1 115200 with serial adapter plugged into the port)
  • I2C-2 works (sht21 sensor plugged in and bus initialized)
pi@orangepizero3:/dev$ sudo i2cdetect -y 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@orangepizero3:/dev$ sudo modprobe sht21
pi@orangepizero3:/dev$ sudo sh -c "echo sht21 0x40 > /sys/bus/i2c/devices/i2c-2/new_device"
pi@orangepizero3:/dev$ sudo sensors
sht21-i2c-2-40
Adapter: mv64xxx_i2c adapter
temp1:        +25.0Β°C
humidity1:     59.6 %RH
  • SPI unable to test, I don't have any comfortable SPI peripherals.

@meganukebmp

Copy link
Copy Markdown

What's the progress on this? Do you still need something else tested?

@meteyou

meteyou commented Aug 21, 2025

Copy link
Copy Markdown
Member Author

I just want to check SPI (I also tested only I2C until now myself), but I hadn't time to test it until now. This is the last step i need before the release.

I also run the Zero3 for 2-3 Weeks on my desk and checked it every 1-2 days without any issue. So i think the build is stable.

@meganukebmp

Copy link
Copy Markdown

I just want to check SPI (I also tested only I2C until now myself), but I hadn't time to test it until now. This is the last step i need before the release.

I also run the Zero3 for 2-3 Weeks on my desk and checked it every 1-2 days without any issue. So i think the build is stable.

Any recommendations on what SPI device to test? Something that isn't too much of a hassle and is integrated into the kernel already preferrably

@meteyou

meteyou commented Aug 21, 2025

Copy link
Copy Markdown
Member Author

Normally i use a ADXL and I set it up in Klipper.

Signed-off-by: Stefan Dej <meteyou@gmail.com>
@meteyou
meteyou requested review from KwadFan and mryel00 August 27, 2025 03:53
@madcar86

madcar86 commented Sep 5, 2025

Copy link
Copy Markdown

Sorry I am new to Github. Is support for Orange Pi Zero 3 released or still in review?

@meteyou

meteyou commented Sep 5, 2025

Copy link
Copy Markdown
Member Author

@madcar86 close before the release. I just wait for the code review.

@meteyou
meteyou merged commit 5816045 into mainsail-crew:develop Sep 5, 2025
@meteyou
meteyou deleted the feat/orangepizero3 branch September 5, 2025 18:15
@meganukebmp

Copy link
Copy Markdown

πŸ₯³ πŸŽ‰

@meteyou

meteyou commented Sep 7, 2025

Copy link
Copy Markdown
Member Author

@meganukebmp @madcar86 we released the Zero3 image right now: https://github.com/mainsail-crew/MainsailOS/releases/tag/2.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants