Community
cancel
Showing results for 
Search instead for 
Did you mean: 
idata
Community Manager
881 Views

Building and running C++ programs from the command line

I seem to be able to build C++ programs from the command line (on the Joule 570) with something like this

g++ -pthread -Wall -Wextra -pedantic -ansi -std=c++1y -ggdb -m64 --sysroot= -m64 -march=corei7 -I/usr/include/upm -I/usr/include/mraa -c myProg.cpp

# other stuff trimmed

g++ objectFiles.o -o myProg -lmraa -lpthread

but when I run and try to use the SPI I get

$ ./myProg

 

Error initialising SPI bus

This seems to work fine from Eclipse under Ubuntu using that system. Any ideas what's missing from the command line to get programs to work?

I'm running these versions

$ uname -a

 

Linux intel-corei7-64 4.4.15-yocto-standard # 1 SMP PREEMPT Fri Aug 12 22:04:24 UTC 2016 x86_64 GNU/Linux

$ mraa-gpio version

 

Version v1.5.1-1-gd043faf on Intel GT Tuchuck

Thanks.

0 Kudos
4 Replies
idata
Community Manager
28 Views

Hi Sarir,

Thanks for your interest in the Intel Joule Platform.

Could you please refer to this thread ( ) a user had the same problem as you. Please try to first update your mraa library first and then use the sample code given in the thread. I hope you find this information useful.

I will be waiting for your reply, have a nice day.

Best Regards,

 

-Jose.
idata
Community Manager
28 Views

 

Hi Sarir,

 

 

Were you able to use the SPI interface with the Intel Joule Platform? Please let me know in order to assist you.

 

 

Hope you have a nice day!

 

 

Best Regards,

 

-Jose.
idata
Community Manager
28 Views

I think I have the latest MRAA library: 1.1.5-1, from the command "mraa-gpio version" (for some reason I can't paste into this window).

It still doesn't work.

idata
Community Manager
28 Views

Hi Sarir,

 

 

I'm sorry for the late reply, what error did you get when you try the sample code given in my previous reply? Please let me know in order to assist you.

 

 

I will be waiting for your reply, have a nice day!

 

 

Best Regards,

 

-Jose.
Reply