ST7735 LCD via FB device on SDK V2

I’ve got a project coming up that needs a graphic LCD so I reviewed the steps required to get an LCD framebuffer working over at this thread:

There are some minor incompatibilities between the suggested changes from that thread and the changes in SDK V2 so some minor tweaks were required but I’ve gotten it running on my bench. You can see the changes with respect to SDK V2 in my fork under the branch “spi_lcd” here:

The main problems I ran into getting it going were:

  1. Many of the changes to cvitek_board_init.c were not needed as they were already set up as the pinmux defaults.
  2. I couldn’t get my ST7735 LCD running at the full 48MHz clock rate and had to back it off to 40MHz. This is still well beyond the manufacturer’s specification of 15MHz max.
  3. I moved the DC, RST and BL GPIOs to different pins for my own application. I did see there appeared to be some interfering driver that was altering the state of the original GPIO15 of the RST pin which prevented my LCD from initializing properly so moving that pin appears to have fixed that problem.

It’s basically working now, but there do seem to be some weird things going on with the gamma curves that are given in the original thread - I’m getting some odd color inversions on some images. Simple bright colors used in GUI elements seem to be OK though, so I’m not in a big rush to debug that.

I may end up moving to an ST7789 or IL9341 display at some point since more pixels may be required for my project. I’ll keep updating here as that changes.

1 Like

I’ve reverted the kernel ST7789 back to its original code and connected a true ST7789 IPS LCD which looks much better. See below:

1 Like

I’ve spent some time to simplify the changes needed to the SDK V2 files to get the LCD working well. Many of the code modifications in the original post were not required (especially for the ST7789 LCD) and I was able to reduce the overall patchset to just four files and only a few lines in each. In the process I also added realtime control over the backlight and improved the way the intial reset works. You can find the latest changes in the ‘spi_lcd’ branch in my fork of SDK V2 on Github (link at top of this thread).

I see that while I was working there have been some new commits to SDK V2 and I’ll be studying those and updating my branches to ensure they’re current.

2 Likes