what a night mare to get something simple to work. ditch Linux use barebones Sent from Yahoo Mail on Android
|
|
|
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
sudo modprobe can
sudo modprobe can-dev
sudo modprobe can-raw
sudo ip link set can0 up type can bitrate 500000
sudo ifconfig can0 up
pin 96 (44e10980.0): P9_26_pinmux.53 (GPIO UNCLAIMED) function pinmux_P9_26_can_pin group pinmux_P9_26_can_pin
pin 97 (44e10984.0): P9_24_pinmux.51 (GPIO UNCLAIMED) function pinmux_P9_24_can_pin group pinmux_P9_24_can_pin
can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 10link/cancan state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0bitrate 500000 sample-point 0.875tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1c_can: tseg1 2..16 tseg2 1..8 sjw 1..4 brp 1..1024 brp-inc 1clock 24000000re-started bus-errors arbit-lost error-warn error-pass bus-off0 0 0 0 0 0RX: bytes packets errors dropped overrun mcast0 0 0 0 0 0TX: bytes packets errors dropped carrier collsns0 0 0 0 0 0
can0: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN mode DEFAULT qlen 10link/cancan state BUS-OFF (berr-counter tx 248 rx 0) restart-ms 0bitrate 500000 sample-point 0.875tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1c_can: tseg1 2..16 tseg2 1..8 sjw 1..4 brp 1..1024 brp-inc 1clock 24000000system B
can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 10
link/can
can state ERROR-PASSIVE (berr-counter tx 0 rx 127) restart-ms 0
bitrate 500000 sample-point 0.875
tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
c_can: tseg1 2..16 tseg2 1..8 sjw 1..4 brp 1..1024 brp-inc 1
clock 24000000
Now after some digging I found that the can-bus starts in error-active then if it doesn't get a reply to a message after 127 errors we get error-passive and after 255 errors it goes into BUS_OFF.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
sudo apt-get updatesudo apt-get install linux-image-3.14.35-ti-rt-r56 ; sudo reboot
nano /boot/uEnv.txt
dtb=am335x-boneblack.dtb
git clone -b 3.14-ti https://github.com/RobertCNelson/dtb-rebuilder.git
cd dtb-rebuilder/
nano /src/arm/am335x-boneblack.dts
/* can0: P9.19, P9.20: disable: i2c2: cape eeprom */
/* can0: peripheral */
#include "am335x-can0.dtsi"
/* can0: pinmux */
#include "am335x-bone-can0.dtsi"
/* can1: P9_24, P9_26 */
#include "am335x-can1.dtsi"
#include "am335x-bone-can1.dtsi"
make
make install
nano /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins
cd ~/
git clone https://github.com/linux-can/can-utils.gitcd can-utils./autogen.sh
vim ./configure
:11660
:w
:q
./configuremakemake install
sudo modprobe cansudo modprobe can-devsudo modprobe can-raw
sudo ip link set can0 up type can bitrate 125000sudo ifconfig can0 up
--
The CANUSB from Lawicel is a standard USB device that looks like a serial port since it can use the FTDI driver.
On my MachineKit Debian Beagle 2.0 when I plug in the CANUSB I find I have a /dev/ttyUSB0 device.
I installed putty and connected to /dev/ttyUSB0
In the terminal window
V with a CR returns
V1011
An S5 sets 250kbps
An O opens the port.
t12327788 with a CR again of course sends SID=123, DLC=2, Data 0x77 0x88
With nothing connected to the CANUSB the red LED goes on. (or if bitrate is wrong).
A C closes the port.
An F prints the error flags and shuts off the red led.
It’s a good idea to have auto line feed set in putty so that each received message is on a new line.
John Dammeyer
From: beagl...@googlegroups.com [mailto:beagl...@googlegroups.com] On Behalf Of Tracy Smith
Sent: October-31-17 3:42 PM
To: BeagleBoard
Subject: [beagleboard] Re: BBB- DCAN1 problems using latest debian image
Hi John,
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/_9u1B6ZkgCU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/e6297438-0999-4320-916e-f41d74671533%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/003001d352ac%24d3f24980%247bd6dc80%24%40autoartisans.com.
CAN1 and CAN2 are available when you aren’t using any other cape and I think eiher HDMI or perhaps it’s the LCD interface. It’s been a while. There is no relationship between /dev/ttyUSB0 and the CAN devices. One requires a CAN driver to function while the other is purely a serial port like a UART.
To get 5 CAN ports I chose the Freescale 9S12 series. I think ST Micro also makes an ARM compatible processor with 4 CAN ports. There aren’t a lot around.
If you want higher speed access along with message interrupts than what you can get with USB FTDI based CAN connections your alternative approach will be to add Microchip MCP2515s on board and use the SPI bus interface. With 3 select lines to a 3:8 mux you can select one of 4 CAN devices, and wire-OR the interrupts. You just have to poll which one caused the interrupt. I believe there is a driver for the MCP2515 already in the Beagle CAN library.
Alternatively, since you are already building a cape that has CAN drivers on it and you now you want at least 2 more CAN devices it may be easier to use a second processor that has two CAN ports. Write the firmware to look like an SPI based MCP2515 and you can use the stock Beagle CAN driver for it.
In fact, use either the ST Micro ARM and make all the CAN ports on it appear as if they were MCP2515s and that then frees up your other pins on the Beagle.
John
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/48C2AA15-9F29-44DD-BE79-5122B54449C2%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/009501d35326%24bfafaba0%243f0f02e0%24%40autoartisans.com.
I have no idea what this dongle would cost but they claim linux compatibility.
As for your question about both CAN working. It all depends on what other I/O is enabled.
Perhaps this link will help.
http://www.embedded-things.com/bbb/enable-canbus-on-the-beaglebone-black/
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/E6DEF846-36DD-44B0-A7A3-F844799CFC4C%40gmail.com.