AM6422: SPI device driver is not working in the U-Boot

Part Number: AM6422

Tool/software:

Hi TI Support Team,

I am trying to display the product logo from the U-Boot loader on the custom board AM6422. I have configured the SPI device driver in U-Boot to communicate with the spi-LCD. However, I am encountering an issue when trying to initialize and access the SPI slave device (using spi_get_bus_and_cs), causing U-Boot to hang. Please let me know if I have missed any necessary configurations.

CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_CMD_SPI=y

Also, could you please provide the instructions for configuring the SPI device in the U-Boot loader, along with a sample program demonstrating how U-Boot can initialize and transmit sample data to a connected SPI slave device (SPI-LCD)?

Changes in k3-am642-evm.dts:

        main_spi0_pins_default: main-spi0-pins-default {
                pinctrl-single,pins = <
                        AM64X_IOPAD(0x0210, PIN_INPUT, 0) /* (D13) SPI0_CLK */
                        AM64X_IOPAD(0x0208, PIN_OUTPUT, 0) /* (D12) SPI0_CS0 */
                        AM64X_IOPAD(0x0214, PIN_OUTPUT, 0) /* (A13) SPI0_D0 */
                >;
        };

&main_spi0 {
        status = "okay";
        pinctrl-names = "default";
        pinctrl-0 = <&main_spi0_pins_default>;
        ti,pindir-d0-out-d1-in = <1>;   
        ti,spi-num-cs = <1>;      
        spidev@0 {
            status = "okay";
            compatible = "rohm,dh2228fv";
            spi-max-frequency = <5000000>;
            reg = <0>;
            spi-cs-high;
       };
};

Uboot Debug Log:

Regards,

Kalyan

  • Hi Kalyan,

    However, I am encountering an issue when trying to initialize and access the SPI slave device (using spi_get_bus_and_cs), causing U-Boot to han

    Can you use JTAG to step into the code and see why it hangs?

    I checked but we don't have a ready-to-use example that shows what you are trying to do in U-Boot.

    Regards, Andreas

  • Hi Andreas,

    Thanks for the suggestion. Can you please let me know how to debug the u-boot loader using JTAG on AM6422? Is there an IDE available that allows me to step into the U-Boot loader code for debugging? Additionally, please let me know if any specific configuration is required for U-Boot.

    Regards, Kalyan