Community
cancel
Showing results for 
Search instead for 
Did you mean: 
ABhag
Beginner
1,010 Views

Intel Joule;Ubuntu 16.04;mraa;SPI not working

Platform

Board:Intel Joule 570X Expansion Board

OS:

uname -a

Linux scout-570x-DVT3 4.4.0-1000-joule # 0+joule12-Ubuntu SMP PREEMPT Fri Jan 6 04:28:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 16.04.1 LTS

Release: 16.04

Codename: xenial

MRAA

mraa-gpio version Version v1.7.0-11-g47c21e0 on INTEL JOULE EXPANSION

Program:Source

# include "mraa.h"

# include

# include

# include

int main(int argc, char** argv)

{ mraa_init();

//! [Interesting]

mraa_spi_context spi;

spi = mraa_spi_init(0);

printf("Hello, SPI initialised\n");

std::cout<<"spi init"< uint8_t data[] = { 0x00, 0x32 };</span>

uint8_t* recv;

std::cout<<"assigning data"< int i=90;</span>

data[1] = i;

std::cout<<"spi write coming up"< recv = mraa_spi_write_buf(spi, data, 2);</span>

if (recv==NULL)

std::cout<<"error in writing"< printf("Writing -%i\n", i);</span>

//printf("RECIVED-%i-%i\n", recv[0], recv[1]);

usleep(100000);

<span style="color: # 24292e; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbo...

0 Kudos
4 Replies
idata
Community Manager
76 Views

Hi Akshay,

 

 

Thanks for your interest in the Intel Joule platform.

 

 

Regarding that issue with the SPI, we have tested it using the Ref-OS-IoT image and we also have had issues with the SPI port, however, we'd like to let you know that currently we are working diligently in order to solve it, nevertheless, we do not have an ETA for this fix.

 

 

We understand you are using Ubuntu, but please keep in mind that we are now working on fixing this in the Ref-OS-IoT, these changes may or may not apply to other non-supported images.

 

 

Our apologies for the inconvenience it may cause.

 

 

Regards,

 

-Yermi A.

 

FGold
New Contributor II
76 Views

Akshay,

Have you tried spi-gpio-custom.c?

It is extremely slow, but at least appears to work.

bwang40
Beginner
76 Views

Hello!

I also use Ubuntu 16.04, but I cant include " # include "mraa.h" ", do I need download something or include other .hpp?

Thanks

-noda

FGold
New Contributor II
76 Views

Boda,

Have you installed mraa, and verified install?

https://github.com/intel-iot-devkit/mraa GitHub - intel-iot-devkit/mraa: Linux Library for low speed IO Communication in C with bindings for C++, Python, Node.js…

Installing on your boardhttps://github.com/intel-iot-devkit/mraa# installing-on-ubuntu https://github.com/intel-iot-devkit/mraa# installing-on-ubuntuInstalling on Ubuntu

Here is a PPA for installing on ubuntu: https://launchpad.net/~mraa/+archive/ubuntu/mraa https://launchpad.net/~mraa/+archive/ubuntu/mraa

sudo add-apt-repository ppa:mraa/mraa

 

sudo apt-get update

 

sudo apt-get install libmraa1 libmraa-dev mraa-tools python-mraa python3-mraa

 

 

....

Then verify:

- MRAA:

$ mraa-gpio version

 

Version v1.5.1 on Intel GT Tuchuck
Reply