How to build MCP2515 CANBus drivers for mangOH

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

Thanks

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

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

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:

regards,
Ashish

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

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

Hi Nila,

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

Ashish

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 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.

Hi Ashish
I am using VM Linux 16.04

Thanks

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) as plus the changes that Dave mentioned.

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

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

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

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

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

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

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

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

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

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