Hello,
I am working to figure the steps needed to enable SPI on a Colibri iMX6ULL (512MB NAND FLASH).
So far, I have tried adding spitools
and spidev-test
to my image recipe, however, when inspecting /dev/
I see no SPI devices.
Troubleshooting using dmesg
shows the following:
root@colibri:~# dmesg | grep -i spi
[ 13.925870] platform 2008000.spi: deferred probe pending
[ 21.694301] mcp251x spi0.0: MCP251x didn't enter in conf mode after reset
[ 21.722929] mcp251x spi0.0: Probe failed, err=110
[ 21.730750] mcp251x: probe of spi0.0 failed with error -110
Questions:
- Is the SPI bus enabled by default on the Colibri reference image? I can see the following being used in my image’s recipe, loosely based on the
tdx-reference-mininal-image
:
IMAGE_INSTALL += " \
packagegroup-boot \
packagegroup-basic \
packagegroup-base-tdx-cli \
packagegroup-machine-tdx-cli \
udev-extraconf \
...
- From my so far limited understanding, it appears that an overlay (dtbo) could be used for this purpose, but the details elude me at the moment. Could anybody please confirm?
As per the guidelines, here follows a tdx-info
response:
root@colibri:~# tdx-info
Software summary
------------------------------------------------------------
Bootloader: U-Boot
Kernel version: 6.1.92-6.7.0-devel+git.88690811da69 #1 SMP Sat May 25 14:21:36 UTC 2024
Kernel command line: user_debug=30 ubi.mtd=ubi root=ubi0:rootfs rw rootfstype=ubifs ubi.fm_autoconvert=1 console=tty1 console=ttymxc0,115200n8 consoleblank=0
Distro name: NAME="TDX Wayland with XWayland Upstream"
Distro version: VERSION_ID=6.7.0-devel-20240615000039-build.0
Distro variant: -
Hostname: colibri-imx6ull-06984681
------------------------------------------------------------
Hardware info
------------------------------------------------------------
HW model: Toradex Colibri iMX6ULL 256/512MB on Colibri Evaluation Board V3
Toradex version: 0044 V1.1A
Serial number: 06984681
Processor arch: armv7l
------------------------------------------------------------
Thanks so much.
Antonio Fernandez
Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!
Did you like my answer?

Hello,
To enable SPI on your Colibri iMX6ULL module, you’ll need to ensure that the SPI interface is correctly configured in the device tree and that the necessary drivers are included in your Linux image.
-
SPI Bus Enabled by Default: The SPI bus is not enabled by default on the Colibri iMX6ULL in the reference images. You need to enable it manually through device tree modifications or by using a Device Tree Overlay (DTO).
-
Using Device Tree Overlays: Yes, using a Device Tree Overlay (dtbo) is a correct approach to enable SPI on your module. Since you’re working with a Colibri iMX6ULL, you should look for a specific overlay that matches your module and desired SPI configuration. The process involves identifying the correct overlay file and applying it to your system.
Given the error messages from dmesg
, it appears there might be an issue with the SPI device or driver initialization. The messages related to mcp251x
suggest that there’s an attempt to communicate with an SPI CAN controller, which is failing to initialize properly.
Steps to Enable SPI:
-
Modify the Device Tree: Check the device tree source (DTS) file for your module and evaluation board. Ensure that the SPI interface is enabled (status = "okay";
) and correctly configured. You might need to adjust the pin multiplexing settings to use the pins for SPI functionality.
-
Apply a Device Tree Overlay: If you prefer to use an overlay, find the appropriate .dtbo
file for enabling SPI on your module. You can apply this overlay by modifying the U-Boot environment variables or by using the Toradex Easy Installer to apply the overlay during system setup.
-
Rebuild and Deploy: After making changes to the device tree or applying an overlay, rebuild your Linux image or device tree binaries as needed. Deploy these changes to your module and reboot.
-
Verify SPI Device: After rebooting, verify that the SPI device appears under /dev/
. If it does not, check the kernel log (dmesg
) for any SPI-related messages that might indicate what went wrong.
-
Software Packages: Including spitools
and spidev-test
in your image is a good practice for testing SPI functionality. Ensure these packages are correctly installed and use them to test the SPI interface once it is enabled.
If you continue to encounter issues, reviewing the complete device tree configuration and ensuring that no conflicts exist with
Please, also check if these links can help you solve your problem:
SPI (Linux) | Toradex Developer Center.
Yes, the reference downstream images have SPI enabled by default. The error message you observed is due to the fact that your carrier board apparently does not have an MCP251x controller incorporated. To enable the internal FlexSPI controller, please follow this article. Please note that you may need to use spi0.0
instead of spi2.0
as used in the article
Thanks Alex!
I can run spidev_test
and spi-pipe
now.
The following operation still fails:
$ echo spi2.0 > /sys/bus/spi/drivers/mcp251x/unbind
-sh: echo: write error: No such device
It appears that the spi0.0 file is not writable:
$ ls -la /sys/bus/spi/drivers/mcp251x/unbind
--w------- 1 root root 4096 Apr 29 01:25 /sys/bus/spi/drivers/mcp251x/unbind
So, I wonder if I still should aim for adding a custom dts to the build.
Please use spi0.0
instead of spi2.0