receivetest not working on Android 4.2.2

This forum covers PCAN-Linux and Linux development issues concerning our products
HSBO_BenjaminB
Posts: 10
Joined: Fri 17. Oct 2014, 13:29

receivetest not working on Android 4.2.2

Post by HSBO_BenjaminB » Thu 23. Oct 2014, 12:16

Hello everybody,

my name is Benjamin and I'm currently working on my Bachelor thesis using your Peak PCAN-USB Interface. The bus is connected to my Windows 7 (64Bit) PC and a Texas Instruments AM335x Evaluation Module running Android version 4.2.2 (Kernel version 3.2.0). I have downloaded the SDK for the board from the TI-website and used the document "howto-pcan_for_Android.pdf", which can be found here in the forum, to cross-compile your driver and test programs.

I am using HTerm as the terminal on the Evaluation Module and PCAN-View on my Windows PC to send and receive messages. Both are connecting with 500kBit. While using "transmitest", everything works like a charm. I can also use echo to send messages without any problem at all. Every message can be seen in PCAN-View. My huge problem is the other way around. When sending messages using PCAN-View, "receivetest" does not show any data at all. I've already searched for a solution in the forum but was unable to find one, so I'd like to provide some data which is almost always asked for when problems occur. I hope that helps.

Product: 2x PEAK Pcan USB
Connected to: Windows 7 (64Bit) PC, Texas Instruments AM335X Evaluation Module running Android 4.2.2
Tools Used: HTerm, PCAN-View, transmitest, receivetest
PCAN driver version: 7.12

Loading the driver:

Code: Select all

insmod /data/media/0/Download/pcan.ko

pcan: Release_20140723_n (le)
pcan: driver config [mod] [usb]
pcan: new usb adapter with 1 CAN controller(s) detected
pcan: usb hardware revision = 28
pcan: usb device minor 32 found
usbcore: registered new interface driver pcan
pcan: major 247.
cat /proc/pcan

Code: Select all

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20140723_n (7.12.0) Oct 13 2014 13:06:16 --------------
*------------------------------- [mod] [usb] --------------------------------
*--------------------- 1 interfaces @ major 247 found -----------------------
*n -type- ndev --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32    usb -NA- ffffffff 255 0x001c 00000000 00000000 00000000 00000000 0x0000
./receivetest -f=/dev/pcanusb0 (BEFORE sending CAN data from the PC)

Code: Select all

receivetest: device node="/dev/pcanusb0"
             Only standard frames are accepted, init with 500 kbit/sec.
receivetest: driver version = Release_20140723_n
^C
receivetest: type            = usb
             Serial Number   = 0xffffffff
             Device Number   = 255
             count of reads  = 0
             count of writes = 0
             count of errors = 0
             count of irqs   = 0
             last CAN status = 0x0020
             last error      = 0
             open paths      = 1
             driver version  = Release_20140723_n
receivetest: finished (0).
./receivetest -f=/dev/pcanusb0 (AFTER sending CAN data from the PC)

Code: Select all

receivetest: device node="/dev/pcanusb0"
             Only standard frames are accepted, init with 500 kbit/sec.
receivetest: driver version = Release_20140723_n
^C
receivetest: type            = usb
             Serial Number   = 0xffffffff
             Device Number   = 255
             count of reads  = 0
             count of writes = 0
             count of errors = 0
             count of irqs   = 0
             last CAN status = 0x0020
             last error      = 0
             open paths      = 1
             driver version  = Release_20140723_n
receivetest: finished (0).
ls -l /dev/ |grep pcan

Code: Select all

crwxrwxrwx root     root     180,  32 2000-01-01 00:03 pcanusb0
Since we use Linux rarely over here and because this is my first contact with the CAN-bus, I don't know what to look for anymore. Any help would be greatly appreciated.

Kind regards,
Benjamin

M.Maidhof
Support
Support
Posts: 1753
Joined: Wed 22. Sep 2010, 14:00

Re: receivetest not working on Android 4.2.2

Post by M.Maidhof » Thu 23. Oct 2014, 12:35

Hi,

what kind of CAN frames (standard 11bit or extended 29bit) do you transmit with PCAN-View?

regards

Michael

HSBO_BenjaminB
Posts: 10
Joined: Fri 17. Oct 2014, 13:29

Re: receivetest not working on Android 4.2.2

Post by HSBO_BenjaminB » Thu 23. Oct 2014, 13:37

Hello Michael,

well, as far as I know it should only be standard frames. When I edit the message, the checkboxes for "Extended Frame" and "Remote Request" are not checked. I' change between message IDs 001h and 002h, DLC is set to 8, the message is "01 02 03 04 05 06 07 08". I hope I'm not messing with standard and extended frames.

M.Maidhof
Support
Support
Posts: 1753
Joined: Wed 22. Sep 2010, 14:00

Re: receivetest not working on Android 4.2.2

Post by M.Maidhof » Thu 23. Oct 2014, 16:46

Hi,

ok, standard frames are ok, due to the fact that receivetest was only configured for standard frames. Can you please post the output of dmesg |grep pcan and dmesg |grep peak

regards

Michael

HSBO_BenjaminB
Posts: 10
Joined: Fri 17. Oct 2014, 13:29

Re: receivetest not working on Android 4.2.2

Post by HSBO_BenjaminB » Mon 27. Oct 2014, 12:00

Hi,

sorry for the late reply. Of course, here are the outputs:

Code: Select all

dmesg |grep pcan

<6>[  294.188201] pcan: Release_20140723_n (le)
<6>[  294.192413] pcan: driver config [mod] [usb]
<6>[  294.199127] pcan: new usb adapter with 1 CAN controller(s) detected
<6>[  294.205841] pcan: usb hardware revision = 28
<6>[  294.265350] pcan: usb device minor 32 found
<6>[  294.269927] usbcore: registered new interface driver pcan
<6>[  294.275634] pcan: major 247.
and

Code: Select all

root@android:/data/media/0/Download # dmesg |grep peak

1|root@android:/data/media/0/Download
uhm, the last one does not seem to do anything at all, except for the "1" right at the beginning of the next line?

User avatar
S.Grosjean
Software Development
Software Development
Posts: 357
Joined: Wed 4. Jul 2012, 17:02

Re: receivetest not working on Android 4.2.2

Post by S.Grosjean » Mon 27. Oct 2014, 13:40

Hello Benjamin,

My name is Stéphane and I will try to help you to move forward on solving this problem.

First, could you please download the last version of the pcan driver available from our website. This version (7.13) fixes some USB related things, so I'd like first to start from a known, common and stable state.

If the issue always exists, could you please rebuild the "pcan" driver with the DBG option:

Code: Select all

$ make DBG=DEBUG ...
(Well, to be more precise, the "DBG" option is to be added to all the other options that are mandatory for pcan to be built for Android)

and send us the output of:

Code: Select all

$ dmesg | grep pcan
Thanks in advance,
Regards,

Stéphane
— Stéphane

HSBO_BenjaminB
Posts: 10
Joined: Fri 17. Oct 2014, 13:29

Re: receivetest not working on Android 4.2.2

Post by HSBO_BenjaminB » Mon 27. Oct 2014, 13:47

Hello Stéphane,

thank you very much for your assistance! I'll try cross compile the new driver. Sadly, I'm kind of a Linux newbie, so I hope I don't make any mistakes during the process. I'll get back to you as soon as I have tested the new driver.

Thanks a lot in advance!
Regards,
Benjamin

HSBO_BenjaminB
Posts: 10
Joined: Fri 17. Oct 2014, 13:29

Re: receivetest not working on Android 4.2.2

Post by HSBO_BenjaminB » Tue 28. Oct 2014, 11:16

Hi,

I've downloaded the driver version 7.13 yesterday, but I still can't see any CAN messages. So I've tried compiling the driver with the debug switch turned on and during compilation, I found the following error in the output:

Code: Select all

Compilerfehler beim PCAN-Treiber-Compilieren:
make[1]: Betrete Verzeichnis '/home/benjamin/TI_Android_JB_4.2.2_DevKit_4.1.1/kernel'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (		\
	echo;								\
	echo "  ERROR: Kernel configuration is invalid.";		\
	echo "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
	echo "         Run 'make oldconfig && make prepare' on kernel src to fix it.";	\
	echo;								\
	/bin/false)
So I guess my kernel is configured wrong? That would actually be pretty silly, since I used a default configuration file that came with the kernel sources for the board. Also, if I run the mentioned command, I have to configure the kernel manually, which I'm absolutely not able to.

Any idea?

User avatar
S.Grosjean
Software Development
Software Development
Posts: 357
Joined: Wed 4. Jul 2012, 17:02

Re: receivetest not working on Android 4.2.2

Post by S.Grosjean » Tue 28. Oct 2014, 11:46

Hi Benjamin,

So, to summarize: you're able to compile pcan driver v7.13 but you aren't able to compile it with DBG=DEBUG, are you?

Did you change the "KERNEL_LOCATION =" variable in the new 7.13 driver Makefile too?

Could you please give me the "make" command line you used to build the non-DEBUG version as well as the full output of this "make" command? Same for the DBG=DEBUG build, please...

Regarding your Kernel config, please, upload it as attachment to your reply. This is the ".config" file located in the root directory of your Kernel.

Regards,

Stéphane
— Stéphane

HSBO_BenjaminB
Posts: 10
Joined: Fri 17. Oct 2014, 13:29

Re: receivetest not working on Android 4.2.2

Post by HSBO_BenjaminB » Tue 28. Oct 2014, 12:29

It seems like I messed up the kernel files from the board yesterday, since I'm only getting an error message, that the file "version.h" is missing (which it is indeed) when trying to configure the kernel. I'm very sorry, but I'll redownload the files and then try to configure everything again, so that I'm able to cross compile again.

As for your questions: I think it compiled with both DEBUG and NO_DEBUG option. The error message I saw was just at the beginning of all other output. I'll try that again once the kernel is fixed.

Yes, I changed the KERNEL_LOCATION and all other necessary switches in the makefile, as it is explained in the "hotwo-pcan_for_Android.pdf" file. As described in the document, I only use "make". I'm trying to attach the makefile to this post, but it looks like neither "makefile" nor "makefile.txt" are allowed for uploading. Which file endings can I use to upload files?

I'll also post the kernel .config file once I've fixed my kernel issues.

Post Reply