Skip to content

Display driver GC9X01X - Color inversion enabled by default on GC9A01A. #80578

@sudhishu

Description

@sudhishu

Describe the bug

While using display driver display_gc9x01x with Waveshare GC9A01A round display module, the color inversion is set on by default. Absence or explicit deletion of "display_inversion" node to set it false from device-tree overlay did not give desired result.

Setup:

  • HDK = nRF7002-DK + Waveshare GC9A01A round display module.
  • SDK = nRF Connect SDK version 2.7.0 and LVGL library for screen.
  • Zephyr OS = Version 3.6.99 , build v3.6.99-ncs2
  • IDE = Visual Studio Code with Nordic nRF connect plugin installed.

Workaround or attempted fix:

Modified the driver implementation in Zephyr/drivers/display/display_gc9x01x.c
Explicitly set the GC9X01X_CMD_INVON (0x21U) register to 0 during device and register init calls. Proper colors were displayed after applying the fix.

ret = gc9x01x_transmit(dev, GC9X01X_CMD_INVON, 0, 1);
if (ret < 0) {
return ret;
}

To Reproduce

Possibly this is the case with any development board which is using Galaxycore GC9x01x driver. This looks like a registry initialization requirement for the display chip. In this case, the 240x240 px round LCD display using GC9A01A chip is provided by Waveshare.

  1. prj.conf
    • Enable CONFIG_DISPLAY and CONFIG_GC9X01X at prj.conf
  2. Device tree overlay:
chosen { zephyr,display = &gc9a01a_lcd; }; ... ... ... &spi2 { status = "okay"; compatible = "nordic,nrf-spim"; pinctrl-0 = <&spi2_default>; pinctrl-1 = <&spi2_sleep>; pinctrl-names = "default", "sleep"; cs-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
gc9a01a_lcd: gc9a01a_lcd@0 {
    compatible = "galaxycore,gc9x01x";
    status = "okay";
    reg     = <0>;
    width  = <240>;
    height = <240>;
    pixel-format      = <(0x1 << 4)>;
    spi-max-frequency = <100000000>;
    cmd-data-gpios     = <&gpio1 11 GPIO_ACTIVE_HIGH>;
    reset-gpios          = <&gpio0 25 GPIO_ACTIVE_LOW>;
    /delete-property/ display-inversion;
  };

};

Note that the /delete-property/ display-inversion was an attempt to set the node explicitly false in the device configuration, but that did not work. Hence not necessary.

Expected behavior

The display should show the desired colors on the screen as set using the LVGL library.
Impact

The entire color scheme on the display was inverted. Failed to create the desired screen.
Logs and console output

None.
Environment (please complete the following information):

  • OS = Fedora Linux - 6.5.10-200.fc38.x86_64
  • HDK = nRF7002-DK + Waveshare GC9A01A round display module.
  • SDK = nRF Connect SDK version 2.7.0 and LVGL library for screen.
  • Zephyr OS = Version 3.6.99 , build v3.6.99-ncs2
  • IDE = Visual Studio Code with Nordic nRF connect plugin installed.

Additional context

Metadata

Metadata

Labels

area: DisplaybugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions