Skip to content

Add device profile for Luckfox Pico Mini#5

Open
rgrizzell wants to merge 2 commits intoplan44:p44_24.10from
rgrizzell:rgrizzell_24.10
Open

Add device profile for Luckfox Pico Mini#5
rgrizzell wants to merge 2 commits intoplan44:p44_24.10from
rgrizzell:rgrizzell_24.10

Conversation

@rgrizzell
Copy link

I only have the Luckfox Pico Mini A (without NAND Flash) and so this adds a device profile, but it does not add any support for SD Card images (yet).

@rgrizzell rgrizzell marked this pull request as draft December 6, 2025 03:44
@rgrizzell
Copy link
Author

rgrizzell commented Dec 6, 2025

Getting Uboot working is pretty much the last hurdle.

OpenWRT and the Linux kernel both compile without issues, but the process fails on the make target/install stage, specifically the rockchip32-legacy-bin build step.

# Copy the idbloader and the u-boot image to the image at sector 0x40 and 0x440
# Copy the boot.img to sector 0x640
dd if="/home/rwgrizzell/Projects/femtofox/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/image"/rv1106-sd-env.img of="/home/rwgrizzell/Projects/femtofox/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-rockchip_cortexa7/tmp/openwrt-rockchip-cortexa7-luckfox_pico-mini-squashfs-sysupgrade.img.gz" seek=0 conv=notrunc
64+0 records in
64+0 records out
32768 bytes (33 kB, 32 KiB) copied, 0.00101772 s, 32.2 MB/s
dd if="/home/rwgrizzell/Projects/femtofox/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/image"/rv1106-sd-idblock.img of="/home/rwgrizzell/Projects/femtofox/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-rockchip_cortexa7/tmp/openwrt-rockchip-cortexa7-luckfox_pico-mini-squashfs-sysupgrade.img.gz" seek=64 conv=notrunc
dd: failed to open '/home/rwgrizzell/Projects/femtofox/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/image/rv1106-sd-idblock.img': No such file or directory
make[5]: *** [Makefile:203: /home/rwgrizzell/Projects/femtofox/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-rockchip_cortexa7/tmp/openwrt-rockchip-cortexa7-luckfox_pico-mini-squashfs-sysupgrade.img.gz] Error 1
make[5]: Leaving directory '/home/rwgrizzell/Projects/femtofox/openwrt/target/linux/rockchip/image'
make[4]: *** [Makefile:23: install] Error 2
make[4]: Leaving directory '/home/rwgrizzell/Projects/femtofox/openwrt/target/linux/rockchip'
make[3]: *** [Makefile:12: install] Error 2
make[3]: Leaving directory '/home/rwgrizzell/Projects/femtofox/openwrt/target/linux'
time: target/linux/install#7.68#3.37#2.59
    ERROR: target/linux failed to build.
make[2]: *** [target/Makefile:32: target/linux/install] Error 1
make[2]: Leaving directory '/home/rwgrizzell/Projects/femtofox/openwrt'
make[1]: *** [target/Makefile:26: /home/rwgrizzell/Projects/femtofox/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/stamp/.target_install] Error 2
make[1]: Leaving directory '/home/rwgrizzell/Projects/femtofox/openwrt'
make: *** [/home/rwgrizzell/Projects/femtofox/openwrt/include/toplevel.mk:233: world] Error 2

I'm slowly working my way through the toolchain to see if it's possible to patch up the cortexa7.mk file with commands to generate the bootloader(s).

https://opensource.rock-chips.com/wiki_Boot_option#The_Pre-bootloader.28IDBLoader.29

Edit: Also saw this and the subsequent reply: LuckfoxTECH/luckfox-pico#115 (comment)

@plan44
Copy link
Owner

plan44 commented Dec 6, 2025

Hi @rgrizzell, thank you for your work on the Mini A (I do not have one of these myself)! And also thanks for the useful OpenWrt get started guide! I have something similar in the README for my openwrt based LED+Smarthome platform p44-xx-open. As is, it covers Omega2/Rpi only on older OpenWrt, but technically it already works on 24.10 and the rv110x targets and I hope to have it cleaned up and pushed soon…

At the moment I am working with the Pico Pro Max (rv1106) and a non-luckfox rv1103b target (see luz-WIP branch in the kernel tree for that), both with NAND flash.

Regarding u-boot built from within openwrt, that's so far a complete void for me, so any help is welcome. I'm currently just using the original u-boot from the luckfox SDK, with only one thing patched, the kernel load addresses in the default environment (kernel_addr_r=0x02000000, kernel_addr_c=0x01000000) because with the original addresses, the 6.6 kernel is too big and crashes/hangs.

@rgrizzell
Copy link
Author

rgrizzell commented Dec 10, 2025

Regarding u-boot built from within openwrt, that's so far a complete void for me, so any help is welcome. I'm currently just using the original u-boot from the luckfox SDK, with only one thing patched, the kernel load addresses in the default environment (kernel_addr_r=0x02000000, kernel_addr_c=0x01000000) because with the original addresses, the 6.6 kernel is too big and crashes/hangs.

@plan44 Thanks for the insight! I was able to generate those files with the Luckfox Pico SDK, but haven't tried bundling those into sysupgrade.img.

After digging into the U-boot process, there should be a path forward through patches in ./package/boot/uboot-rockchip/. I am guessing that device trees and other build files need to be added there. Hopefully it's easy enough to lift from the SDK. 😄

@plan44
Copy link
Owner

plan44 commented Dec 10, 2025

@rgrizzell uboot is not part of sysupgrade.img, only the kernel and the rootfs are.

That's why I can live with the original uboot from the SDK with the kernel_addr_r/c patch for now, flashing that is a one time thing when provisioning the device for the first time. After that, sysupgrade updates kernel and rootfs, but does not touch uboot any more.

Still, it would be nice to have a working uboot build within OpenWrt, so I hope lifting the relevant parts from the SDK is doable!

@rgrizzell
Copy link
Author

rgrizzell commented Dec 10, 2025

@rgrizzell uboot is not part of sysupgrade.img, only the kernel and the rootfs are.

That's why I can live with the original uboot from the SDK with the kernel_addr_r/c patch for now, flashing that is a one time thing when provisioning the device for the first time. After that, sysupgrade updates kernel and rootfs, but does not touch uboot any more.

Still, it would be nice to have a working uboot build within OpenWrt, so I hope lifting the relevant parts from the SDK is doable!

There's still a lot I'm learning about each build artifact, so I'm not entirely sure if sysupgrade.img should contain a bootloader or not. However, I did see a /boot partition on the SDCard image generated for 22.04, and the build configuration is failing to write the bootloader components to it.

I could generate the bootloader with the Luckfox Pico SDK, but I want to get this fork to a state where it can be merged upstream. Knocking down this last hurdle for everyone else will feel really good. 😄

@rgrizzell
Copy link
Author

Adding Uboot support to the rv1106 fork is going to take some collaboration. What makes matters a bit more frustrating is that I don't see support for the rv1106 chips in the upstream version of U-boot either.

Luckfox seems to have added support for it into their SDK, but I'm left wondering just how much effort it would take to backport that for OpenWRT builds. Did I miss something?

Either way, I think its time to move the U-boot effort out of this PR. You can merge what's here.

@rgrizzell rgrizzell marked this pull request as ready for review December 18, 2025 00:47
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.

2 participants