How to build MCP2515 CANBus drivers for mangOH

Do you see the .ko file on your mangOH in /lib/modules/{kernel_version}/kernel/. I suppose you could also look in /lib/modules/{kernel_version}/modules.dep to ensure that the message is true.

I suspect that you aren’t running the kernel that you think you’re running.

Hi,
yes it is missing in kernel. May be i did wrong somewhere :sweat:
I am trying to write library for MCP2515 using spi service api (https://github.com/mangOH/SpiService) but not able to initialize MCP2515.
Is anyone trying the same?
My objective is to receive OBD2 CAN frame using CAN IOT

Thanks

Hi,
is anyone working with CAN IoT card in mangOH board ?

Thanks

Hi Nila,

Seems like you were not able to build driver for CAN bus. Please note that in next version of Legato we are releasing what we call IoT Framework that will make it easy for you to install drivers for IoT modules. More information on this to follow in the next few weeks.
In the interim, we can give you a temporary build with CAN driver enabled installed.
Let me know if you want to proceed this way.

Ashish

Hi Ashish,
Thanks. Yes it will be very helpful if you share the build with can driver for testing the CAN IOT card.

Thanks

Hi Ashish,
I would be grateful if you could also share the beta version of the IOT framework with us. Anyway I should like to test the CAN IOT card with the temporary build with CAN driver. Hope this will be available soon.

Thanks

Hi Nila,

Shareable link here
https://drive.google.com/open?id=0B1RUbwP6VFIJYWpxaG9qd1BuTjg

Please download and note this is a temporary build with no guarantee for production purposes.
IoT framework will be available with Legato 16.10 release.
Let me know when you have downloaded and then i will remove the firmware.
Also, please follow step 10 from wiki page .

regards,
Ashish

Hi Ashish,
Thanks for sharing the build.
I have flash the WP with this build. Have below issue now

  1. GPIO Expander Service not working and below is the log

Jan 6 01:39:08 | Legato | gpioService[495]/sysfsGpio T=main | gpioSysfsUtils.c gpioSysfs_SessionOpenHandlerFunc() 1068 | Assigning GPIO 2
Jan 6 01:39:08 | Legato | UNKNOWN[2509]/framework T=main | LE_FILENAME le_fdMonitor_Create() 672 | FD Monitor object name ‘gpioExpanderService.gpio.expander2Interrupt’ truncated to ‘gpioExpanderService.gpio.expand’.
Jan 6 01:39:08 | Legato | gpioService[495]/sysfsGpio T=main | gpioSysfsUtils.c WriteSysGpioSignalAttr() 173 | Failed to write rising to GPIO config /sys/class/gpio/gpio2/edge. Error Operation not permitted
Jan 6 01:39:08 | Legato | gpioService[495]/sysfsGpio T=main | gpioSysfsUtils.c gpioSysfs_SetChangeCallback() 564 | Unable to set edge detection correctly
Jan 6 01:39:08 | kernel | [ 752.150770] genirq: Flags mismatch irq 347. 00000082 (gpiolib) vs. 00000004 (lsm6ds3)
Jan 6 01:39:08 | Legato | gpioService[495]/sysfsGpio T=main | gpioSysfsUtils.c gpioSysfs_SessionCloseHandlerFunc() 1107 | Releasing GPIO 2
Jan 6 01:39:08 | Legato | gpioExpanderService[2509]/framework T=main | expander2Interrupt_client.c expander2Interrupt_AddChangeEventHandler() 1281 | Valid response was not received from server
Jan 6 01:39:10 | Legato | supervisor[437]/supervisor T=main | proc.c proc_SigChildHandler() 1833 | Process ‘gpioExpanderService’ (PID: 2509) has exited with exit code 1.
Jan 6 01:39:10 | Legato | supervisor[437]/supervisor T=main | proc.c proc_SigChildHandler() 1875 | Process ‘gpioExpanderService’ reached fault limit while system in probation. Device will be rebooted.
Jan 6 01:39:11 | Legato | supervisor[437]/supervisor T=main | app.c app_SigChildHandler() 3055 | Process ‘gpioExpanderService’ in app ‘gpioExpanderService’ faulted: Rebooting system.
Jan 6 01:39:11 | Legato | supervisor[437]/supervisor T=main | supervisor.c Reboot() 561 | Supervisor going down to trigger reboot.
Jan 6 01:39:11 | Legato | watchdog[472]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (le_sup_wdog:097fbccd0328ad2605764aecdd9339bc).
Jan 6 01:39:11 | Legato | secStore[499]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (secStore.secStoreDaemon.le_appInfo:f92de62899eb1ab8e72119f371ac3fb7).
Jan 6 01:39:11 | Legato | avcDaemon[491]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (avcDaemon.avcDaemon.le_appInfo:f92de62899eb1ab8e72119f371ac3fb7).
Jan 6 01:39:11 | Legato | updateDaemon[466]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (le_sup_ctrl:fa6bf8cc16759825710163005fdfbe9e).

I am using
legato.framework.16.7.0.201609081601
legato.sdk.16.7.0.wp85-wp75-native-x86_64-201609121201
legato.toolchain.1.7.3.fw_SWI9X15Y_07110900-wp85-wp750x-native-x86_64-201608171142

Thanks

Use this download
https://drive.google.com/file/d/0B1RUbwP6VFIJdy1EWS1CbjZtMlk/view?usp=sharing

Note I have only tested this with legato 16.04.

Hi Ashish,
Thanks for your support. Yes this image is working fine and CAN IOT card detected properly now.
I am testing with Microchip Can bus analyzer (transmitting 1 can frame have standard identifier and 8 byte data every 100 ms) but not able to print CAN RAW frame using killSwitch and canOpen application. Is there any other example code to display CAN Raw frame?

Thanks

Hi,
Hi I am now able to read RAW CAN frame using socketcan.
Thank you for your help.

Thanks

Hi Ashish,
when can we expect legato with IoT framework? I have tried with 16.10 but MCP2515 driver and socketcan missing here. I am never successful to build MCP2515 can driver by following the steps metioned @ https://github.com/mangOH/mangOH/wiki/How-to-build-MCP2515-CAN-drivers-for-mangOH.
It will helpful if you can share a video tutorial on the same.

Thanks

Hi Nila,

I havent looked at this in a while so will try building from 16.10 this week and see what issues you might be running into.

regards,
Ashish

hi Ashish,
Any update on 16.10 build with MCP2515 CAN driver?

Thanks

Nila,

I am going to invest some time on this topic this week and get back to you.

Regards,
Ashish

Nila,

I was able to replicate the issue and will provide a fix by Wednesday.

Regards,
Ashish

Hi Nila,

We have updated the github page and it should work now. There were a few path inconsistencies as well as changes to board-9615.c file that caused the issue that you saw.

Let me know if it works for you now.

cheers,
Ashish

Thank you Ashish. I’ll get back to you
Thanks

Hi Ashish,
Now I am able to build 16.10.1 with MCP2515 driver successfully with the help of github instruction link.

Thanks

I have followed the steps given in following link


and i am successfull in building yocto_wp85.cwe .
I am using Legato 16.10 on my mangoh Green what will be the fw version if i flash new.cwe file on my board.

I have built this .cwe file using source as Legato-Dist-Source-mdm9x15-SWI9X15Y_07.11.21.00 but in document in the following link http://source.sierrawireless.com/resources/airprime/hardware_specs_user_guides/airprime_wp75xx_wp8548_product_technical_specification_rev_12 page num:25 says that
WP8548 processor is MDM8215
Is this .cwe file compatible with my processor.