questions on PCANbasic on Linux (Raspberry Pi)

This forum covers PCAN-Linux and Linux development issues concerning our products
Locked
crane

questions on PCANbasic on Linux (Raspberry Pi)

Post by crane » Fri 23. Aug 2024, 00:29

Hello,

I am trying to develop an application based on Linux driver on Raspberry Pi 3B using PEAK PCAN-USB Pro.

Attached are the pictures of both sides of the product I am using.

The questions are:
1. After installing the driver of netdev mode and connecting the device, both chardev node in /dev and netdev link from "ip link show" seem available. Is it normal or something is wrong?
The attached photo pcan-devices.png shows this.

2. When using the C example from the package PCAN-Basic_Linux-4.8.0.5.tar.gz downloaded from this link https://www.peak-system.com/PCAN-Basic.239.0.html?&L=1 to write and read CAN messages (use CAN1 to read and CAN2 to write), I can see these as in attached picture pcan-read-write.png.
a) number of read and write are increasing
b) both channels are active with the same data rate
c) messages on the bus on both channels (from scope)
But the function CAN_read always return empty.
What might be the cause of this?

3. When calculating bit rate, the attached picture pcan-canfd-bitrate.png shows what's in the help document.
It seems the formula is bit_rate = (clock_frequency)/(prescaler * (nom_tse1 + nom_tseg2 + nom_sjw)). Is it the correct formula that data_sjw is also involved in the calculation?

4. Any example for the application which uses socketCAN to read and write?

Thanks!
Crane
Attachments
CANFD bit rate parameter
CANFD bit rate parameter
pcan-canfd-bitrate.png (30.43 KiB) Viewed 2672 times
PCAN result of reading and writing
PCAN result of reading and writing
pcan-read-write.png (79.36 KiB) Viewed 2675 times
PCAN devices
PCAN devices
pcan-devices.png (84.48 KiB) Viewed 2675 times

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: questions on PCANbasic on Linux (Raspberry Pi)

Post by PEAK-Support » Fri 23. Aug 2024, 09:57

This is a forum - short questions short answers - please contact the support if you have a huge list of questions.
I also removed the pictures with the serial number of the device.

Using PCAN-Basic on Linux - you NEED to use the CharDev driver !! it is not possible to use this API with NetDev !!
See manual - install CharDev Driver and run sample code (which is alsp part of the package)
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

crane

Re: questions on PCANbasic on Linux (Raspberry Pi)

Post by crane » Fri 23. Aug 2024, 17:11

Ok thanks!

It is the email support@peak-system.com that I should contact, right?

Regards,
Crane

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: questions on PCANbasic on Linux (Raspberry Pi)

Post by PEAK-Support » Sat 24. Aug 2024, 09:15

Topic closed - all answers are part of the manuals.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Locked