# Freebsd BananaPi M3 support



## man0v (Nov 27, 2016)

Hello,

I've spent some time looking around the mailing lists, raspbsd.org, the forums, and the this wiki page( https://wiki.freebsd.org/FreeBSD/arm/Allwinner ) and as far as I can see freebsd11 can run on bananapi m3, however, I can't make it run no matter what I try.

I downloaded the bananapi xz image from the freebsd download page and installed(on linux host) using

`dd if=./FreeBSD-11.0-RELEASE-arm-armv6-BANANAPI.img of=/dev/mmcblk0 conv=sync bs=1M`

I've also tried to build the release in crochet and install the sunxi and u-boot as advised in the wiki page

`# dd if=/usr/local/share/u-boot/u-boot-<portname>/sunxi-spl.bin of=/dev/sd_card_device bs=1024 seek=8
# dd if=/usr/local/share/u-boot/u-boot-<portname>/u-boot.img conv=notrunc,sync of=/dev/sd_card_device bs=1024 seek=40`

None of these works - the bananapi board stays as it is with a red light on and absolutely no sign of life(usually it starts blinking all of it's lights during the early stages of the boot process).

And just in case someone asks about it - the board works with any of the linux images ready for download on the official page - http://www.banana-pi.org/m3-download.html

Can you tell me what I'm doing wrong?

Thank you in advance.


----------



## Phishfry (Nov 27, 2016)

The official FreeBSD image for BPI is only for the first model BPi.
There are additional kernconf files in the usr/src/sys/arm/conf/ directory with allwinner being the file you need. Looking at the dts folder I dont see an M3, only M2
/usr/src/sys/boot/fdt/dts/arm/bananapim2.dts

I believe there is an crochet board file too.
Here is what you need:
https://github.com/freebsd/crochet/tree/master/board/BananaPi-M3

So download git, u-boot, crochet and build your own image.

`pkg install git u-boot-sinovoip-bpi-m3`
`git clone https://github.com/freebsd/crochet /crochet`
`cd /crochet`
`./crochet.sh -b BananaPi-M3`

This step will take many hours. Let it complete.

When complete a finished image is built in the /crochet/work directory.
Burn it to USB drive da0 like this:
`dd if=FreeBSD-armv6-12-ALLWINNER.img of=/dev/da0 bs=10240 conv=sync`

Your image may have a different name depending on your build.


----------



## Phishfry (Nov 27, 2016)

Crochet takes care of placing u-boot on the disk. You just need to make sure the u-boot for your board  is installed. If not crochet stops and tells you what to add.

So `pkg install u-boot-sinovoip-bpi-m3` is all that is needed for crochet.
If you prefer ports it is under /sysutils/u-boot-sinovoip-bpi-m3/


----------



## Phishfry (Nov 27, 2016)

man0v said:


> dd if=/usr/local/share/u-boot/u-boot-<portname>/u-boot.img


No wonder that didn't work.
The area in parenthesis is where your port goes. In your case ie. for uboot -sinovoip-bpi-m3
But the port/pkg would have to be installed to work as well. Not sure where that bin is located.
That is why i use crochet.

Here is what it should have looked like. The sd_card_name needs an actual device.
`dd if=/usr/local/share/u-boot/u-boot-sinovoip-bpi-m3/u-boot.img conv=notrunc,sync of=/dev/mmcblk0 bs=1024 seek=40`
This assumes that mmclk0 is your microSD card writer on your computer. My card writer is da0.


----------



## man0v (Nov 27, 2016)

Hi Phishfry,

Thanks very much for your elaborate answers. Just to clarify - I already did a crochet build before and tried that(forgot to list it). The result is the same. I just finished a fresh one(with /usr/src on head branch up to date as of today) and latest version of crochet and u-boot port for banana pi m3. Absolutely no difference. Regarding the manual u-boot installation - I did use the correct path to the u-boot image and sdcard name, however, this didn't work(the way I listed it that way is because I copied and pasted it). The problem I have at the moment is that I have freebsd as a vm only. I don't know if there may be something that's happening wrong for crochet if it's run inside a vm(my host os is linux and I run freebsd inside virtualbox).

I didn't see that post in the mailing list - it's slipped off my radar. I wonder how he managed to run it.

Anyway, any other suggestions?


----------



## Phishfry (Nov 27, 2016)

Are you trying Serial Console only and with FreeBSD 12-CURRENT ?


----------



## man0v (Nov 27, 2016)

now that I'm re-reading all your posts I just noticed - no HDMI. Need to get console cable to confirm. Apart from that - I am using the head branch for the /usr/src - I assume this is FreeBSD 12-CURRENT, right?

I'll post back if I can see something out of the console.


----------



## man0v (Dec 8, 2016)

Hello again,

I just(finally) got the serial cable - no activity at all. I do see login prompt(and boot up messages) on Arch Linux(as well as RGB lights blinking) but when either of the images is on the sd card:
- My crochet build(based on head branch of /usr/src)
- FreeBSD-11.0-RELEASE-arm-armv6-BANANAPI
- FreeBSD-12.0-CURRENT-arm-armv6-BANANAPI-20161130-r309302

No indication of life. Nothing comes out through the console. The board doesn't heat up at all.

Any other clues will be greatly appreciated. Thanks in advance.


I stand correct myself!

The crochet build works! Finally I made it work. Huge thanks to Phishfry. Thank you for you elaborate answers and digging in on this for me.


----------

