AnsweredAssumed Answered

STM32F429 with FMC and HX8347-controlled LCD

Question asked by Nor Sch on Jun 24, 2016
Latest reply on Oct 11, 2016 by Nor Sch
Hi there, I have some troubles with initializing my LCD with a HX8347-Controller. I have my Environment and all Settings generated with the actual Cube. I use FreeRTOS on a STM32F429. The LCD is with FMC on BANK1, NOR/.../LCD 2 connected and configered. I added also the additional Reset-Pin. The Background-LED is turned on, so that I should see everything. The Clocking is active.

Because of wish to later use emWin, the Configs (Templates) for STemWin are used. Mostly all of the simple Stuff is taken from the Templates and addapted. The CRC for emWin is also active.

in the GUIConf.c I changed
#define GUI_NUMBYTES  XSIZE_PHYS * YSIZE_PHYS * 2

in LCDConf.h I added
#define XSIZE_PHYS  240 // To be adapted to x-screen size
#define YSIZE_PHYS  320 // To be adapted to y-screen size

In GUIConf.h I reduced to 1 Layer and removed Support for Touch+Mouse.

And now the real Thing, which should be also there in a similar Way without emWin:
in the LCDConf_FlexColor.c I have (shortened) following things:
01.typedef struct {
02.  __IO uint16_t REG;
03.  __IO uint16_t RAM;
04.}LCD_CONTROLLER_TypeDef;
05. 
06.#define FMC_BANK1_BASE  ((uint32_t)(0x60000000 | 0x04000000))       // BANK1_BASE | Offset for NOR / PSRAM 2 (64MB Offset)
07.#define FMC_BANK1       ((LCD_CONTROLLER_TypeDef *) FMC_BANK1_BASE)
08. 
09.typedef enum {
10.    eLCD_DISPLAY_MODE_CONTROL       = 0x01U,
11.    eLCD_COLUMN_ADDRESS_START_2     = 0x02U,
12.    eLCD_COLUMN_ADDRESS_START_1     = 0x03U,
13....
14.    eLCD_TEST_1                     = 0x96U,
15.} TE_LcdRegister;
16. 
17.static void LcdWriteReg(U16 Reg) {
18.    FMC_BANK1->REG = Reg;                                                       // write Data to [D0:D7]
19.}
20. 
21.static void LcdWriteData(U16 Data) {
22.    FMC_BANK1->RAM = Data;                                                      // write Data to [D0:D15]
23.}
24. 
25.static void LcdWriteRegAndData(U16 Reg, U16 Data){
26.    LcdWriteReg(Reg);
27.    LcdWriteData(Data);
28.}
29. 
30.static void LcdReadDataMultiple(U16* pData, int NumItems) {
31.    for(uint32_t ui=0; ui<NumItems; ui++) {
32.        *pData = FMC_BANK1->RAM;                                                // read Data from [D0:D15]
33.    }
34.}
35. 
36.void LCD_X_Config(void) {
37....
38.  pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_FLEXCOLOR, GUICC_565, 0, 0);
39....
40.  GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66712, GUIDRV_FLEXCOLOR_M16C0B16);  // HX8347 with 16bpp, no cache, 16 bit bus
41.}
42. 
43.int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void* pData) {
44....
45.    switch (Cmd) {
46.        case LCD_X_INITCONTROLLER:
47.            LCD_PowerOn();
48....
49.}
50. 
51.static void LCD_PowerOn(void){
52.    // Init is done on Base of File "COM24H2N57XLC_CPU_Interface_Oct2010_CA10075.pdf" site 20
53.    HAL_GPIO_WritePin(TFT2_RESETB_GPIO_Port, TFT2_RESETB_Pin, GPIO_PIN_SET);
54.    osDelay(1);
55.    HAL_GPIO_WritePin(TFT2_RESETB_GPIO_Port, TFT2_RESETB_Pin, GPIO_PIN_RESET);
56.    osDelay(1); // 10µs would be enough, but don't have µs-Delay
57.    HAL_GPIO_WritePin(TFT2_RESETB_GPIO_Port, TFT2_RESETB_Pin, GPIO_PIN_SET);
58.    osDelay(120);
59.    // Test1 setting
60.    LcdWriteRegAndData(eLCD_TEST_1,                     0x01);
61.    // OSC Control setting
62.    LcdWriteRegAndData(eLCD_OSC_CONTROL_1,              0x87);
63.    osDelay(10);
64....
65.}

So everything is pretty similar to different Examples I found. With Debuging I go trough all Functions as expected. But at the End there is nothing visible on my Display. Anyone with Ideas or Tipps?

Outcomes