# MangOH Red , spidev0.0 after reboot not starts

**URL:** <https://mangoh.discourse.group/t/mangoh-red-spidev0-0-after-reboot-not-starts/773>\
**Category:** mangOH Red\
**Created:** [September 29, 2017, 12:58pm UTC](https://mangoh.discourse.group/t/mangoh-red-spidev0-0-after-reboot-not-starts/773 "2017-09-29T12:58:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AE\_1](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@AE\_1](https://mangoh.discourse.group/u/AE_1)\
**Post date:** [September 29, 2017, 12:58pm UTC](https://mangoh.discourse.group/t/mangoh-red-spidev0-0-after-reboot-not-starts/773/1 "2017-09-29T12:58:48Z")

</div>

Hello all,  
I am working on MangOH RED + WP8548 + Legato 17.08.0  
After reboot of my MangOH Red, spidev0.0 does not start automatically.  
I have to give after each reboot:  
modprobe spidev  
insmod spisvc.ko

How can I solve this issue?

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [September 29, 2017, 4:03pm UTC](https://mangoh.discourse.group/t/mangoh-red-spidev0-0-after-reboot-not-starts/773/2 "2017-09-29T16:03:37Z")

</div>

The latest mangOH\_Red.sdef mentions spisvc, so the loading of that module should be taken care of by legato automatically. If you want to get spidev loaded automatically, then you need to add it to `/etc/modules`. There are two ways to do this.

1. login to your mangOH and edit the `/etc/modules` file
2. Modify `meta-swi/meta-swi-mdm9x15/recipes-core/base-files/base-files` in the yocto tree and rebuild yocto and flash the new image to your system.

---

<div class="post-metadata">

**Author:** ![basti](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@basti](https://mangoh.discourse.group/u/basti)\
**Post date:** [February 20, 2018, 6:47am UTC](https://mangoh.discourse.group/t/mangoh-red-spidev0-0-after-reboot-not-starts/773/3 "2018-02-20T06:47:34Z")

</div>

Hi @dfrey,

When adding spidev to `/etc/modules` I still have to manually start spiService. During boot when spiService starts, it gives error:

> Feb 19 13:20:46 | supervisor[3403]/supervisor T=main | app.c GetDevID() 644 | Could not get file info for ‘/dev/spidev0.0’. No such file or directory.  
> Feb 19 13:20:46 | supervisor[3403]/supervisor T=main | app.c SetCfgDevicePermissions() 754 | Failed to set permissions (rw) for app ‘spiService’ on device ‘/dev/spidev0.0’.

But after it has booted you can start spiService without any configuration. If I am correct, `/etc/modules` should initialize during boot as well. What could be happening here? I have been unable to find any answer to this anywhere. Thanks!

---

<div class="post-metadata">

**Author:** ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/nick/32/1380_2.png) [@nick](https://mangoh.discourse.group/u/nick)\
**Post date:** [February 20, 2018, 6:17pm UTC](https://mangoh.discourse.group/t/mangoh-red-spidev0-0-after-reboot-not-starts/773/4 "2018-02-20T18:17:10Z")

</div>

Hey @basti,

I believe I have figured out this problem. Please read my post here: [SPI service sometimes fails to start when run in sandbox mode](http://mangoh.discourse.group/t/spi-service-sometimes-fails-to-start-when-run-in-sandbox-mode/1177)

You can “solve” this problem by modifying `$LEGATO_ROOT/apps/platformServices/spiService.adef` to specify `sandbox: false` and removing or commenting the the `requires` section for `/dev/spidev0.0` (see [gist](https://gist.github.com/nvandoorn/4b241563874e7c48a93eb894d47046c3)). Clean and re-compile Legato for good measure.

Keep in mind this compromises security to some extent. A better solution would involve waiting for `/dev/spidev0.0` to be ready before starting the supervisor as discussed in the post above.

---

<div class="post-metadata">

**Author:** ![basti](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@basti](https://mangoh.discourse.group/u/basti)\
**Post date:** [February 21, 2018, 6:52am UTC](https://mangoh.discourse.group/t/mangoh-red-spidev0-0-after-reboot-not-starts/773/5 "2018-02-21T06:52:06Z")

</div>

Hi @nick,

Thank you very much for this! I have been unable to find an answer for this anywhere (except for some possible fixes involving rebuilding Yocto which I did not have time to test). This actually did solve the issue and spiService can now start automatically.  
The security part is not that important for me right now, only building some demo apps and testing out the legato framework. But I will keep that in mind!

---

<div class="post-metadata">

**Author:** ![TheGod](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/thegod/32/504_2.png) [@TheGod](https://mangoh.discourse.group/u/TheGod)\
**Post date:** [February 9, 2019, 8:52pm UTC](https://mangoh.discourse.group/t/mangoh-red-spidev0-0-after-reboot-not-starts/773/6 "2019-02-09T20:52:57Z")

</div>

Hi,  
I have installed 18.06.4 on mangOH Red (WP8548).  
Typed command in console:  
config set /apps/spiService/startManual false bool

SPI service starts automatically on boot.
