Banana Pi M3 running Arch ARM Kernel 4.20 Setup

I’ve given some thought to where I should start this.

But let’s just wing it and start off with something fun. Let’s get the M3 going!

Maybe I should mention the setup first.

The M3 board, is in a quite low cost hong kong quality “kind of” case. Since I’ve read before, that it is unstable and doesn’t offer full performance without cooling, I added the according stuff including a small fan. And I use 16GB SD cards usually. Also in this case.

The power supply too is a cheap hong kong quality one. It was the cheapest I’ve found. It has some settings options for output and some plugs coming with it thought. I’m not sure, but I think it’s 4 Amps actually? I tend to go a bit higher. For example, I use 2.5A on all my Raspberries (2 and 3) these days. I can’t take a look right now, since that thing is working on a calculation like a beast right now.

Banana Pi M3 Setup

Banana Pi M3 Setup

I’ve had the Banana Pi M3 for quite a while and have tried to get some decent image going many months ago. To no success.

I use Arch Linux ARM on pretty much everything else. But months ago, for the M3 I’ve only found an old 2016 image with a 3.6 kernel. And that wasn’t glorious at all.

The images available didn’t really work or were the lightest of the lite versions. Also, there is barely any clean description on how to set it up by hand. Otherwise I’d have done it. I don’t have the time to play around for weeks to figure it out. I need the device running, not the playing around.

The only image working for me was Ubuntu. Some 16.04 basis. Not very glorious either. At least, the internal wireless adapter was working. Otherwise, it’s some lite image. And the emphasis is on lite here. As it provides really the bare minimum, that is barely of any use. Not very impressive.

I tried to get it running from the internal storage chip. I think it did, but there were troubles. So, I cleaned it and stopped playing around at some point. I just ran a script for a calculation once, that on my PC takes 4 hours and on the M3 took 19 hours. Not very helpful either.

These days I wanted to get some stuff going. And since the M3 is the most powerful of the ARM devices I own, I needed to get it going.

So, yesterday it has cost me like 21 hours to do so. And today the advanture continues. But it kinda paid off. The setup is still not final. But I’m getting somewhere now.

What’s the current state you can look forward to? Well, right now I’m running the mainline ARM kernel with latest upgrades and the 4.20.6 kernel. Ran full upgrades plus the necessary installs yesterday. I’ve got X and the internal wireless running. Network Manager and ethernet working too. It does work with HDMI, but my media player aside, I use all ARM devices headless. So, I didn’t test sounds, because I don’t use and need it.

Banana Pi M3 specifications specs

Banana Pi M3 specs

Wanna know how I did it?

Buckle up! Let’s get going…

Last time it turned out, the one image working best for the moment is Ubuntu (kernel 3.4) and Arch provides some old kernel 3.6 version. Both didn’t make me very happy. Didn’t seem mainline either. So, upgrade… nop! Guessing I’d say, that was at least half a year back.

So, I went on a search again. I didn’t find the first page again. After some struggle with trying to find my own setup, I’ve found an image from like 3 months ago from November of 2018. A download link to a Google drive. On first sight it looked like the link didn’t work. But hitting the download button, it was there. Approx. 1.5GB. Kernel 4.19 already. I think it was advertised with 4.18?

Here is the download link:
Banana Pi M3 Arch Linux ARM kernel 4.19

First I just dd-ed it on the SD card and forgot to unzip it. Heat of passion. You might wanna skip that part. But doing it right, it turned out, the image actually works.

On the downside, I had no network connection at all. Internal wireless didn’t even show in ip link. And with the same, as I did on a bay trail device, I couldn’t even get eth0 up. That was quite annoying.

Network Manager, to my surprise, was on there already. The catch: it didn’t start. After the first try it said, “tried to restart too quickly”. But that didn’t go away after the waiting period and after resetting the failed services. While I had no according error, on the Internet someone said, that is because of a problem with libraries. So, there went that idea too.

So, after a while I’ve got the ethernet working with netctl. That was new to me. But the description is in the Arch Wiki.

What you basically do is, you create a profile file in /etc/netctl and then start the thing with netctl start <profile name>. That is the file name. Not the full path. Note: if you want to enable it, don’t use the systemctl command. It will give you an error. You need to use netctl enable <profile name>.

You can use the wifi-menu to create the config file for a wireless connection. Just make sure you use a simple file name. But as I was saying, the internal wireless adapter was not available. So, there goes that idea.

Since I was on an internal network, I changed the settings and enabled netctl. Then switched to the Internet network to get some upgrades going.

That was a nice idea. The reality was, that the M3 didn’t connect and I never got a network connection. So, there went that idea.

So, back to the ol’ drawing board.

Surprisingly, the workaround was an external USB wifi adapter, that ALARM recognized immediately. So, profile with wifi-menu, netctl and now we were talking… or should I say, communicating?

But before, I increased the size of the partition on the SD card. I left 4GB for swap. I use 16GB usually.

Then I went for the upgrades and installed various of the usual applications, that could come in handy. I think it was like 556 packages total, including upgrades. Despite Internet not being the fastest, it didn’t take that long. The 4.20.6 kernel came with it. Lastest ARM. On my notebook I have 4.20.7 right now.

As stated in other websites, for me too the SD card has a reading speed at slightly more than 22MB/s in that thing. That’s quite good. With other devices and readers I usually get a max of 18MB/s.

After the upgrade, everything was still working fine. Also, Network Manager was not available and working. Well, with a little bit of stupid behavior in the beginning. But nothing, that could be fixed by disabling netctl and restarting.

Right now, what I don’t get, is a temperature. That not that great. Sensors doesn’t show a thing and the thermal folder is completely empty. But well, what should you do.

Otherwise, Network Manager and network was there. Both, ethernet and wireless. X did work in short test. No errors. Restart without problems. To my suprise. So, at this point it become interesting already.

But there are still some things to firgure out.

First of all, I remember, that unlike other like Raspberries, this one has internal storage. But 8GB of it and now the SD card partition had 10GB. Also, what’s going on with the internal wifi adapter, that was still missing?

So, that was another some hours of trial and error.

First of all, I tried to get the internal wifi going.

The Banana Pi M3 is using the, I think it was called Ampak?… AP6212. This is a package deal of wifi and bluetooth. Which includes the broadcom 43438. According to the Internet, the same is in Raspberries Pi3s. The catch: with the Raspberries it’s working and with the M3 it is not.

After trying all kinds of stuff, like activating kernel modules and trying to install a few things, nothing did work. So, I went back to the Ubuntu image and search a bit in the file system. Particularly the firmware.

From there I copied 2 folders (the ap6212 and the brcm) to my Arch image. Of course, /lib/firmware too. And guess what! After a restart, the internal wireless adapter showed up to the party and was ready to go!

Now the next thing would be, to take the internal storage. The ideas was nice, but that is where the problems started.

By the way, this is a funny thing. Last time I checked, the internal storage was barely faster than the SD card. Also, I’ve found a web page that said, that the read spead like less than 55MB/s. My test in Arch (hdparm -t) showed a reading speed of between 74 and 76MB/s for the internal storage chip.

Now, I went back to Ubuntu to copy Arch. But I wasn’t able to moun the Arch SD card.

While I had trouble with a USB thumb drive before. This was different. The kernel 3 couldn’t handle the ext4 file system of the kernel 4. So, the solution was, to copy the entire SD card and use one Arch to copy the other.

How did I do it?

Well, first just clean your storage chip. For example with dd. In my case that’s /dev/mmcblk1. If you see them (Ubuntu shows them, Arch doesn’t), don’t worry about the two boot partitions by the way. According to the Internet, there is no boot1 for the M3. And boot0 basically gets the boot process going. It’s kind of like a BIOS without options, it seems.

Next, you need to take over the boot stuff with dd. I did so, again with dd, from SD card to internal memory (device, not partition), with the options bs=1024 and count=8. Do that first, because if you change the order, it will wipe your partitions. Note: the ALARM (ArchLinuxARM) says, seek=8. That’s detrimental, since a finite file size is dd-ed. In thise case with seek=8 it will write the whole SD card content to the internal memory, until it reaches the end of either the internal storage or the SD card. That’s not what you want!

Next, you are going to have the partitions of your SD card on there and get some errors. Don’t even think about it. Just delete the partitions and create new ones. With fdisk you can actually leave say 1GB for swap by saying, the end of the partition is -1024M for example. 8GB is not much anyway. And cfdisk might come in handy too. Don’t forget to format it with mkfs.ext4.

Once that is done, create 2 folders in the mount directory, mount both, the SD card and the internal partition and sync it over with rsync (rsync -aAXv).

Now, here is where the trouble started.

For me, it did sync over for a short while. Then suddenly the M3 turned of. Completely.

So, I restarted that thing and just continued with rsync. And the same happened again.

I waited for a few minutes. Not long. Then went in again. From 4.6GB, 4GB have already been transferred. So, I assumed, that the rest of 600MB will now be transferred. And after that happened, I tried rsync like 2 or 3 more times, to make sure everything is there.

Then I powered down, remove the SD card and booted. That went quite well. The boot time seemed faster. As it should be. X too started fast and responded well. Firefox took like twice as long to load, than it does on a desktop. But well, it’s a cell phone… basically.

Now, given it crashed during transfer of the data, I thought it might be due to heat issues. So, while I would need the speed for my calculations, I decided to go with the USB thumb drive, put the data there and get going from there.

So I did. Mounting the USB thumb drive was trouble again. After I finally got it done, I transferred the data and started the calculations.

And after some minutes, maybe like quarter of an hour, the M3 went dark again.

I tried again. Same thing happend.

After that it barely started at all.

So, I tried all kinds of stuff. Starting from internal storage. Adding the SD card. Trying the copy of the SD card. Then switched to Ubuntu. And after a short while it finally started.

So, first thing I did, was remove the swap partition from the internal storage. Next, I wiped the beginning of the internal storage too, to basically disable it completely. Since this would also overwrite the partition table. Same options as above, but from /dev/zero.

I’m not sure if I went back to the Arch SD or tried with Ubuntu.

But I started the calculation again. Again from the USB thumb drive. First the USB thumb drive went missing. Then in a second try it powered down and went dark again.

So next, I went with Arch, removed everything not necessary and tried again. And guess what! It has been running ever since.

For some reason, at least in my case, the Banana M3 has some trouble with USB storage media.

It had no trouble as long as it was the keyboard and wireless adapter. But with the USB thumb drive it created problems from the get go. The same with the SD card and reader from USB for copying the data.

Once the storage media were removed from USB, it started working normally. At this point, the calculation has running for the past 8 hours.

Banana Pi M3 Full Power Calculations

Banana Pi M3 Full Power Calculations

So, right now I’m not sure, if I should just keep it going to the end or start over. Meanwhile I’ve put the DATA on the internal storage and I’m tempted to start over and do the calculations from there. The problem is, my time is limited and need to get the results in less than 1.5 days.

Starting over would lose me 8 hours, but tripple the speed of the process. Last time it took 19 hours. So, there is a fair chance, this is still going to a long time. And it’s gonna be touch to get it done in time. The bigger question: does it crash with internal storage or not and if not, how far does the speed drop?

Taking the screenshots I realized, that lscpu now says, that the max CPU frequency is 1200MHz. It said, I think, 2016MHz before. According to statements online, that’s the typical limitation in case of overheating prevention. So, this is thermal throttling and not quite helpful.

Following that path, I did some research. It seems, the whole M3 setup is weak and tends to overheat. According to some texts I’ve found, the small heat-sink is not enough. Also I’ve found a text that stated, that the shutdown is normal in case of (intensive) USB usage. So it seems, the M3 underpowers and overheats very easily. And in this case it not only cuts the performance but also tends to turn off soon and often.

That’s really sad. What’s the point of offering 2GHz of calculation power, if as soon as you really use it, it’s cut down by 40% to only 1.2GHz and even turns off again and again. So, you need to find a better setup to get the temperature down. A bigger and better heat-sink. Otherwise there is no point in using a high performance software setup.

I’ve meanwhile started over with the calculation from scratch and out of the internal storage. Without USB peripherals it’s still running. But still at a max of 1200MHz. So, this is tedious. I just hope it’s gonna be done in time.

Nevertheless, if you followed the story and use it, you should get a decent setup for your Banana M3 that should top most of the average out there and get you going and on a good path.

So, I hope you enjoy it.

See you next time 😉

error: