Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32: MIPI-DBI-SPI Not working in DMA mode #87147

Open
towen opened this issue Mar 15, 2025 · 0 comments
Open

ESP32: MIPI-DBI-SPI Not working in DMA mode #87147

towen opened this issue Mar 15, 2025 · 0 comments
Labels
bug The issue is a bug, or the PR is fixing a bug

Comments

@towen
Copy link

towen commented Mar 15, 2025

Describe the bug

Similar to #82095 (but the workaround for that issue is not applicable to esp32, since esp32 arch apparently does not have support for NOCACHE memory)

No output on screen or console if DMA is enabled

To Reproduce

Enable DMA by setting dma-enabled in the SPI device node, setting status okay in the DMA node, and setting CONFIG_DMA=y

(I am using the following devicetree for xiao_esp32s3/esp32s3/procpu/sense)

samples/drivers/display/xiao_esp32s3_esp32s3_procpu_sense.overlay
/{
	chosen {
		zephyr,display=&disp2;
	};

        lvgl_displays: my-displays {
                compatible = "zephyr,displays";
                displays = <&disp1 &disp2>;
                status = "okay";
        };

	mipi_dbi1 {
		compatible = "zephyr,mipi-dbi-spi";
		dc-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
		reset-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
		spi-dev = <&spi2>;
		write-only;
		#address-cells = <1>;
		#size-cells = <0>;

		disp1: ili9341@0 {
			compatible = "ilitek,ili9340";
			mipi-max-frequency = <25000000>;
			reg = <0>;
			pixel-format = <1>;
			rotation = <0>;
			width = <240>;
			height = <320>;
		};

	};
	mipi_dbi2 {
		compatible = "zephyr,mipi-dbi-spi";
		dc-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
		/*reset-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;*/
		spi-dev = <&spi2>;
		write-only;
		#address-cells = <1>;
		#size-cells = <0>;

		disp2: ili9341@1 {
			compatible = "ilitek,ili9340";
			mipi-max-frequency = <25000000>;
			reg = <1>;
			pixel-format = <1>;
			rotation = <0>;
			width = <240>;
			height = <320>;
		};
	};
};

&spi2 {
	status = "okay";
	cs-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>, <&gpio0 3 GPIO_ACTIVE_LOW>;
        dma-enabled;

	/* disable SDcard on CS 0 */
	sdcard: sdcard@0 {
		status = "disabled";
	};
};

&dma {
    status = "okay";
};

&wifi {
	status = "disabled";
};

west build samples/drivers/display -b xiao_esp32s3/esp32s3/procpu/sense

Set CONFIG_DMA=y in Kconfig

Expected behavior

Coloured squares drawn in screen corners as per the sample

Impact

Poor performance using displays in LVGL, due to lack of DMA

Environment (please complete the following information):

  • OS: Linux
  • Toolchain: Zephyr SDK
  • Commit SHA or Version used: ad431b3 (latest main, as of writing this issue)

Additional Context

I ran the spi_loopback test using DMA on this board, and initially I had problems (#87127) until I enabled CONFIG_CLOCK_CONTROL which seems to be required for SPI-via-DMA to work (but it -should- be selected automatically in all cases for esp32s3).
Sadly, enabling it did not fix THIS issue.

@towen towen added the bug The issue is a bug, or the PR is fixing a bug label Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

No branches or pull requests

1 participant