Other Parts Discussed in Thread: SYSCONFIG
Tool/software:
The J722SXH01EVM has a 40 pin header and a few McSPI interfaces are routed to this header? How to enable the pins for McSPI?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
The J722SXH01EVM has a 40 pin header and a few McSPI interfaces are routed to this header? How to enable the pins for McSPI?
About:
Validated on 10.1 Linux SDK and built on top of the prebuilt image of 10.1 Linux SDK. This enables only MCU SPI0 and Main SPI2. Main SPI0 also has some connections to the 40 pin header. However, D1 is not connected to header by default for Main SPI0 so patch does not enable.
The enumeration are the following when I was testing. Although, numbers that are enumerated may change. Can use "ls -l /sys/class/spi*" to check as documented in application note below.
FAQ follows application note: https://www.ti.com/lit/an/sprad26/sprad26.pdf?ts=1756502475801&ref_url=https%253A%252F%252Fwww.google.com%252F
Instructions:
1.
Apply below patch to the Linux kernel:
https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/3603.0001_2D00_Enable_2D00_J722S_2D00_Main_2D00_SPI2_2D00_and_2D00_MCU_2D00_SPI0_2D00_in_2D00_devicetree.patch
Explanation of patch:
Patch should create below dtso file and edit the Makefile to build new devicetree source overlay file.
https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/3603.k3_2D00_j722s_2D00_evm_2D00_mcspi.dtso
Patch consists of the following:
*NOTE: 10.1 SDK for J722S looks to have CONFIG_SPI_SLAVE=y in defconfig. However, may need to add this in for other SDK versions to defconfig.
2.
Build the Linux devicetree and flash new dtbo file. Can use the Top-Level Makefile or any other method to build and flash Linux kernel: https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-j722s/11_00_00_08/exports/docs/linux/Overview_Top_Level_Makefile.html
3.
Build spidev_test. How to build spidev_test is documented in application note: https://www.ti.com/lit/an/sprad26/sprad26.pdf?ts=1756502475801&ref_url=https%253A%252F%252Fwww.google.com%252F
4.
In boot partition, edit uEnv.txt such that the name_overlays U-Boot variable points to the newly created devicetree overlay. Like below:
5.
Connect main spi2 and mcu spi0 on user expansion header. Connection like below:
6.
Boot and login.
7.
Run spidev_test
root@j722s-evm:~# ./spidev_test -v -D /dev/spidev1.0 -p master-hello-to-slave spi mode: 0x0 bits per word: 8 max speed: 500000 Hz (500 kHz) TX | 6D 61 73 74 65 72 2D 68 65 6C 6C 6F 2D 74 6F 2D 73 6C 61 76 65 __ __ __ __ __ __ __ __ __ __ __ |master-hello-to-slave| RX | 73 6C 61 76 65 2D 68 65 6C 6C 6F 2D 74 6F 2D 6D 61 73 74 65 72 __ __ __ __ __ __ __ __ __ __ __ |slave-hello-to-master| TX | 73 6C 61 76 65 2D 68 65 6C 6C 6F 2D 74 6F 2D 6D 61 73 74 65 72 __ __ __ __ __ __ __ __ __ __ __ |slave-hello-to-master| RX | 82 6D 61 73 74 65 72 2D 68 65 6C 6C 6F 2D 74 6F 2D 73 6C 61 76 __ __ __ __ __ __ __ __ __ __ __ |master-hello-to-slave| [1]+ Done ./spidev_test -v -D /dev/spidev3.0 -p slave-hello-to-master root@j722s-evm:~#
Regards,
Takuma