# How to build MCP2515 CANBus drivers for mangOH

**URL:** <https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196>\
**Category:** Uncategorized\
**Created:** [August 17, 2016, 11:36pm UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196 "2016-08-17T23:36:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![asyal](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/asyal/32/78_2.png) [@asyal](https://mangoh.discourse.group/u/asyal)\
**Post date:** [August 17, 2016, 11:36pm UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/1 "2016-08-17T23:36:56Z")

</div>

> **[mangOH/mangOH](https://github.com/mangOH/mangOH/wiki)**
>
> Primary mangOH git repository. Contribute to mangOH/mangOH development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![niladridm](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/niladridm/32/91_2.png) [@niladridm](https://mangoh.discourse.group/u/niladridm)\
**Post date:** [September 18, 2016, 9:36am UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/2 "2016-09-18T09:36:22Z")

</div>

Hi Ashish  
is MCP2515-CAN-drivers available in FIrmware release 12 or we have to wait for another release?

Thanks

---

<div class="post-metadata">

**Author:** ![asyal](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/asyal/32/78_2.png) [@asyal](https://mangoh.discourse.group/u/asyal)\
**Post date:** [September 18, 2016, 1:49pm UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/3 "2016-09-18T13:49:02Z")

</div>

Hi Nila,  
There is no plan to add the driver. You will need to build driver as shown above.  
Cheers,  
Ashish

---

<div class="post-metadata">

**Author:** ![niladridm](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/niladridm/32/91_2.png) [@niladridm](https://mangoh.discourse.group/u/niladridm)\
**Post date:** [September 23, 2016, 3:24am UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/4 "2016-09-23T03:24:38Z")

</div>

Hi Asish,  
have a common question. Is MCP2515 Automotive Grade can controller?  
We are planning to use wp8548 in our telematics gateway where WP8548 is the main controller and have complete access to the can bus.  
Please let me know the limitations if we use spi to can controller (MCP2515). Please suggest better solution.

Thanks

---

<div class="post-metadata">

**Author:** ![asyal](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/asyal/32/78_2.png) [@asyal](https://mangoh.discourse.group/u/asyal)\
**Post date:** [September 23, 2016, 8:43pm UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/5 "2016-09-23T20:43:40Z")

</div>

Hi Nila,

Please use your own judgement to select parts that best meets you product requirements as you are best aware of them.

MCP2515 comes in automotive and industrial versions. Please select accordingly.  
You can look at sample code we made here:

> **[mangOH/Demos](https://github.com/mangOH/Demos/tree/master/KillSwitch)**
>
> Code for mangOH demos. Contribute to mangOH/Demos development by creating an account on GitHub.

regards,  
Ashish

---

<div class="post-metadata">

**Author:** ![niladridm](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/niladridm/32/91_2.png) [@niladridm](https://mangoh.discourse.group/u/niladridm)\
**Post date:** [October 10, 2016, 4:33pm UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/6 "2016-10-10T16:33:11Z")

</div>

Hi Ashish,  
I am not able to build and getting error while executing  
legato@legato-VirtualBox:~/yocto$ make image\_bin  
…

Error: bash is not set as default provider for /bin/sh  
build is not guaranteed to work, aborting  
Makefile:137: recipe for target ‘image\_bin’ failed  
make: \*\*\* [image\_bin] Error 1

and again

legato@legato-VirtualBox:~/yocto/build\_bin$ bitbake linux-yocto -c kernel\_configme f

WARNING: Host distribution “Ubuntu-16.04” has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.  
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:

```
Unable to execute git --version, exit code 32512

```

Please install the following missing utilities: makeinfo,git,gawk,chrpath  
libsdl-native is set to be ASSUME\_PROVIDED but sdl-config can’t be found in PATH. Please either install it, or configure qemu not to require sdl.

Summary: There was 1 WARNING message shown.  
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

Please help me on this.

Thanks

---

<div class="post-metadata">

**Author:** ![niladridm](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/niladridm/32/91_2.png) [@niladridm](https://mangoh.discourse.group/u/niladridm)\
**Post date:** [October 11, 2016, 2:38pm UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/7 "2016-10-11T14:38:52Z")

</div>

Hi,  
is anyone able to build the MCP2515 CAN driver? Is it possible to get the image with can driver?  
I have already purchased the CAN IOT but still not able to work on the same. Please help.

Thanks

---

<div class="post-metadata">

**Author:** ![asyal](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/asyal/32/78_2.png) [@asyal](https://mangoh.discourse.group/u/asyal)\
**Post date:** [October 11, 2016, 3:21pm UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/8 "2016-10-11T15:21:09Z")

</div>

Hi Nila,

Are you using the VM or a linux machine for this?

Ashish

---

<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:** [October 11, 2016, 3:42pm UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/9 "2016-10-11T15:42:50Z")

</div>

Hi niladridm,

I’m not sure if this is a requirement of yocto 1.7 or of some addition to yocto 1.7 that Sierra Wireless has made, but either way I know that the error is telling us that the build wants `/bin/sh` to point to `bash`.

First, I would to `ls -l /bin/sh` to see where `/bin/sh` is pointing. It’s typically a symlink. There is a [DashAsBinSh page on the Ubuntu wiki](https://wiki.ubuntu.com/DashAsBinSh) that provides a bunch of detail as to why Ubuntu now ships with `/bin/sh` pointing to `/bin/dash`. The important bit is that you should be able to switch from dash to bash by running `sudo dpgk-reconfigure dash`.

I think you can ignore the host distribution warning. I am personally using Debian, but I know there are people at Sierra building Yocto with Ubuntu 16.04.

---

<div class="post-metadata">

**Author:** ![niladridm](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/niladridm/32/91_2.png) [@niladridm](https://mangoh.discourse.group/u/niladridm)\
**Post date:** [October 11, 2016, 3:57pm UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/10 "2016-10-11T15:57:15Z")

</div>

Hi Ashish  
I am using VM Linux 16.04

Thanks

---

<div class="post-metadata">

**Author:** ![asyal](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/asyal/32/78_2.png) [@asyal](https://mangoh.discourse.group/u/asyal)\
**Post date:** [October 11, 2016, 7:37pm UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/11 "2016-10-11T19:37:59Z")

</div>

As mentioned by David, can you try the changes he mentioned? Can you try building on a real Linux machine and not VM.  
If you want to try VM, please use 16.07 VM (available on [mangoh.io](http://mangoh.io)) as plus the changes that Dave mentioned.

---

<div class="post-metadata">

**Author:** ![niladridm](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/niladridm/32/91_2.png) [@niladridm](https://mangoh.discourse.group/u/niladridm)\
**Post date:** [October 12, 2016, 5:24am UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/12 "2016-10-12T05:24:49Z")

</div>

Hi Asish,  
Now I am trying in Linux 16.04 System and after executing "sudo dpgk-reconfigure dash"  
1st problem solved (Error: bash is not set as default provider for /bin/sh) but i am still getting  
below error

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:

```
Please install the following missing utilities: makeinfo

```

libsdl-native is set to be ASSUME\_PROVIDED but sdl-config can’t be found in PATH. Please either install it, or configure qemu not to require sdl.

Please help

Thanks

---

<div class="post-metadata">

**Author:** ![asyal](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/asyal/32/78_2.png) [@asyal](https://mangoh.discourse.group/u/asyal)\
**Post date:** [October 12, 2016, 5:35am UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/13 "2016-10-12T05:35:42Z")

</div>

> [@niladridm](#):
>
> libsdl-native is set to be ASSUME\_PROVIDED but sdl-config can’t be found in PATH. Please either install it, or configure qemu not to require sdl.

What are you building your system on ? Ubuntu/Debian…?  
If you google this error, you will see there is enough info online:  
[https://wiki.gentoo.org/wiki/Yocto](https://wiki.gentoo.org/wiki/Yocto)

So, please fix the issue on your build machine as it seems there is incompatibility

---

<div class="post-metadata">

**Author:** ![niladridm](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/niladridm/32/91_2.png) [@niladridm](https://mangoh.discourse.group/u/niladridm)\
**Post date:** [October 12, 2016, 5:39am UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/14 "2016-10-12T05:39:08Z")

</div>

Hi  
Yes the problem is solved now. I have installed libsdl1.2-dev and the error disappeared now.  
sudo apt-get install libsdl1.2-dev

Thanks

---

<div class="post-metadata">

**Author:** ![niladridm](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/niladridm/32/91_2.png) [@niladridm](https://mangoh.discourse.group/u/niladridm)\
**Post date:** [October 12, 2016, 9:17am UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/15 "2016-10-12T09:17:44Z")

</div>

Hi Ashish,  
I am almost done and able to generate cwe file but not able to reflash the cwe file becase of below error (I am doing the same mentioned at step 9 Reflash new image with CAN driver module support to the target board  
FDT command: fdt yocto\_wp85.cwe  
)

linux@ubuntu:~/yocto/build\_bin/tmp/deploy/images/swi-mdm9x15$ fdt yocto\_wp85.cwe  
No command ‘fdt’ found, did you mean:  
Command ‘fmt’ from package ‘coreutils’ (main)  
Command ‘dt’ from package ‘ditrack’ (universe)  
Command ‘fd’ from package ‘fdclone’ (universe)  
Command ‘idt’ from package ‘ncl-ncarg’ (universe)  
Command ‘fdp’ from package ‘graphviz’ (main)  
Command ‘fdk’ from package ‘plastimatch’ (universe)  
Command ‘fet’ from package ‘fet’ (universe)  
Command ‘fdm’ from package ‘fdm’ (universe)  
fdt: command not found

Thanks

---

<div class="post-metadata">

**Author:** ![asyal](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/asyal/32/78_2.png) [@asyal](https://mangoh.discourse.group/u/asyal)\
**Post date:** [October 12, 2016, 2:34pm UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/16 "2016-10-12T14:34:42Z")

</div>

on linux machine try  
$ fwupdate download file.cwe 192.168.2.2  
where file.cwe is the name of the cwe file you want to download

you can also use fdt tool on windows. Open a cmd window and goto the folder where the fdt tool is:

fdt file.cwe

make sure fdt tool and file.cwe are in same folder. If not, you will need to write path to file.cwe

---

<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:** [October 12, 2016, 2:48pm UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/17 "2016-10-12T14:48:56Z")

</div>

If you’re still stuck, you can try using `swiflash` which is another way to load a CWE file into a mangOH. For a bit of context, fdt is a windows only tool. fwupdate is a script which uses the network connection to load the update. swiflash is basically the linux equivalent of fdt. The advantage of swiflash or fdt over fwupdate is that there are certain system states (network connection not working for example) which you can recover from using swiflash or fdt, but not fwupdate.

`wget http://updatesite.sierrawireless.com/legato-spm/debian/legato-spm.list -O - | sudo tee /etc/apt/sources.list.d/legato-spm.list wget http://updatesite.sierrawireless.com/legato-spm/debian/legato-spm.key -O - | sudo apt-key add - sudo apt-get update sudo apt-get install swiflash`

---

<div class="post-metadata">

**Author:** ![niladridm](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/niladridm/32/91_2.png) [@niladridm](https://mangoh.discourse.group/u/niladridm)\
**Post date:** [October 13, 2016, 6:33am UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/18 "2016-10-13T06:33:37Z")

</div>

Hi David,  
Yes I am familiar with swiflash so tried to use the same for re-flash but getting below error

linuxr@ubuntu:~$ $WPX5\_RECOVERY/swiflash -m WP85XX -i yocto\_wp85.cwe  
Detecting USB of the target  
DONE  
Communicating with the target  
Firmware Download Failed  
Failure Code: 57348

Thanks

---

<div class="post-metadata">

**Author:** ![niladridm](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/niladridm/32/91_2.png) [@niladridm](https://mangoh.discourse.group/u/niladridm)\
**Post date:** [October 13, 2016, 8:42am UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/19 "2016-10-13T08:42:55Z")

</div>

Hi,  
some problem in my current system (have 16.07 legato) after using another system which have 16.04 legato i am able to flash the cwe file but while trying modprobe command i am getting below error

modprobe: module can not found in modules.dep

Thanks

---

<div class="post-metadata">

**Author:** ![asyal](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/asyal/32/78_2.png) [@asyal](https://mangoh.discourse.group/u/asyal)\
**Post date:** [October 13, 2016, 12:50pm UTC](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196/20 "2016-10-13T12:50:40Z")

</div>

Hi,  
Did it work on system with 16.04?  
Also, it might be that the Yocto that you used was for 16.04. As mentioned in the instructions, if you need to build for latest legato, then Yocto that you use should be latest as well.  
regards,  
ashish

[Next page](https://mangoh.discourse.group/t/how-to-build-mcp2515-canbus-drivers-for-mangoh/196.md?page=2)
