Dear sir:
We want to use spi@3210000’s spi@0 to transfer data, check the device tree and find spi already enabled.
in /dev can not find any spi device, so use cmd install the spidev drviver
sudo insmod /lib/modules/5.10.104-tegra/kernel/drivers/spi/spidev.ko
use kernel-5.10/tools/spi/spidev_test to send data but can not find any wave from oscilloscope
when send data, CLK pin can not find any wave too.
Could you tell me whether there is any special config to enable spi or not ??
thanks
Hi wangqunpj,
Are you using the devkit or custom board for Orin NX?
What’s your Jetpack version in use?
SPI driver is built as loadable kernel module.
You could also run the following command to load it.
$ sudo modprobe spidev
If you are using the devkit, you could use Jetson-IO to configure the pinmux for SPI.
If you are using the custom board, you should modify the pinmux spreadsheet to confirm the usage of SPI for those pins.
Please help to share the result of the following commands.
sudo busybox devmem 0x0243d028 //SPI1_SCK
sudo busybox devmem 0x0243d018 //SPI1_MISO
sudo busybox devmem 0x0243d040 //SPI1_MOSI
sudo busybox devmem 0x0243d008 //SPI1_CS0
sudo busybox devmem 0x0243d038 //SPI1_CS1
We are using the custom board with R35.3.1:
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d028
0x00001055
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d018
0x00000055
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d040
0x00000055
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d008
0x00000059
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d038
0x00000059
It seems you have to remove the GPIO usage for these pins.
Could you help to provide the full flash log for further check?
Have been upload log
flash_orin_nx.log (274.4 KB)
copying dtbfile(/home/qskj/workspace/Linux_for_Tegra/kernel/dtb/qskj-orin-nx-dev.dtb)... done.
Please share your dtb file (qskj-orin-nx-dev.dtb ) or the dtsi for GPIO (Orin-jetson_orin_nx_series_*-gpio-default.dtsi ) generated from pinmux spreadsheet.
Could you remove the following lines in your tegra234-mb1-bct-gpio-p3767-hdmi-a03.dtsi ?
gpio_main_default: default {
gpio-input = <
TEGRA234_MAIN_GPIO(B, 0)
TEGRA234_MAIN_GPIO(Y, 0)
TEGRA234_MAIN_GPIO(Y, 1)
TEGRA234_MAIN_GPIO(Y, 2)
TEGRA234_MAIN_GPIO(Y, 3)
TEGRA234_MAIN_GPIO(Y, 4)
TEGRA234_MAIN_GPIO(Z, 1)
- TEGRA234_MAIN_GPIO(Z, 3)
- TEGRA234_MAIN_GPIO(Z, 4)
- TEGRA234_MAIN_GPIO(Z, 5)
- TEGRA234_MAIN_GPIO(Z, 6)
- TEGRA234_MAIN_GPIO(Z, 7)
After flashing your board, please share the previous pinmux for SPI pins again.
sudo busybox devmem 0x0243d028 //SPI1_SCK
sudo busybox devmem 0x0243d018 //SPI1_MISO
sudo busybox devmem 0x0243d040 //SPI1_MOSI
sudo busybox devmem 0x0243d008 //SPI1_CS0
sudo busybox devmem 0x0243d038 //SPI1_CS1
According your advice, we use two methods to modify GPIO config ,but can not find any wave from oscilloscope
only delete gpio z3~7 in gpio.dtsi
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d028
0x00001455
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d018
0x00000455
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d040
0x00000455
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d008
0x00000459
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d038
0x00000459
2.delete gpio z3~z7 in gpio.dtsi & delete spi1_cs1_pz3 ~pz7 in pinmux.dtsi
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d028
0x00001434
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d018
0x00000434
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d040
0x00000434
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d008
0x00000430
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d038
0x00000430
The second result seems more reasonable for SPI usage.
Please make sure your pinmux configured as following.
spi1_sck_pz3 {
nvidia,pins = "spi1_sck_pz3";
nvidia,function = "spi1";
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
spi1_miso_pz4 {
nvidia,pins = "spi1_miso_pz4";
nvidia,function = "spi1";
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_ENABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
spi1_mosi_pz5 {
nvidia,pins = "spi1_mosi_pz5";
nvidia,function = "spi1";
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
spi1_cs0_pz6 {
nvidia,pins = "spi1_cs0_pz6";
nvidia,function = "spi1";
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
spi1_cs1_pz7 {
nvidia,pins = "spi1_cs1_pz7";
nvidia,function = "spi1";
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
Could you connect MOSI/MISO and refer to the Step4-Step6 of the following thread to verify loopback test?
Jetson Nano SPI Bus Not Working - #10 by KevinFFF
Hi,according your advice, we use four methods to modify GPIO config ,but can not find any wave from oscilloscope
delete gpio & config pinmux with disable input(5 pins)
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d028
0x00001401
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d018
0x00000401
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d040
0x00000401
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d008
0x00000401
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d038
0x00000401
delete gpio & config pinmux with disable input(3/5/6/7 pins)
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d028
0x00001401
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d018
0x00000441
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d040
0x00000401
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d008
0x00000401
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d038
0x00000401
modify gpio to output with high and disable input(5 pins)
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d028
0x00001001
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d018
0x00000001
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d040
0x00000001
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d008
0x00000001
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d038
0x00000001
modify gpio to output with high and disable input(3/5/6/7 pins)
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d028
0x00001001
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d018
0x00000041
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d040
0x00000001
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d008
0x00000001
root@qskj-desktop:/home/qskj# sudo busybox devmem 0x0243d038
0x00000001
Do you have Orin Nano devkit(p3768) and you could put your Orin NX on that to verify?
Or do you have any difference in custom hardware design on the SPI interface?
Hi,
we use the custom carrier board , about the SPI(spi0+spi1) circuit, refer to the p3768
May I know why your CS pins are all input pins?
It is circuit symbol use problem, really , CS0/1 is output
Do you have Orin Nano devkit(p3768) and you could put your Orin NX on that to verify?
We have not Orin Nano devkit(p3768) and we have put our Orin NX on Orin Nano devkit that it is supplied from the third party suppliers.
in fact, the spi circuits is the same for Orin Nano devkit(p3768) or our custom board.
the spi is directed to the connector.
if we modify spi to GPIO, the GPIO is ok.
SPI should work if you configure the pinmux and enable it in device tree correclty.
We would verify it with SPI loopback test through short MISO/MOSI first.
Hi, it works, thanks very much
1 Like
system
Closed
August 16, 2023, 1:16am
23
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.