banana pi BPI-M1 A20 dual core single board comput
  • Initial page
  • LANGS
  • banana pi BPI-M1
    • banana pi BPI-M1 26 PIN GPIO define
    • BPI-M1 HDMI interface
    • BPI-M1 hardware interface
    • All Banana Pi SBC Comparison
    • BPI-M1 Hardware
    • OpenSuse
    • Linux mainlining effort
    • linuxmainlinekernelimage
    • BPI-M1 SATA interface
    • How to build OpenWRT image from github
    • Officeal OpenWRT
    • CentOS 7 Linux for BPI
    • Summary
    • Armbian Linux
    • OpenMediaVault for BPI-M1
    • How to booting from SSD using Lubuntu / Raspbian
    • BPI-M1 WiringPi
    • BPI-M1 schematic diagram
    • WiringPi python for BPI-M1
    • BPI-M1 GigE RJ45 LAN
    • BPI-M1 SD card slot
    • BPI-M1 Audio
    • Building the cluster on BPI
    • bpi-m1-software
    • BPI-M1 Camera interface
    • Arch linux wiki for BPI-M1
    • freebsdnetbsd
    • All banana pi product
    • Lamobo Openwrt image
    • Lamobo Openwrt image
    • BPI-M1 CE FCC RoHS Certification
    • RaspBSD on BPI-M1
    • bpi40customizedserver
    • Linux software
    • bananian_linux
    • BPI-M1 DXF and 3D design
    • BPI-M1 IR interface
    • BPI-M1 OTG interface
    • DietPi | Minimal image at its core
    • Reference documents
    • NetBSD/evbarm on Allwinner Technology SoCs
    • Allwinner chip documents
    • Arch Linux
    • Asterisk for VOIP
    • BPI-M1 RGB DSI interface
    • Android software
    • BPI-M1 DC Power interface
    • BPI-M1 UART interface
    • Pi4J Project
    • linux-sunxi wiki
    • BPI-M1 quick start
    • BPI-M1 CAN Bus
    • linuxkernel34
    • Nas for BPI
    • BPI-M1 MIC
    • chapter1
    • Gentoo Linux
    • Compulsive modification of HDMI output resolution
    • OpenWRT
    • lakka.tv for banana pi
    • Android Mattrix XBMC/KODI Image - V3.1
    • banana pi books
    • BPI-M 3.7V lithium battery interface
  • 香蕉派Banana Pi M1 (BPI-M1)
    • chapter1
    • Summary
    • Armbian Linux
    • Compulsive modification of HDMI output resolution
    • How to booting from SSD using Lubuntu / Raspbian
    • BPI-M1 WiringPi
    • 香蕉派 Banana Pi (BPI-M1) 千兆RJ45接口
    • Banana Pi M1 (BPI-M1) 单节锂电池接口(额定电压4.2V)
    • Android Mattrix XBMC/KODI Image - V3.1
    • Banana Pi M1 (BPI-M1) 音频接口
    • Banana Pi 对比 选型
    • BPI-M1 硬件设计
    • OpenSuse
    • Building the cluster on BPI
    • 如何从Github上下载镜像并且编译出OpenWRT
    • BPI-M1 摄像头接口
    • bpi-m1-software
    • CentOS 7 Linux for BPI
    • Banana Pi M1 RaspBSD 镜像
    • Linux 软件
    • 用于 Banana Pi M1 的 OpenMediaVault 镜像
    • bpi-m1irinterface
    • BPI-M1 原理图设计文档
    • WiringPi python for BPI-M1
    • NetBSD/evbarm on Allwinner Technology SoCs
    • 香蕉派 Banana Pi (BPI-M1) SD卡槽
    • Asterisk for VOIP
    • BPI-M1 RGB 显示接口
    • Android 软件
    • BPI-M1 UART interface
    • linux-sunxi wiki
    • Arch linux wiki for BPI-M1
    • Nas for BPI
    • Lamobo Openwrt 镜像
    • Lamobo Openwrt image
    • Linux kernel 3.4
    • BPI-M1 CE FCC RoHS 认证
    • Banana Pi M1 (BPI-M1) MIC 接口
    • bananian_linux
    • Gentoo Linux
    • BPI-M1 DXF and 3D design
    • BPI-M1 OTG 接口
    • OpenWRT
    • Reference documents
    • lakka.tv for banana pi
    • Allwinner chip documents
    • Arch Linux
    • banana pi books
    • 香蕉派 Banana Pi (BPI-M1) HDMI interface
    • BPI-M1 硬件接口介绍
    • 香蕉派 Banana Pi M1 (BPI-M1) 扩展GPIO 定义:
    • BPI-M1 DC 电源接口
    • Pi4J Project
    • Linux mainlining effort
    • BPI-M1 快速上手
    • BPI-M1 CAN Bus
    • 官方 OpenWRT
    • BPI-M1 SATA interface
Powered by GitBook
On this page

Was this helpful?

  1. banana pi BPI-M1

BPI-M1 CAN Bus

PreviousBPI-M1 quick startNextlinuxkernel34

Last updated 5 years ago

Was this helpful?

In order to port to the BananaPi, the CAN module description is needed from the A20 hardware manual. can4linux is a character-driver-based Linux driver used already on desktop PCs and embedded platforms like Freescale FlexCAN (the i.MX series of micro controllers) or Xiliny Zynq.

There is a more detailed document about CAN on the A20 at

This is a tutorial for using CAN BUS on bananapi with bananian 15-01

Thank selqcir share this example:

  • Download and install "bananian-1501.img" into 8 GB SDCard.

  • Expand the root file system using "bananian-config"

  • Install missing package:

    apt-get install git
    apt-get update
    apt-get upgrade
    reboot
  • Get last bananian available, and continu to install missing package:

    git clone https://github.com/Bananian/linux-bananapi
    apt-get install build-essential u-boot-tools uboot-mkimage 
    apt-get install libusb-1.0-0 libusb-1.0-0-dev git wget fakeroot kernel-package zlib1g-dev libncurses5-dev
    apt-get install subversion
  • Build kernel:

    cd linux-bananapi
    make menuconfig
  • Exit without saving when menu appears

    zcat /proc/config.gz > /root/linux-bananapi/.config
    make uImage modules
    make INSTALL_MOD_PATH=output modules_install
  • At this step, kernel should be compiled and "Module.symvers" should be available

  • Then rename modules and firmware provide by Bananian, and replace by the new one.

    mv /lib/modules /lib/modules.old
    mv /lib/firmware /lib/firmware.old
    mv /root/linux-bananapi/output/lib/modules /lib/modules
    mv /root/linux-bananapi/output/lib/firmware /lib/firmware
  • Same for uImage:

    mount /dev/mmcblk0p1 /mnt
    cd /mnt
    mv uImage uImage.old
    mv /root/linux-bananapi/arch/arm/boot/uImage /mnt
    reboot
  • Create link for further build:

    cd /lib/modules/3.4.104/
    ln -s /root/linux-bananapi build
    cd ~
  • Get Can4Linux and build it:

    svn checkout https://svn.code.sf.net/p/can4linux/code/trunk can4linux-code
    cd /root/can4linux-code/can4linux/
    make TARGET=BANANAPI
  • Install module for each startup of the board:

    insmod can4linux.ko
    cp can4linux.ko /lib/modules/3.4.104/kernel/net/can/
    depmod -A -v
    modprobe -v can4linux
    echo "" >> /etc/modules ; echo "can4linux" >> /etc/modules
    reboot
  • Build CAN example

    apt-get install swig
    apt-get install python-dev
    cd can4linux-code/can4linux-examples/
  • Update CAN speed and device in file "pyCan-example.py"

    ex:

    # setting the device number
    device = 0
    defaultBaudrate = '250'
  • Connect CAN transceiver and CAN bus, and check with for example:

   python pyCan-example.py

That's all

With this method, kernel version is "Linux bananapi 3.4.104" instead of "Linux bananapi 3.4.104+", because i was unable to find same sources than Bananian 15-01 , but CAN bus work !

Feel free to comment or update.

can4linux
https://dl.linux-sunxi.org/A20/CAN Bus1.pdf