Home/Support/Support Forum/Connectcore can_test
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Connectcore can_test

0 votes
Hi,
I am trying to use the connectcore 6 I just bought.
I wrote the image from the digi website on an SD-card and manage to boot it. Now I would like to test des CAN and the GPIO of the card but I can't. I follow the instruction from this document: http://ftp1.digi.com/support/documentation/90001424_B.pdf

I tried first with the CAN. I download the file can_test from github and compile it with gcc from my ubuntu vm. Then I copy the executable on the card and tried to execute it :
./can_test -l 1 -b 8 -d can0 -i 0x12 -p 0x65 -m
But I got an error : syntax error: unexpected end of line

Is there an other tutorial for beginner for the connectcore 6?

Thanks for your help :)
asked Jun 12, 2015 in Linux by digiConnectcore6 New to the Community (2 points)

Please log in or register to answer this question.

1 Answer

0 votes
something is wrong with your executable I suspect.
How did you compile it?
you need to crosscompile it using arm-alf-gcc so it will work on arm platform. Isuspect that you have compiled it using native gcc on your ubuntu so it's for x86 platform instead.
on ubundu type
file can_test
and it will tell you what kind of file this is.
answered Jun 12, 2015 by LeonidM Veteran of the Digi Community (3,507 points)
I did : arm-linux-gnueabi-gcc can_test.c -o can_test -pthread
and I have the error: ./can_test not found
This is the informations about the file
can_test: ELF 32-bit LSB  executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0eb7800d88bc6c074c8f728d7075880236c30b8a, not stripped
>and I have the error: ./can_test not found
is this error on target?
can you do ls -la ./
what are the permissions of the executable? Are they set correctly?
yes I have the permission to execute it. I made a chmod 777 and execute it. I still have :
/bin/sh : ./can_test : not found

If execute it in sudo mode, I have  the error:
sudo : unable to execute ./can_test : No such file or directory
Are there other way to crosscompile the programme? I think I don't compile it the right way. Is the commande I used the right one? I still didn't solve this problem :/
Yes, it does look like a crosscompilation problem. Please try the instructions here with  "hello world" example:
http://labs.isee.biz/index.php/How_to_setup_a_cross_compiler
Using Poky generated host SDK
=============================

How to build host SDK
====

You need to setup Poky and then run one command:

$ bitbake meta-toolchain

Result would be tarball in tmp/deploy/sdk/ with everything needed to build for
your target device. Unpack this in / directory - toolchain will reside in
/usr/local/poky/arm/ dir.

Usage of SDK
=====

First add toolchain into PATH:

$ export PATH=/usr/local/poky/arm/bin/:$PATH

Compiler is 'arm-poky-linux-gnueabi-gcc'. Building 'helloworld' example is
simple:

$ arm-poky-linux-gnueabi-gcc hello.c -o hello
$ file hello
hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), not stripped
I already tried with a Hello world and I have the same error...
have you tried the instructions above?
when I try todo the bitbake, I have this error:
NOTE: Started PRServer with DBfile: /home/adi/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 53582, PID: 3535
ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    Failed to fetch test data from the network. Please ensure your network is configured correctly.

ERROR: Execution of event handler 'check_sanity_eventhandler' failed
ERROR: Command execution failed: Exited with 1

Summary: There were 3 ERROR messages shown, returning a non-zero exit code.

How should I setup poky? Maybe that's what I am doing wrong
...