How to Use CAN CAPE for Beaglebone Black?


#21

@dpengsberg, for this application and timing requirement, I’d use the PRUSS subsystem.

However, once you start looking into this sub-system, I need to stay out of the current “uio_pruss” vs the TI “remoteproc_pruss” holy war going on in the BeagleBoard.org forums…

So take a look at, these projects, and decide what you need:

https://elinux.org/ECE497_BeagleBone_PRU

http://processors.wiki.ti.com/index.php/PRU_Training:_Hands-on_Labs

Regards,


#22

Hi Robert,

I have several new of the BB Black and CAN Capes. I am trying to document the process for setting up the Beagle to recreate the entire working and development environment, because we will be building about 20 of these per week. I have a working compiled C program made from modifying the candump.c program. I am using the most recent IoT image. bone-debian-9.5-iot-armhf-2018-10-07-4gb

If I boot from a freshly burned sd card and try to configure the CAN pins p9.24 and .26 ( using config-pin p9.24 can) I receive a “P9_24 pinmux file not found!” error message. At this I never seem to be able to get rid of this error condition, even though I have built several others that work just fine. I can’t say exactly how I built them differently, but it must be something because they work.

Can you help me configure these pins to be CAN so they configure properly every time automatically?

Thanks,

Dave

RobertCNelson
Applications Engineer

    February 19

alt dpengsberg:
Can you tell me what I need to do to my Beaglebone Black with the CAN Cape to get the code candump.c to actually run?


sudo apt update
sudo apt install build-essential cmake git ninja-build
git clone https://github.com/linux-can/can-utils
cd ./can-utils/
mkdir build
cd ./build/
cmake -GNinja .. && ninja

  ebian@beaglebone:~/can-utils$ cd build/
debian@beaglebone:~/can-utils/build$ cmake -GNinja .. && ninja
-- The C compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/debian/can-utils/build
[48/63] Building C object CMakeFiles/c...bit-timing.dir/can-calc-bit-timing.c.o
/home/debian/can-utils/can-calc-bit-timing.c: In function ‘print_bit_timing’:
/home/debian/can-utils/can-calc-bit-timing.c:447:35: warning: ‘tseg1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
unsigned int brp, tsegall, tseg, tseg1, tseg2;
^~~~~
/home/debian/can-utils/can-calc-bit-timing.c:447:42: warning: ‘tseg2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
unsigned int brp, tsegall, tseg, tseg1, tseg2;
^~~~~
[63/63] Linking C executable isotpsniffer
debian@beaglebone:~/can-utils/build$ ls
asc2log canlogserver isotprecv libcan.a
bcmserver canplayer isotpsend libj1939.a
build.ninja cansend isotpserver log2asc
canbusload cansniffer isotpsniffer log2long
can-calc-bit-timing CMakeCache.txt isotptun rules.ninja
candump CMakeFiles jacd slcan_attach
canfdtest cmake_install.cmake jcat slcand
cangen isotpdump jspy slcanpty
cangw isotpperf jsr testj1939

Regards,


#23

One more thing on the error message, after the "P9_24 pinmux file not found! "

it says

“Pin has no cape: P9_24”

But I do have the cape plugged in.

Hi Robert,

I have several new of the BB Black and CAN Capes. I am trying to document the process for setting up the Beagle to recreate the entire working and development environment, because we will be building about 20 of these per week. I have a working compiled C program made from modifying the candump.c program. I am using the most recent IoT image. bone-debian-9.5-iot-armhf-2018-10-07-4gb

If I boot from a freshly burned sd card and try to configure the CAN pins p9.24 and .26 ( using config-pin p9.24 can) I receive a “P9_24 pinmux file not found!” error message. At this I never seem to be able to get rid of this error condition, even though I have built several others that work just fine. I can’t say exactly how I built them differently, but it must be something because they work.

Can you help me configure these pins to be CAN so they configure properly every time automatically?

Thanks,

Dave

RobertCNelson
Applications Engineer

    February 19

alt dpengsberg:
Can you tell me what I need to do to my Beaglebone Black with the CAN Cape to get the code candump.c to actually run?


sudo apt update
sudo apt install build-essential cmake git ninja-build
git clone https://github.com/linux-can/can-utils
cd ./can-utils/
mkdir build
cd ./build/
cmake -GNinja .. && ninja

  ebian@beaglebone:~/can-utils$ cd build/
debian@beaglebone:~/can-utils/build$ cmake -GNinja .. && ninja
-- The C compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/debian/can-utils/build
[48/63] Building C object CMakeFiles/c...bit-timing.dir/can-calc-bit-timing.c.o
/home/debian/can-utils/can-calc-bit-timing.c: In function ‘print_bit_timing’:
/home/debian/can-utils/can-calc-bit-timing.c:447:35: warning: ‘tseg1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
unsigned int brp, tsegall, tseg, tseg1, tseg2;
^~~~~
/home/debian/can-utils/can-calc-bit-timing.c:447:42: warning: ‘tseg2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
unsigned int brp, tsegall, tseg, tseg1, tseg2;
^~~~~
[63/63] Linking C executable isotpsniffer
debian@beaglebone:~/can-utils/build$ ls
asc2log canlogserver isotprecv libcan.a
bcmserver canplayer isotpsend libj1939.a
build.ninja cansend isotpserver log2asc
canbusload cansniffer isotpsniffer log2long
can-calc-bit-timing CMakeCache.txt isotptun rules.ninja
candump CMakeFiles jacd slcan_attach
canfdtest cmake_install.cmake jcat slcand
cangen isotpdump jspy slcanpty
cangw isotpperf jsr testj1939

Regards,