I want to use the SPI on Colibri IMX8 with Torizon. I currently use “TorizonCore image with Docker runtime, 4.0.0-devel-20200324+build 27” but there are no SPI devices visible in the /dev folder.
Is the SPI port enabled by default? If not, how can I enable it and verify that the port is enabled?
It seems you are correct according to the device tree source here, there is a spidev defined but is is disabled by default. I’ll speak with our team to see if this is something we can have enabled by default as to match the behavior of other Torizon compatible modules.
As for the time-being however this is certainly something you can change. You just need to change the single line in the source code I linked above from “disabled” to “okay”. If you need further instructions on how to build our kernel source you can see the article here.
The article is written for our non-Torizon BSP, but in the case of the i.MX8X we use the same kernel in Torizon. So those instructions should be okay for setting up and building the kernel after you make your changes.
The deployment of your new device tree however is a slightly different for Torizon. After you have built you new device tree binary you need just replace the old one which should be at this location on the device: /boot/ostree/torizon-{some checksum}/. At this directory location you need just replace the old device tree binary with the new one. After a quick reboot the system should load the new device tree with your SPI changes.
Please note we aim to make such device tree changes will be easier in the future, as we increase support for the new i.MX8X platform.
I have changed the line in the source code and built a new device tree binary. I have also disabled the mcp2515 device as mentioned here. The spidev0.0 is now visible in the /dev folder but I can still not access the device. Is there something I have missed as the device is not available for our software solution?