Hi,
I am trying the second way.
I have implemented the DTB in order to use the micro as SPI master. I am using spidev driver. I noticed that a can send max 8 bytes per time, if i send more the transaction is divided in blocks of 8 bytes each; here an example (there is aliasing because the clk freq is high, but they are 8 bytes transfer (32 bytes in total):
DS1Z_QuickPrint1.png
This is my device tree configuration:
file imx93.dtsi:
lpspi3: spi@42550000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "fsl,imx93-spi", "fsl,imx7ulp-spi";
reg = <0x42550000 0x10000>;
interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX93_CLK_LPSPI3_GATE>,
<&clk IMX93_CLK_BUS_WAKEUP>;
clock-names = "per", "ipg";
status = "disabled";
};
file ucm-imx93.dts:
&lpspi3 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&pinctrl_lpspi3>;
pinctrl-1 = <&pinctrl_lpspi3>;
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
status = "okay";
spidev0: spidev@0 {
reg = <0>;
compatible = "rohm,dh2228fv";
spi-max-frequency = <20000000>;
status = "okay";
};
};
I tryed to add DMA in order to avoid this problem:
file ucm-imx93.dts:
&lpspi3 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&pinctrl_lpspi3>;
pinctrl-1 = <&pinctrl_lpspi3>;
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
status = "okay";
dmas = <&edma2 12 0 0>, <&edma2 13 0 1>;
dma-names = "tx","rx";
spidev0: spidev@0 {
reg = <0>;
compatible = "rohm,dh2228fv";
spi-max-frequency = <20000000>;
status = "okay";
};
};
but with the two code lines for the DMA, the SPI does not work anymore.
Do you know which the error can be in the device tree that cause the SPI not to work with DMA?
Is the delay problem fixable with the DMA? In case, do you know another way to fix it?
Thank you in advance
Lorenzo