Jetson Nano SPI Slave setup 2022

Hello,

I am currently looking into how to set-up the Jetson Nano as a SPI slave device.
The most current forum post on this topic I could find was from over 2 years ago.

What is currently the preferred way to set-up SPI slave on Jetson Nano.

Thanks

1 Like

You can use jetson-io to configure the pinmux and modify dump the dtb from the system and modify the SPI as slave mode.

1 Like

įŗ€hich of these attributes is the mode?

   spi@7000d600 {
        compatible = "nvidia,tegra210-spi";
        reg = <0x00000000 0x7000d600 0x00000000 0x00000200>;
        interrupts = <0x00000000 0x00000052 0x00000004>;
        iommus = <0x00000030 0x0000000e>;
        #address-cells = <0x00000001>;
        #size-cells = <0x00000000>;
        dmas = <0x00000051 0x00000010 0x00000051 0x00000010>;
        dma-names = "rx", "tx";
        nvidia,clk-parents = "pll_p", "clk_m";
        clocks = <0x00000026 0x0000002c 0x00000026 0x000000f3 0x00000026 0x000000e9>;
        clock-names = "spi", "pll_p", "clk_m";
        resets = <0x00000026 0x0000002c>;
        reset-names = "spi";
        status = "okay";
        linux,phandle = <0x00000111>;
        phandle = <0x00000111>;
        prod-settings {
            #prod-cells = <0x00000003>;
            prod {
                prod = <0x00000004 0x00000fff 0x00000000>;
            };
            prod_c_flash {
                status = "disabled";
                prod = <0x00000004 0x0000003f 0x00000006>;
            };
            prod_c_loop {
                status = "disabled";
                prod = <0x00000004 0x00000fff 0x0000044b>;
            };
        };
        spi@0 {
            compatible = "spidev";
            reg = <0x00000000>;
            spi-max-frequency = <0x01f78a40>;
            controller-data {
                nvidia,enable-hw-based-cs;
                nvidia,rx-clk-tap-delay = <0x00000006>;
            };
        };
        spi@1 {
            compatible = "spidev";
            reg = <0x00000001>;
            spi-max-frequency = <0x01f78a40>;
            controller-data {
                nvidia,enable-hw-based-cs;
                nvidia,rx-clk-tap-delay = <0x00000006>;
            };
        };
    };

Is using fdtput equivalent to dumping the dtb and changing a attribute?

Use below command to dump the device tree and modify it as salve by modify ā€œnvidia,tegra210-spiā€ to ā€œnvidia,tegra210-spi-slaveā€

sudo dtc -I fs -O dts -o extracted_proc.dts /proc/device-tree
1 Like

Thanks for the answer @ShaneCCC which dtb do I replace with my customized one?

/boot/dtb/
kernel_tegra210_p3448-0000-p3449-0000-b00.dtb

or

/boot/tegra210-p3448-0000-p3449-0000-b00.dtb
cat /sys/firmware/devicetree/base/compatible

Shows the following:
nvidia,p3449-0000-b00+p3448-0000-b00nvidia,jetson-nanonvidia,tegra210

Check the /boot/extlinux/extlinux.conf to know the file to replace.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.