Looking for kernel headers

I like to compile the CANbus driver can4linux for the M2 Berry. Installed is kernel 3.10.107 $ hostnamectl Static hostname: bpi-berry Icon name: computer Machine ID: 1fcd796fe1b54aac8fc08afb8692d294 Boot ID: 1102721d51af4f1b974339ba8dd12f0c Operating System: Raspbian GNU/Linux 9 (stretch) Kernel: Linux 3.10.107-BPI-M2U-Kernel Architecture: arm

How do i get the kernel headers for this version in order to compile a loadable kernel module. Searched for hours this and other forums. Hope someone can help. Also another kernel image is possible, as long I can develop a kernel module. Thanks

Use Armbian where you can install headers (from armbian-config menu)

Thanks Igor just try to compile the kernel using BPI-M2U-bsp (it still compiles, let’s see if will run as well)

With armbian, you mean the images at https://www.armbian.com/bananapi-m2u/ which should I use: Stretch or Bionic?

Thanks Igor installed Armbian, looks great. On Monday I can test kernel module compilation.

OK. There is one small issue which I am not sure its fixed yet: https://forum.armbian.com/topic/9602-linux-headers-41920-cubox-make-scripts-fails/

The problem is still there

[email protected]:/usr/src/linux-headers-4.20.7-sunxi# make scripts scripts/kconfig/conf --syncconfig Kconfig net/Kconfig:89: can't open file "net/wireguard/Kconfig" scripts/kconfig/Makefile:69: recipe for target 'syncconfig' failed


#source "net/wirguard/Kconfig"

works than and I can compile the module.

1 Like

Still some problems

#include <mach/includes.h>

is missing. I need to configure GPIO pins to be used as alternative pin, in my case CAN-TX and CAN-RX. I found some drivers using calls like sw_gpio_setcfg(GPIOA(16), 3); But I#m not able to find headers containing the prototype of sw_gpio_setcfg();

We don’t officially support any R40 board since its a rear chip and you will need to explore on your own from here. CAN is known to work on A10, A20, H3, H5 … but here I don’t know how far things are. forum.armbian.com will be a good source of info, or https://www.google.com/search?q=allwinner+can+bus

OK , for now i will use writel() to configure the appropriate port pins. By the way, the V40 has a CANbus module, the R40 does not.


I have a similar question, perhaps someone can help me as well. For a project using a Banana Pi Berry, I need to connect a SIMCOM7600E 4G module, the one that is on the Waveshare 4G Hat (https://www.waveshare.com/wiki/SIM7600E-H_4G_HAT). With a Raspberry 3B+, I had no problem using it, everthing worked fine (using the USB connecting method). But with the Banana Berry, the same method doesn’t work, apparently because the raspbian version for the Banana Pi lacks the needed driver for the SIMCOM7600E. The driver is available in source format: https://www.waveshare.net/w/upload/0/00/SIM7600_NDIS.7z Could someone help me on how to install this driver in the Banana Pi raspbian? Just follwing the recipe in page https://www.waveshare.com/wiki/NDIS_Dial-Up doesn’t work, runs into an error.



check Armbian. Headers are installed via armbian-config menu.


Yes, you are right, I should do that. Just a silly question: in your opinion, how long would it take to catch up with building it with armbian? (I know how to run a docker image, how to program in golang for linux and windows, I have some experience with setting up cloud servces, so I have some exeprience with similar things…)



Hello Igor,

I downloaded the armbian image(https://www.armbian.com/bananapi-m2u/), wrote to a 16 Gbyte industrial SD card, but the Banana Pi M2 Berry doesn’t even start. I tried with another SD card, same result.

Could you help me on what did I miss?

Update: it works, I am testing it! Sorry!



Gabor, I did switch to Armbian for this board. Two years ago.


Thanks for your answers, I’ve got armbian up and running on my Berry, seems pretty stable! I’m still strugling, because I need to access GPIO pins also, and I didn’t found any references yet. Unfortunatelly there is no FAQ (or I din’t found it) neither on this nor in the armbian forum about how to access the GPIO, the IIC and other peripherials (with armbian) on the Berry. So, any help is appreciated!




For other things, try armbian-config -> system -> hardware (this is the place for handling overlays if any)


Thanks again!



Sorry for asking again. I wanted to activate UART2 on the Berry (connectors 8 and 10), so I added overlays=uart3 to /boot/armbianEnv.txt (I read somewhere on the armbian forum that uart3 in the overlay will end up as /dev/ttyS2), but nothing happens.
dmesg | grep tty gives me:

[ 0.000000] Kernel command line: root=UUID=a3509dd3-8533-4f49-b3f0-17cbcc184a9a rootwait rootfstype=ext4 splash=verbose console=ttyS0,115200 console=tty1 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 consoleblank=0 loglevel=1 ubootpart=15c625ae-01 ubootsource=mmc usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16 cgroup_enable=memory swapaccount=1 [ 0.000387] printk: console [tty1] enabled [ 2.125439] printk: console [ttyS0] disabled [ 2.125538] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 74, base_baud = 1500000) is a 16550A [ 2.125976] printk: console [ttyS0] enabled [ 2.188545] 1c28c00.serial: ttyS1 at MMIO 0x1c28c00 (irq = 108, base_baud = 1500000) is a 16550A [ 2.188734] serial serial0: tty port ttyS1 registered [ 6.788251] systemd[1]: Created slice Slice /system/getty. [ 6.795324] systemd[1]: Created slice Slice /system/serial-getty. [ 8.115302] systemd[1]: Found device /dev/ttyS0. [ 38.830211] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB0 [ 38.840920] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB1 [ 38.844259] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB2 [ 38.850680] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB3 [ 38.851805] usb 1-1.1: GSM modem (1-port) converter now attached to ttyUSB4

(yes, I have a 4G modem connected, at least that works!).

Could you please advise me what do I wrong?



PS: I also added more uart-s to the overlays line, still no good (like overlays=uart2 uart3 uart4)

UPDATE: I also have a Bananapi M2+. On that machine, in armbian-config, it is possible to switch on uart2, uart3, etc. But this menu item is not present on the armbian-config utility of the Banana M2 Berry. Why, I don’t know, perhaps it is because the image I downloaded is just an automatic build…