SPI API Legato Tutorial dead end?


#1

Hey guys,

I’ve been working to get SPI communicating to an MCP3008 (8-channel ADC) and am really struggling.

I have followed the instructions on Setup SPI on the Legato webpage: http://legato.io/legato-docs/latest/howToSPI.html and when I try to do the very last step, app start spisvc
I get “Application spisvc is not installed”. I’m wondering if the steps in the instructions are perhaps not complete? See screenshot attached to see the logs.

I also had to reference a MangOH forum post when following the Legato ‘howToSPI’ steps when my KO file originally wouldn’t compile, I had the exact same problems as the gentleman who wrote the post. SPI on mangOH Green.

I then aborted trying to use the Legato built-in SPI API and tried using the SpiService and SpiTest demo code in github https://github.com/mangOH/SpiTest/blob/master/spiTest.adef. It looks like the SpiTest code uses the MuxCtrlService… Is using the MuxCtrlService required on the MangOH red’s IOT0 SPI pins? Or will this not be required if I can get the built-in legato spisvc working?

My most recent attempt to send/receive data over SPI has been using the SPI interface API at ${LEGATO_ROOT}/interfaces/le_spi.api, which I figured would be the most promising… But I have been out of luck on that too.

Overall I’m now completely lost on how I would send a basic SPI message over the IOT0 SPI pins on the MangOH Red.


#2

For reference, my forked version of the SPI code can be found here: https://github.com/coastalbrandon/SpiTest

The code has been intended to use the SpiService provided in the Legato framework at the following location ${LEGATO_ROOT}/interfaces/le_spi.api as mentioned in my previous post. I still am assuming this is the SPI api that I should be using.

If anyone has a moment to review my github fork I would really appreciate it. The application compiles and I can run it, but I don’t even see the first LE_INFO output of ===========> SPI application has started… Which perhaps should be a sign.


#3

Are you using the VM or the getting started instructions to setup your computer?
If so, we will do a small update to the sdef tomorrow that should allow the spisvc to be prebuilt.


#4

I’m using the VM.

Thanks!


#5

Can you update your git and follow the instructions:


#6

Thanks! I managed to get my SPI connection working a couple of hours ago - it brought me great pain… But I definitely learned a lot about the legato file structure over the past 24 hours!

I’ll keep the GIT around in case anyone else wants to expand to 8 analog inputs on the mangoh red with an MCP3008.