C1+ SPI and edit dts file

Moderators: mdrjr, odroid

C1+ SPI and edit dts file

Unread postby Zaren » Fri Jan 12, 2018 4:41 am

Hello!

I need help for editing meson8b_odroidc.dts file. I dont know in which way I can add some information for kernel to recognize some SPI device. I need to add MCP251x device and I expect to get can0 . For that I applied patch for kernel and recompile it.

I compiled the kernel for c1+ according by https://wiki.odroid.com/odroid-c1/os_images/ubuntu/v2.2
There are my stages:
0. Buckup my eMmc flash drive to file on my desktop by dd command.
1. Clone by git the kernel for c1
2. Apply patch files for spi ( apart from 0008-ARM-dts-enable-mcp2515-for-XU3-XU4.patch this file)
3. Compile following the instruction.

I hope patches are work. Because I did same things for XU4. And can0 on XU4 appeared only after I changed dts file. But I have no idea how to change dts file for C1+ =(

I tried to change dts file in different ways but in vain... like this

Code: Select all
dtc -O dtb -o ./meson8b_odroidc.dtb ./meson8b_odroidc.dts
Error: ./meson8b_odroidc.dts:38.17-18 syntax error
FATAL ERROR: Unable to parse input tree


Thanks
Zaren
 
Posts: 39
Joined: Wed Nov 08, 2017 7:12 am
Location: Poland
languages_spoken: english
ODROIDs: ODROID C1+, XU4

Re: C1+ SPI and edit dts file

Unread postby odroid » Fri Jan 12, 2018 10:10 am

We bought a couple of mcp2515 boards.
We will test it with C1+ and XU4 early next week and get back to you.
User avatar
odroid
Site Admin
 
Posts: 28741
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: C1+ SPI and edit dts file

Unread postby Zaren » Sat Jan 13, 2018 3:28 am

Good news!

Thank you for helping me! Right now I want to connect some SPI board to Odroid and I need some drivers to do that.
But I think there is another approach. I just connect SPI boards to some micrcontroller ( for instance atmega328 ) and after that connect it to Odroid through UART. ATMega would be as some filter to pass data what I need to Odroid. But as far as I know ATmega does not need some drivers to plug some SPI boards. Just raw C code to read and write information to/from boards. Is there is some approach on Odroid to read/write data through SPI bus without drivers like on ATmega?
Zaren
 
Posts: 39
Joined: Wed Nov 08, 2017 7:12 am
Location: Poland
languages_spoken: english
ODROIDs: ODROID C1+, XU4

Re: C1+ SPI and edit dts file

Unread postby odroid » Sat Jan 13, 2018 2:22 pm

User avatar
odroid
Site Admin
 
Posts: 28741
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: C1+ SPI and edit dts file

Unread postby callum91 » Thu Feb 22, 2018 1:07 am

Hi everyone,
I was just wondering if there was any progress made on connecting the mcp2515 with an odroid xu4 as mentioned above?
I am trying to use the same setup in order to communicate with some robotics drivers that operate over CAN-BUS. At the moment I am using the Odroid XU4 Shifter shield in order to connect from the odroid spi Pins to the mcp2515 board.
I have done multiple embedded projects just never using a linux based controller so any help in getting this working would be much appreciated.
Thanks,
Callum
callum91
 
Posts: 6
Joined: Fri Feb 16, 2018 8:20 pm
languages_spoken: english
ODROIDs: XU4

Re: C1+ SPI and edit dts file

Unread postby odroid » Thu Feb 22, 2018 9:24 am

Refer this link. You can try a similar kernel config changes to enable the CAN bus on the XU4.
https://wiki.odroid.com/odroid-c1/appli ... io/can-bus
User avatar
odroid
Site Admin
 
Posts: 28741
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: C1+ SPI and edit dts file

Unread postby callum91 » Thu Feb 22, 2018 10:59 pm

Hi,
Ive had a read through the link and understand the basics of what its doing. I havent had alot of experience with patching linux kernels and obviously the tutorial you linked is for patching the c1+.
How would i go about editing the patch in order to try and get the mcp2515 connected to the odroid xu4?

Thanks again for your help,
Callum
callum91
 
Posts: 6
Joined: Fri Feb 16, 2018 8:20 pm
languages_spoken: english
ODROIDs: XU4

Re: C1+ SPI and edit dts file

Unread postby odroid » Fri Feb 23, 2018 11:11 am

Could you build the Kernel on your XU4 with this instruction?
https://wiki.odroid.com/odroid-xu4/os_i ... st-upgrade
User avatar
odroid
Site Admin
 
Posts: 28741
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID


Return to Ubuntu

Who is online

Users browsing this forum: No registered users and 2 guests