cancel
Showing results for 
Search instead for 
Did you mean: 

I have a problem in integrating the STM32ubeIDE to use it with both the STM32f769i Discovery board and TouchGFX.

MSale
Associate III

I managed to compile a project without error s but every time i flash it the display become black.

15 REPLIES 15

Hi Mahmoud. I have managed to compile the code without any error by following the video. I have got a black screen too. Could you please please help me fix this. What steps did you follow to make it work?

Thanks

Nouman

@NShai.340​ 

Hi Norman,

First make sure that you are using the reset function in the board configuration cpp file

/* Configures the LCD reset pin. */

   /* USER CODE BEGIN Config_LCD_Reset_Pin */

    static void LCD_LL_Reset(void)

      {

       HAL_GPIO_WritePin(GPIOJ, GPIO_PIN_15, GPIO_PIN_RESET);

       HAL_Delay(20);

       HAL_GPIO_WritePin(GPIOJ, GPIO_PIN_15, GPIO_PIN_SET);

       HAL_Delay(20);

      }

   /* USER CODE END Config_LCD_Reset_Pin */

its commented in the generated code from cube IDE so you have to un comment it.

second will changing the pitch function in the MX_LCD_Init to this

HAL_LTDC_SetPitch(&hltdc, 800, 0);

Third MX_DSI_INIT function in HW_Init.cpp

change the CmdCfg.CommandSize = 400; to CmdCfg.CommandSize = 800;

in the same MX_DSI_INIT change the orientation from portrait to landscape

OTM8009A_Init(OTM8009A_FORMAT, OTM8009A_ORIENTATION_LANDSCAPE);

in touchgfx_init function change the display size to this

uint16_t dispWidth = 800;

 uint16_t dispHeight = 480;

i might forgot something so let me please if you need further help or if this solution worked for you.

Regards

Mahmoud

Hi Mamoud,

Thanks for getting back to me. I did all the above things but still stuck with the black screen. Could you guide me what I need to do more? U have also mentioned once that you got the rid off QSPI problem , Please also let me know what you did in that part.

Thanks .

Nouman

MSale
Associate III

@NShai.340​ 

Hi,

please make sure that LCD_LL_RESET is uncommented in the below function

void GRAPHICS_HW_Init()

{

   

   

  MX_FMC_Init();

  MX_SDRAM_InitEx();

 /* Configures the LCD reset pin. */

   /* USER CODE BEGIN LCD_reset_pin */

   LCD_LL_Reset();

   /* USER CODE END LCD_reset_pin */

  MX_LCD_Init();

  MX_DSI_Init();

  GPIO::init();

  //Deactivate speculative/cache access to first FMC Bank to save FMC bandwidth

  FMC_Bank1->BTCR[0] = 0x000030D2;

    

}

in the Main.cpp please make sure to use only this functions as some parts of the STM32F769 have some conflicts .

 /* Initialize all configured peripherals */

  MX_GPIO_Init();

  MX_CRC_Init();

  MX_QUADSPI_Init();

  MX_SPI2_Init();

  MX_UART5_Init();

 /* USER CODE BEGIN 2 */

if you want to use any thing later you can check it so you dont have problem but this will solve the touch GFX problem

Regards

Mahmoud

NShai.340
Associate II

I have did above all , but still getting the black screen. Could you please tell me with what you did to in the QSPI part to fix it.

This is also hinted here in this link https://touchgfx.zendesk.com/hc/en-us/articles/360020208091-Configuring-STM32F769I-DISCO in Add missing BSP files and update Linker script section. It asks to add QSPI start and finish part in the stm32f769xx_flash.icf file of IAR workbench .

I think, STM32CubeMX have this STM32F769NIHX_RAM.ld equivalent to stm32f769xx_flash.icf . How do I add QSPI part in STM32F769NIHX_RAM.ld ?

Thanks and Best Regards

Nouman

Note that the article that you posted falls short of setting up the board. As @Community member​ mentioned, it is key to ensure that the reset function is not commented. This does not seem to be a problem with the new version of TGFX and CubeMX. CubeMX calls for a bunch of init functions that often hangs the board. I have been fighting this for a few weeks and just now was able to fix it.

For the BSP drivers for touch screen, it is as simple as copying the Component and STM32F769Discovery folder from the BSP folder in the firmware package. You need to add those to the Path and Symbols in CUBEIDE. The display should turn on now without any trouble but the image may not be correct. The command size in the DSI init function has to be changed to 800 as does the screen width in the TouchGFX init function. All of those should work. The QSPI mentioned in the article that you linked does not seem to be necessary as I have my board running without modifying the linker script file or adding code to my main other than the BSP_Init() and BSP_ENABLEMEMORYMAPPEDmode() calls. I do have a problem where my animations (fades and movements) are not smooth. It is almost as if the screen cannot refresh fast enough. This may very well be an issue with the QSPI implementation in my files. I suggest you start with a new project and follow @Community member​ 's advise. Dont get hung with the article that you posted as it is not entirely correct.

Good luck.