cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4R9I-DISCO with new ST7796H2 display driver

Du1
Senior

Working on getting a new TFT DSI LCD display to work on the STM32L4R9I-DISCOVERY kit. It uses the ST7796H2 display driver. emWin shows they have added support for this in their 5.36 version in the GUIDRV_FlexColor files, but STemWin is only reved to 5.32.

TouchGFX doesn't use the GUIDRV_FlexColor, where are the hardware specific files for editing to add support for this new LCD? I've read: (https://touchgfx.zendesk.com/hc/en-us/articles/204993942-Changing-to-a-different-display) but it doesn't mention specific file and I've browsed through various files without noticing the right one to work with. (GuiConfig.h, gui_main.h/cpp, stm32l4xx_hal_lcd.h, ...)

Thanks for your guidance and support.

17 REPLIES 17
Mon2
Senior III

Hi. Here is what we know about this topic:

1) DSI is a standard where the same register set is common across different display drivers. So if you see the source code writing to register 0x00 (as an example) then the same register 0x00 must be written to the next display driver IC. The value may be different that will be written but the address remains the same and is an industry wide specification.

2) Review the -DISCO kit details and hunt down the datasheet for the display used by ST during the assembly of this kit. Next, download the datasheet for the display driver used by the LCD on this kit.

Download the display driver datasheet for your new display you wish to use.

3) Review the source code for this -DISCO kit and you should be able to locate the source code for the display driver used by the ST original kit. Proceed to modify this source code to target the NEW display driver for your new display.

Since the display driver kit may be GUI generated - be sure to backup your source code for this routine else it may be overwritten when you refresh with the source code builder tools.

Personally have not yet performed this process but still in research mode and will be on this after closing some open OEM designs. Most likely in the next 4-5 weeks or so.

Hope this helps.

Du1
Senior
Thank you for the reply and suggestions. I've acquired both datasheet and am in the process to go through them. I'll post back my results if successful and hope it'll be helpful for other people in the future.
Du1
Senior

Got the display and edited the gui_main.cpp generated from TouchGFX and got the following image (image with black line). Then tried editing the code where it calls for the LCD size and edit it to 320 from 390. Then regenerated the LUT with the CubeMX using a square 320x320 instead of a round 320x320 and got the 2nd image (all pixelated). Seems to indicate I need to modify the LUT for a round 320x320 and any other code that deals with round lcd... the saga continues...

Du1
Senior
 
Du1
Senior
 

Yes, this will be a bit of a life sucking exercise. Be sure to compare your register values against other source code examples on the internet using the same display controller. Also the mfr of the display should be able to supply you with source code samples. We kind of cheated on our pending design and insisted on the use of the ILI9341V controller which is onboard this ST kit but had a custom flex cable produced for our company so we can mate with a zero force blade socket.

Check the clock value for this display as it almost looks like you are close in this posted screen shot. The clock value may be too high. Just an observation. Keep at it 😀

Thanks for the suggestion Mon! I'll be sure to look into it.

Du1
Senior

Bit more progress, the LCD is showing the pattern, but not in the right place, need to find correlation with displayed pattern and how to fix it in LUT...

Du1
Senior

The pattern should be this.