Setting SPI on iMX6ULL

Hi, I’m starting to use the iMX6ULL with Aster V1.1B and I’m a little confused about the SPI interface. I’m using the Linux LXDE Image on SD card, and i wish to know if I need to change any configure to enable the spi interface. If so, what are the steps to change it and get a new image with spi enabled? Is there any example for iMX6ULL that I can use to test it?

Thanks in advance.

Luccas

Hi @lcasagrande!

What would be your use case?

Usually SPI is accessed by device drivers in kernel space.

To access SPI in user space, you can use spidev. This comes disabled in our image by default. To enable it, you have to make a small change in the device tree as stated here, then recompile and reflash it.

Hi, thanks for response!
Do you know if my board have the SPI driver (mcp2515)?
I could not use it, it returns error when kernel is booted:

root@colibri-imx6ull:~# dmesg |fgrep -i mcp
[    8.801466] mcp251x spi0.0: Cannot initialize MCP2515. Wrong wiring?
[    8.881421] mcp251x spi0.0: Probe failed, err=19

No, Aster has no MCP2515 SPI CAN controller and you may use the following device tree instead:

http://git.toradex.com/cgit/linux-toradex.git/tree/arch/arm/boot/dts/imx6ull-colibri-aster.dts?h=toradex_4.9-2.3.x-imx

Thanks, I was searching for that.
Is there any step guide on how to compile the device tree?

This topic question is answered. Thank you again.

Hi @lcasagrande! You can refer to this article on compiling U-Boot, the Kernel and device trees.