Skip to main content
NKieg.1
Associate III
December 23, 2020
Solved

Can't display TouchGFX graphics

  • December 23, 2020
  • 11 replies
  • 4230 views

Hello everyone. I am currently working with an STM32F469I-Discovery Board.

I created my project using the STM32CubeIDE board selector and made my layout using TouchGFX. Both softwares communicate as it should and I can generate code from one software and see the changes in the other one. I successfully added a task to FreeRTOS so I know I can correctly program the board and that it is working. I also tested an example showing me that the screen is working as it should too.

Now comes my problem. I am completely unable to display anything on the screen that has been created using TouchGFX and STM32CubeIDE. I configure the LTDC as well as the DSI in all imaginable configurations and nothing is working.

I was expecting it to be rather straight forward, without barely touching anything:

  • create the project in STM32CubeIDE (screen and communication configured by the IDE),
  • modify the TouchGFX file to look as I want,
  • generate the code,
  • built and debug the code in STM32CubeIDE,
  • the display shows up.

Do I need to check anything else? I was thinking of maybe a faulty GUI task or something like that. I have attached my code so you may be able to run it on your own STM32F469I-Disco and check if I missed something obvious.

This topic has been closed for replies.
Best answer by MM..1

you create TouchGFX project and

You dont use ioc, but in dir STM32CubeIDE exist .project file. Double click and project is imported in CubeIDE.

(TouchGFX 4.15)

11 replies

MM..1
Super User
December 23, 2020

Hi , created my project using the STM32CubeIDE board selector, is one step, but not last. Why you need ask STM , but generated code isnt complete for discovery boards. Maybe because author dont know if user use hw on board or connect other.

Good source is create second project over TouchGFX example selector and compare some things.

In basic on any LCD you need c file with init management and call it in your main code. Simmilar fot other external periph... SDRAM, Touch ,QSPI ...

Too order of inits make sense ...

When you need quick start . beter choice is create project in TouchGFX and then import it to Cubeide.

NKieg.1
NKieg.1Author
Associate III
December 23, 2020

What I don't understand is that everything related to the initialization of the screen seems called. And as said in my manage I manage to program the board to do what I want it to do, troubles only are with the screen.

I also tested to first create the touchgfx project and then import it but I didn't have more luck ...

NKieg.1
NKieg.1Author
Associate III
December 23, 2020

What I don't understand is that everything related to the initialization of the screen seems called. And as said in my manage I manage to program the board to do what I want it to do, troubles only are with the screen.

I also tested to first create the touchgfx project and then import it but I didn't have more luck ...

MM..1
Super User
December 23, 2020

when you create project in touch you see in drivers folder BSP, very important...

and in main

/* USER CODE BEGIN Includes */
#include "../Components/otm8009a/otm8009a.h"
#include "stm32469i_discovery_sdram.h"
#include "stm32469i_discovery_qspi.h"
/* USER CODE END Includes */
 

and later in ltdc init

 /* USER CODE BEGIN LTDC_Init 2 */
 __HAL_LTDC_DISABLE(&hltdc);
 DSI_LPCmdTypeDef LPCmd;
 
 HAL_DSI_Start(&hdsi);
 OTM8009A_Init(OTM8009A_FORMAT_RBG565, LCD_ORIENTATION_LANDSCAPE);
 HAL_DSI_ShortWrite(&hdsi, 0, DSI_DCS_SHORT_PKT_WRITE_P1, OTM8009A_CMD_DISPOFF, 0x00);
 
 LPCmd.LPGenShortWriteNoP = DSI_LP_GSW0P_DISABLE;
 LPCmd.LPGenShortWriteOneP = DSI_LP_GSW1P_DISABLE;
 LPCmd.LPGenShortWriteTwoP = DSI_LP_GSW2P_DISABLE;
 LPCmd.LPGenShortReadNoP = DSI_LP_GSR0P_DISABLE;
 LPCmd.LPGenShortReadOneP = DSI_LP_GSR1P_DISABLE;
 LPCmd.LPGenShortReadTwoP = DSI_LP_GSR2P_DISABLE;
 LPCmd.LPGenLongWrite = DSI_LP_GLW_DISABLE;
 LPCmd.LPDcsShortWriteNoP = DSI_LP_DSW0P_DISABLE;
 LPCmd.LPDcsShortWriteOneP = DSI_LP_DSW1P_DISABLE;
 LPCmd.LPDcsShortReadNoP = DSI_LP_DSR0P_DISABLE;
 LPCmd.LPDcsLongWrite = DSI_LP_DLW_DISABLE;
 HAL_DSI_ConfigCommand(&hdsi, &LPCmd);
 
 HAL_LTDC_SetPitch(&hltdc, 800, 0);
 __HAL_LTDC_ENABLE(&hltdc);
 /* USER CODE END LTDC_Init 2 */

and more ...

NKieg.1
NKieg.1Author
Associate III
December 23, 2020

Why isn't the BSP folder automatically added to the project? ... And I already tried what you mentioned without being more successful ...

I find it awkward that creating a project specifically for the disco board from the board selector of the IDE doesn't set everything up ...

MM..1
Super User
December 23, 2020

?? you create TouchGFX project and in TouchGFX Run Target button dont work ?

NKieg.1
NKieg.1Author
Associate III
December 23, 2020

This work, I can then open the .ioc file created by TouchGFX in STM32CubeIDE, everything compiles fine after the generation of the code in TouchGFX, the flashing works also but the screen remains black (led green and orange light up).

MM..1
MM..1Best answer
Super User
December 23, 2020

you create TouchGFX project and

You dont use ioc, but in dir STM32CubeIDE exist .project file. Double click and project is imported in CubeIDE.

(TouchGFX 4.15)

NKieg.1
NKieg.1Author
Associate III
December 23, 2020

So this works. Thank you a lot! I still trouble a little bit with the inclusion, I'll come back to you if nothing good happens. Thanks again !

NKieg.1
NKieg.1Author
Associate III
January 8, 2021

So when I do that I can successfully flash the board with the screen I designed in TouchGFX from CubeIDE. However, I am unable to see the same integration as I previously had with TouchGFX inside CubeMX (I can't directly open the TouchGFX project by clicking on it inside CubeIDE). Also, files are imported from TouchGFX which means that I can't create a new file such as a new source or header files inside CubeIDE. Is there any workaround? Or something I did bad?