nanopi neo core questions

Hi, everyone.
I'm testing NanoPi Neo Core with IO expansion board for hobby.
This SBC has allwinner H3 soc and internal 8G emmc.
I followed some handbooks about cross compiling freebsd 13.2 and succeeded to boot from sd card.
There are some questions in the my steps.

1) 1st fat32lba partition in GENERICSD image
What is this partition and how to create it? maybe EFI?
I just 'dd' this partion from GENERICSD to clone to my sd card.
It can't be even mounted so I can't investigate what contents is in.

2) proper u-boot image
I found 2 u-boot candidate from ports: u-boot-nanopi-neo and u-boot-nanopi-air.
These u-boot images can boot FreeBSD from sd card. But each has its own problem for NanoPi neo core cpu.
This cpu has emmc disk, and the expansion board has ethernet (awg driver).

u-boot-nanopi-neo can't detect ethernet,
u-boot-nanopi-air can't detect emmc.

In this case, I need to create a new u-boot image from mix of these two?
In my goal, I want to run custom-built-FreeBSD on the emmc with ethernet connection.

3) release.sh
I'm cross-compiling kernel and world by using the document of crossbuild
In the other document, I recognized the formal? procedure by using release.sh.
Can I use this feature to build my custom kernel?
Just simple running release.sh doesn't make any progress.

Thanks
 
try this
get https://github.com/projetoarduino/n...rch/arm/boot/dts/sun8i-h3-nanopi-neo-core.dtb
copy it under /boot/dts/allwinner on your sd card
stop loader at the counter
load -t dtb /path/to/where/you/have/copied/theabove.dtb
boot
this dtb has both ethernet and all mmc controllers enabled
if it works you can either build uboot with it as default, or create some overlays or just load it from loader.conf
like
mydtb_name="/boot/dtb/allwinner/sun8i-h3-nanopi-neo-core.dtb"
mydtb_load="YES"
mydtb_type="dtb"
this will override whatever is provided by u-boot
try the u-boot image with a working ethernet with this dtb as i found out that freebsd drivers wont always work if the device was not initialized by u-boot
 
try this
get https://github.com/projetoarduino/n...rch/arm/boot/dts/sun8i-h3-nanopi-neo-core.dtb
copy it under /boot/dts/allwinner on your sd card
stop loader at the counter
load -t dtb /path/to/where/you/have/copied/theabove.dtb
boot
this dtb has both ethernet and all mmc controllers enabled
if it works you can either build uboot with it as default, or create some overlays or just load it from loader.conf
like
mydtb_name="/boot/dtb/allwinner/sun8i-h3-nanopi-neo-core.dtb"
mydtb_load="YES"
mydtb_type="dtb"
this will override whatever is provided by u-boot
try the u-boot image with a working ethernet with this dtb as i found out that freebsd drivers wont always work if the device was not initialized by u-boot
Thanks! I'll try it.
 
I tried loader.conf and that dtb works!
Freebsd that booted from sd card can detect both ethernet and emmc.

Now, I'm testing flashing the bootable image to the emmc.
But not much progress.

I tried to dd from booted FreeBSD to emmc, but the board can't read anything.
Need to investigate linux versions that can be flashed.
 
i had to register account to reply to this

what boots is sysutils/u-boot-nanopi-m1plus as uboot has no defs for core sadly and i can't figure out how to patch it

i have fully working nanopi neo core here. i can give you dtb i use, even scripts i build and update it with. yes, it's fully booting off emmc

i had to reverse it's original linux distro fdt to get emmc up
 
Thanks all. It's working!

1) I downloaded dts and defconfig file
from https://github.com/projetoarduino/nanopi-neo-core/tree/master
which covacat said.

2) cloned sysutils/u-boot-nano_neo_air ports as new ports named u-boot-nano_neo_core

3) copyed the downloaded dts and defconfig file to this new ports directory somewhere.
I found the proper directory to find nano_neo_air files.

4) build and install to get a new u-boot spl bin.

5) I copyed this new u-boot spl file to bootable freebsd sd card.

6) boot the nanopi neo core board with FreeBSD from this sd card.

7) I dd'ed the new u-boot file and fat32lba partition and rootfs (which contains freebsd '/' dir)
from working freebsd directory to emmc disk.

* I dd'ed the u-boot file at 8K address of emmc
according to the https://wiki.freebsd.org/arm/Allwinner/booting)

8) remove the sd card, and boot the board from emmc.

I found a post https://forums.freebsd.org/threads/uboot-question.83477
From this thread, the first FAB32 partition of 50MB contains second stage bootloader.

How can I get source codes or binary for this partition?

Thanks, covacat and ketas.
 
for your device the fat partition only has to contain efi/boot/bootarm.efi
bootarm.efi is part of freebsd distribution (loader.efi)
 
i had to register account to reply to this

what boots is sysutils/u-boot-nanopi-m1plus as uboot has no defs for core sadly and i can't figure out how to patch it

i have fully working nanopi neo core here. i can give you dtb i use, even scripts i build and update it with. yes, it's fully booting off emmc

i had to reverse it's original linux distro fdt to get emmc up

How did you handle GPIO drivers for the board.
FriendlyELEC's reference library that is based on WiringPi only supports Linux.

Do I need to port the source and implement some drivers in FreeBSD?
Or can I manage them by using FreeBSD's gpio feature?

I have many sensor devices attaching to GPIO pins to play with.
 
we have libgpio which is used by gpioctl(8). you dont need any new kernel drivers to access the pins from userland. there is also some python module that can be used
 
kernel has 1-wire and dht. you can find code to use tiny i2c oled displays. or ws2812b leds. gpio interrupts code is somewhere too. i admit the support is pissy

something is here: http://ketas.si.pri.ee/ask-m-001/

i admit it doesn't have dtb currently anywhere

but i wrote few gpio helpers, etc

oh well
 
I have many sensor devices attaching to GPIO pins to play with.

May I suggest getting u-boot building on FreeBSD for this board and then use u-boot pin-mux control so when you initialize the board the GPIO pins are going how you need them. Input/Output/PU/PD

but i wrote few gpio helpers, etc

Same comment. You have big plans. You need to make sure pins are going right direction.
In getting u-boot building for your board you get the ability to edit the board_defconfig for any service needed.
 
i use loader.env on fat (in my case, fat16) to switch rootfs, feels bit faily if system loses power while at it, despite i took precautions on file ops

i wish i could construct better solution to allow dual rootfs setups on common hardware. i mean eg allwinner h3 allows one to have dual sd/emmc for uboot so you can upgrade one safely (hopefully). next step from it, i'm unsure. yeah this goes quite far from simple hacks. but i mean i treat all my systems as reliable and to me embedded dev is not about swapping sd cards around every time

and, in fact i wrote ton of stuff that ran on bbb a decade ago. some of people who helped me back then have sadly died even. oh well

btw, the rootfs.txz file i have up there, currently hosted off 100m/100m link i have at home, contains most of custom stuff under /root and you can look into loader.conf and under etc for more. in reality it's confusing and i should share a filesystem overlays i rsync on top of rootfs and boot. and scripts that take /usr/local from slooow qemu-system-arm, and my src.conf and so on, hell that even has custom /etc/rc. why did i even share that anyway. but you can look if you're able to figure out and take ideas to your system dev, even if you play. i decided 20+ years on fbsd is enough for a hobby and i can do more

but everyone have a fun
 
actually i do have my experiments from ~10y ago here:


maybe unorganized to anyone else but do contain loads of gpio/etc experiments

sadly, i found that, for example, libgpio perl bindings seem to have disappeared from public internet

also can't find proper ssd1306 oled code etc

as if people truly only use linux/rpi/arduino/python/bash/etc... you get the idea

so no wonder my neighbour, who isn't that much of a ee nor coder, went nuts over trying to buy buy rpi, because support. at that time it did cost over 250 euros which is hell of a price for such sbc
 
sadly, i found that, for example, libgpio perl bindings seem to have disappeared from public internet
I believe this was gonzo@ work from years ago?
Looks like brd@ backed it up.

The python bindings were deleted as they were for py2x
There is now python for c bindings by evadot@.
 
nooow we're talking about!!! well i luckily didn't completely lose all the repos i cloned. they are just in offline disk currently as dev laptop broke (ran fbsd of course). and in other offline backups. don't know why gonzoua deleted that, but yeah. i don't see myself removing any of mine, especially projects <1mb in size, from my own hosting on my own domain. especially if they actually get used somewhere

basically, as seen above, i wrote myself the utils to receive gpio interrupt events via stdout and second to receive values to be set on pins. unsure how, but i need to form them as port and maybe get into base (as part of gpioctl?). i don't like c much. maybe someone wishes to take this on. this could be used somewhere where devd can't be used. execute shell scripts on gpio events or so

hell, i needed clock-independent way to get uptime as seconds (not json) in my watchdog script. so i also did that. i was asked why not add this as new uptime -s arg. i looked info src/usr.bin/w/w.c and were unable to figure out at first how to do that. so i took code and made uptime-secs.c
 
btw, if anyone's interested, i managed to build tools for cheap jbd li-ion bms, cheap pzem* ac/dc power meters, etc, i see myself using. but i don't have honest idea when i'm able to port them. because i already have ton of things i want to put (back) into ports as they have higher priority

this all should make fbsd much better to use on embedded platforms, btw. because i'm certainly not alone trying to fish all sorts of code out of google to perform "basic" tasks in embedded world and under fbsd
 
i did add code and scripts as separate files into http://ketas.si.pri.ee/ask-m-001/ as well, i hope you all find them useful for embedded dev. there you find buildbox zfs fs layouts, jail config and arm qemu config. and fdt i use. call it old fashioned approach that i didn't push it all into my github and just made series of txz. of which, sh.txz, extracts files into cwd, sorry. also, apparently, using emmc as well as awg ethernet on h3 in that board causes eth no fail to init or work properly, both release and current
 
oh.. difficult contents for 20+ years of “just” fbsd user.

I hope all of you talk with fun around our royal system.

Anyway, my tiny board were stabilized now. Thanks.
 
Back
Top