[beagleboard] Running CANbus on BBB w/ Chipsee BBB-EXP-C 7" display cape

sudo ip link set can0 type can bitrate 125000
sudo ip link set can0 up

#receive:
./candump can0

Then from the other device....

#transmit:
./cansend can0 1F334455#1122334455667788

Regards,

Well, you already have can0 enabled on BBB-EXP-R cape by default... So
the above doesn't matter..

Regards,

You need to make sure the baud rate for the CAN interface is set correctly. e.g. you need to know the baud rate the PLC is transmitting at.

Also the screenshot you’ve given is normal behavior for candump. If you run candump, and it is unable to detect transmissions for whatever reason. It will just sit there as in your sceenshot, until you press control + C.

My initial guess would be that you have the baud rate set incorrectly. It must match that of the CAN interface you’re connecting to.

Example:
debian@beaglebone:~$ sudo ip link set can0 up type can bitrate 250000

For us our baudrate is 250kbps so you can . . .

debian@beaglebone:~$ sudo ifconfig can0 down

debian@beaglebone:~$ sudo ip link set can0 up type can bitrate

debian@beaglebone:~$ sudo ifconfig can0 up

And then try again with candump. Also, I’ve read that if you do not use --listen-only with the ip command. Some devices will freak out, and stop transmitting. But we’ve not yet experienced that here.

I suppose it is also possible you have your receive / transmit lines hooked up backwards. When first setting up here, that happened to us too.

When attempting to find the right baud rate for our system, a first incorrect value actually caused our BBB to lock up, and reset the external CAN device.

Ah yeah. According to your device datasheet the default baud rate is 250kBit/s

Page 2 right column

CAN Interface 2.0 A/B, ISO 11898
20 kBit/s…1 MBit/s (Default CAN1: 250 kBit/s, CAN2: 250 kBit/s)
CANopen, CiA DS 301 Version 4, CiA DS 401 Version 1.4
oder SAE J 1939 oder freies Protokol

I’m afraid my German is not very good any more. But it looks like it uses the J1938 protocol as well.

Hello all,

I haven't been keeping up with all the ins and outs of the 4.1.0-boneXX kernel. I've downloaded the testing image 4.1.0-bone9 and am curious as to how to get UART4 running?

Thanks for any direction on this subject,

Ross

open:

/boot/uEnv.txt

find:

#cape_enable=bone_capemgr.enable_partno=

Change to:
cape_enable=bone_capemgr.enable_partno=BB-UART4

reboot..

Regards,

Thanks for the super quick response Robert, but here is what I have in uEnv.txt and what dmesg shows:

snippet from uEnv.txt

[ 3.232255] bone_capemgr bone_capemgr: slot #0: No cape found
[ 3.292247] bone_capemgr bone_capemgr: slot #1: No cape found
[ 3.352245] bone_capemgr bone_capemgr: slot #2: No cape found
[ 3.412239] bone_capemgr bone_capemgr: slot #3: No cape found
[ 3.418291] bone_capemgr bone_capemgr: enabled_partno PARTNO ‘BB-UART4’ VER ‘N/A’ PR ‘0’
[ 3.418305] bone_capemgr bone_capemgr: slot #4: override
[ 3.418318] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[ 3.418332] bone_capemgr bone_capemgr: slot #4: ‘Override Board Name,00A0,Override Manuf,BB-UART4’
[ 3.418537] bone_capemgr bone_capemgr: initialized OK.

[ 4.422344] bone_capemgr bone_capemgr: loader: failed to load slot-4 BB-UART4:00A0 (prio 0)

Am I reading this right ? Almost seems as though it is trying to load twice, and the error is the second instance trying to load.

Maybe dmesg | grep uart will shed some light on the subject ? Or maybe dmesg | grep cape.

Thanks for the super quick response Robert, but here is what I have in
uEnv.txt and what dmesg shows:

snippet from uEnv.txt

hdmi/eMMC disabled:
dtb=am335x-boneblack-overlay.dtb

##cape-universal
#dtb=am335x-boneblack-universal.dtb

##wl1835
#dtb=am335x-boneblack-wl1835mod.dtb

##replicape
#dtb=am335x-boneblack-replicape.dtb
cmdline=coherent_pool=1M quiet

#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M quiet video=HDMI-A-1:1024x768@60e

##Example v3.8.x
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=

##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
#cape_enable=bone_capemgr.enable_partno=BB-UART4

#Disable HDMI/eMMC
cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G

This ^^ is for v3.8.x, don't confuse 4.1.x...

cape_enable=bone_capemgr.enable_partno=BB-UART4

debian@beaglebone:~$ cat /boot/uEnv.txt | grep UART
cape_enable=bone_capemgr.enable_partno=BB-UART4

##Disable HDMI

snipped from dmesg:

[ 3.232255] bone_capemgr bone_capemgr: slot #0: No cape found
[ 3.292247] bone_capemgr bone_capemgr: slot #1: No cape found
[ 3.352245] bone_capemgr bone_capemgr: slot #2: No cape found
[ 3.412239] bone_capemgr bone_capemgr: slot #3: No cape found
[ 3.418291] bone_capemgr bone_capemgr: enabled_partno PARTNO 'BB-UART4'
VER 'N/A' PR '0'
[ 3.418305] bone_capemgr bone_capemgr: slot #4: override
[ 3.418318] bone_capemgr bone_capemgr: Using override eeprom data at slot
4
[ 3.418332] bone_capemgr bone_capemgr: slot #4: 'Override Board
Name,00A0,Override Manuf,BB-UART4'
[ 3.418537] bone_capemgr bone_capemgr: initialized OK.
[ 3.462319] usb 1-1: new high-speed USB device number 2 using musb-hdrc
[ 3.482246] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
[ 3.482257] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
[ 3.482551] davinci_mdio: dt: updated phy_id[0] from phy_mask[fffffffe]
[ 3.482574] davinci_mdio: dt: updated phy_id[1] from phy_mask[fffffffe]
[ 3.487411] libphy: 4a101000.mdio: probed
[ 3.487437] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00,
driver SMSC LAN8710/LAN8720
[ 3.488107] cpsw 4a100000.ethernet: Detected MACID = 78:a5:04:c0:f7:5f
[ 3.489340] omap_rtc 44e3e000.rtc: setting system clock to 2015-06-30
21:16:52 UTC (1435699012)
[ 3.489366] of_cfs_init
[ 3.489456] of_cfs_init: OK
[ 3.492823] PM: Hibernation image not present or could not be loaded.
[ 3.493672] Freeing unused kernel memory: 444K (c094f000 - c09be000)
[ 3.573293] systemd-udevd[85]: starting version 215
[ 3.575088] random: systemd-udevd urandom read with 8 bits of entropy
available
[ 3.967295] usb 1-1: New USB device found, idVendor=148f, idProduct=7601
[ 3.967314] usb 1-1: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[ 4.422344] bone_capemgr bone_capemgr: loader: failed to load slot-4
BB-UART4:00A0 (prio 0)
[ 9.145277] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data
mode. Opts: (null)

at 4.422344 it appears there was a failure???

Loaded here:

debian@beaglebone:~$ dmesg | grep capemgr
[ 0.000000] Kernel command line: console=ttyO0,115200n8
bone_capemgr.enable_partno=BB-UART4
root=UUID=20b61701-5d1b-44c4-baec-5d8d4c40dba2 ro rootfstype=ext4
rootwait fixrtc coherent_pool=1M quiet
[ 3.220199] bone_capemgr bone_capemgr: Baseboard:
'A335BNLT,000C,2115BBBK0347'
[ 3.220222] bone_capemgr bone_capemgr:
compatible-baseboard=ti,beaglebone-black - #slots=4
[ 3.272316] bone_capemgr bone_capemgr: slot #0: No cape found
[ 3.332301] bone_capemgr bone_capemgr: slot #1: No cape found
[ 3.392300] bone_capemgr bone_capemgr: slot #2: No cape found
[ 3.452299] bone_capemgr bone_capemgr: slot #3: No cape found
[ 3.458340] bone_capemgr bone_capemgr: enabled_partno PARTNO
'BB-UART4' VER 'N/A' PR '0'
[ 3.458351] bone_capemgr bone_capemgr: slot #4: override
[ 3.458364] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[ 3.458377] bone_capemgr bone_capemgr: slot #4: 'Override Board
Name,00A0,Override Manuf,BB-UART4'
[ 3.458606] bone_capemgr bone_capemgr: initialized OK.
[ 3.475352] bone_capemgr bone_capemgr: slot #4: dtbo
'BB-UART4-00A0.dtbo' loaded; overlay id #0

debian@beaglebone:~$ dmesg | grep serial
[ 3.052993] omap_uart 44e09000.serial: no wakeirq for uart0
[ 3.053158] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 154,
base_baud = 3000000) is a OMAP UART0
[ 3.474825] omap_uart 481a8000.serial: no wakeirq for uart4
[ 3.474983] 481a8000.serial: ttyO4 at MMIO 0x481a8000 (irq = 180,
base_baud = 3000000) is a OMAP UART4

debian@beaglebone:~$ uname -r
4.1.0-bone9
debian@beaglebone:~$ cat /etc/dogtag
BeagleBoard.org Debian Image 2015-06-29

I only added the one line change to /boot/uEnv.txt...

Regards,

Yea, I had caught that mistake on the cape_enable line. That is taken care of.

Here is the complete /boot/uEnv.txt.

Yea, I had caught that mistake on the cape_enable line. That is taken care
of.

Here is the complete /boot/uEnv.txt.

=======================

root@bbb-blackbox:~# cat /boot/uEnv.txt
#Docs: Beagleboard:U-boot partitioning layout 2.0 - eLinux.org

uname_r=4.1.0-bone9
#dtb=

#beaglebone Black dtb's for v4.1.x (BeagleBone White just works..)

#hdmi/eMMC disabled:
#dtb=am335x-boneblack-overlay.dtb

##cape-universal
#dtb=am335x-boneblack-universal.dtb

##wl1835
#dtb=am335x-boneblack-wl1835mod.dtb

##replicape
#dtb=am335x-boneblack-replicape.dtb
cmdline=coherent_pool=1M quiet

#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M quiet video=HDMI-A-1:1024x768@60e

##Example v3.8.x
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=

##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
#cape_enable=bone_capemgr.enable_partno=

#Disable HDMI/eMMC
cape_disable=bone_capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G

Disable this line ^ as
"BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G" is NOT enabled in
v4.1.x, if you want hdmi/eMMC disabled use
dtb=am335x-boneblack-overlay.dtb

cape_enable=bone_capemgr.enable_partno=BB-UART4

##Disable HDMI
#cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN

##Disable eMMC
#cape_disable=capemgr.disable_partno=BB-BONE-EMMC-2G

##Audio Cape (needs HDMI Audio disabled)
#cape_disable=capemgr.disable_partno=BB-BONELT-HDMI
#cape_enable=capemgr.enable_partno=BB-BONE-AUDI-02

##enable BBB: eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

root@bbb-blackbox:~#

here are some greps from dmesg

===========================
root@bbb-blackbox:~# dmesg | grep UART
[ 0.000000] Kernel command line: console=tty0 console=ttyO0,115200n8
bone_capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G
bone_capemgr.enable_partno=BB-UART4 root=/dev/mmcblk0p1 rootfstype=ext4
rootwait fixrtc coherent_pool=1M quiet
[ 3.054227] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 154,
base_baud = 3000000) is a OMAP UART0
[ 3.468496] bone_capemgr bone_capemgr: enabled_partno PARTNO 'BB-UART4'
VER 'N/A' PR '0'
[ 3.468534] bone_capemgr bone_capemgr: slot #4: 'Override Board
Name,00A0,Override Manuf,BB-UART4'
[ 4.472472] bone_capemgr bone_capemgr: loader: failed to load slot-4
BB-UART4:00A0 (prio 0)
root@bbb-blackbox:~#

root@bbb-blackbox:~# dmesg | grep cape
[ 0.000000] Kernel command line: console=tty0 console=ttyO0,115200n8
bone_capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G
bone_capemgr.enable_partno=BB-UART4 root=/dev/mmcblk0p1 rootfstype=ext4
rootwait fixrtc coherent_pool=1M quiet
[ 3.222538] bone_capemgr bone_capemgr: Baseboard:
'A335BNLT,00C0,3214BBBK1283'
[ 3.222565] bone_capemgr bone_capemgr:
compatible-baseboard=ti,beaglebone-black - #slots=4
[ 3.282380] bone_capemgr bone_capemgr: slot #0: No cape found
[ 3.342488] bone_capemgr bone_capemgr: slot #1: No cape found
[ 3.402388] bone_capemgr bone_capemgr: slot #2: No cape found
[ 3.462435] bone_capemgr bone_capemgr: slot #3: No cape found
[ 3.468496] bone_capemgr bone_capemgr: enabled_partno PARTNO 'BB-UART4'
VER 'N/A' PR '0'
[ 3.468507] bone_capemgr bone_capemgr: slot #4: override
[ 3.468520] bone_capemgr bone_capemgr: Using override eeprom data at slot
4
[ 3.468534] bone_capemgr bone_capemgr: slot #4: 'Override Board
Name,00A0,Override Manuf,BB-UART4'
[ 3.468779] bone_capemgr bone_capemgr: initialized OK.
[ 4.472472] bone_capemgr bone_capemgr: loader: failed to load slot-4
BB-UART4:00A0 (prio 0)
root@bbb-blackbox:~#

root@bbb-blackbox:~# dmesg | grep uart
[ 3.054068] omap_uart 44e09000.serial: no wakeirq for uart0
root@bbb-blackbox:~#

===========================

This was the console image

microSD/Standalone: (console) (BeagleBone/BeagleBone Black)

wgethttps://rcn-ee.com/rootfs/bb.org/testing/2015-06-29/console/bone-debian-8.1-console-armhf-2015-06-29-2gb.img.xz
md5sum: 34d877d57c57ff1d6bc27685ea88b42f

ah "console" lead with that next time.. Only the lxqt images have
"everything" ready to go..

sudo apt-get update ; sudo apt-get install git-core

git clone GitHub - beagleboard/bb.org-overlays: Device Tree Overlays for bb.org boards
cd bb.org-overlays

./dtc-overlay.sh
./install.sh

sudo reboot

Regards,

Life is good. Sorry about not specifying it was a console only image.

Thanks for help on this one and all your great work on these releases.

Ross