Thank you, I didn’t know that spidev is compiled as a kernel module. Its working after loading the module. But now I have an issue with the SPI frequency. I have set the spi-max-frequency = 23000000 ; (23 Mhz instead of 4 Mhz). I tried to operate the SPI on 20Mhz but it doesnt work. (It worked already with 10Mhz)
I get this message through the serial connection:
[ 666.824565] spi_master spi0: failed to transfer one message from queue
Did you get this message only once?
yes I get it once per run using ( ioctl(fd, SPI_IOC_MESSAGE(1), &tr); )
Is the SPI transfer working?
The SPI transfer seems to work on 10 Mhz ( MOSI tested with oscilloscope )
Could you check other SPI speeds?
I checked the speeds from 10 to 23 Mhz. SPI stops working starting from 13 Mhz (12 works)
and the kernel gives the mentioned debugging message.
Is the 20Mhz SPI clock tested on iMX8? Is there specified SPI frequencies that can work iMX8?
Since the module has still Early Access Status, we did not test all the Speeds. The specified SPI frequency can work if you change the parent Clock for the SPI. The parent clock has currently a clock frequency of 24MHz, this limits the SPI speed to 12MHz.
I’m using the kernel branch: toradex_4.14-2.0.x-imx. is it correct?
I have set the assigned-clock-rates = 48 000 000 instead of 24 000 000. the SPI works now on 24 Mhz.
The issue now is, when I set the speed in the SPI struct to 20 Mhz the spi transfer keeps running on 24 Mhz (checked by the oscilloscope).
I tried also to set the frequencies 19,18,17 Mhz, but I get the same result: 24 Mhz.
Setting the speed to 16,15,14,13 will result a 16Mhz transfer frequency, 12,11,10 a 12 Mhz frequency and so on…
I would be grateful if you explained it. Is there any way to set the frequency to 20 Mhz?
I’m new in using Toradex and TorizonCore, so sorry for refreshing the topic, but need to go to the source. I’m using Apalis IMX8 on Ixora Carrier Board connected to MCT070HDMI-B-CTP touch screen via HDMI. Before I used Apalis TK1 on Ixora. I have made both Quickstart Guides – with building image on TK1 with Yocto, and using containers and Torizon OTA on IMX8 (thank you for them). At this moment I’ve got two different images on my IMX8 boards – one of them is Reference Multimedia Image on IMX8 build with Yocto, and second is .yaml file from your tutorial consisting of two containers – Weston-vivante and kiosk-mode-browser uploaded via Torizon OTA.
In spite of customizing image I’d like to customize hardware – the SPI speed. As you mentioned before SPI on IMX8 is implemented as kernel module. Exploring device-trees for my board I found only option to set SPI max speed, should I add to option “assigned-clock-rates = value;” to device-tree? Why fsl-imx8qm-apalis.dts file is absent in device-tree and overlays repository after running :
torizoncore-builder dt-checkout
Should I use TorizonCore Builder to customize it? I’m not sure how to do this – changing device tree, customize kernel arguments or building external kernel module? What is interesting SPI working properly on image build on Yocto, with speed of 500kB and I can check this out with spidev_test. Unfortunately, spidev_test command can’t be found on second board, where image is based on .yaml file. How can I add it also to this image? On both boards there are spidev in /dev localization. Or, maybe I should resort directly to kernel using spi_ioc_transfer (Linux Kernel: spi_ioc_transfer Struct Reference) ?
And second problem connected with Torizon OTA – during upgrades via OTA something went wrong – upgrade got stuck, one day later after delete and added device again it passed, but at OTA webpage I can’t upgrade board - after update initiation I can’t select component to update – there are no option to select, as it was before. The screenshot showing the problem:
Thanks for reaching out. Can you please open a new topic with this exact same question as this post was already marked as solved? Therefore, this could help us and other people using the community.