Page 1 of 1

questions on PCANbasic on Linux (Raspberry Pi)

Posted: Fri 23. Aug 2024, 00:29
by crane
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

Re: questions on PCANbasic on Linux (Raspberry Pi)

Posted: Fri 23. Aug 2024, 09:57
by PEAK-Support
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)

Re: questions on PCANbasic on Linux (Raspberry Pi)

Posted: Fri 23. Aug 2024, 17:11
by crane
Ok thanks!

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

Regards,
Crane

Re: questions on PCANbasic on Linux (Raspberry Pi)

Posted: Sat 24. Aug 2024, 09:15
by PEAK-Support
Topic closed - all answers are part of the manuals.