Skip to main content
EBesh.1
Associate
October 10, 2022
Question

TouchGFX with STM32F767ZI, ILI9341 SPI display

  • October 10, 2022
  • 2 replies
  • 3848 views

Hello,

I am trying to use TouchGFX with STM32F767ZI with a TFT SPI ILI9341 display. I have tried compiling the code using both STM32 Cube IDE and KEIL u5. With Cube IDE, the code does compile but I do not have any output on the screen (I am using the libraries provided for this display that have the functions to draw bit map and set window), whereas with KEIL I get many L6869W warnings and the project doesn't build. I have also tried switching to STM32F411, but I am experiencing the same problem. It would be greatly appreciated if you could assist me with that.

This topic has been closed for replies.

2 replies

EBesh.1
EBesh.1Author
Associate
October 10, 2022

@Martin KJELDSEN​ please can you help me with that

Martin KJELDSEN
Principal III
October 12, 2022

Hi,

Did you debug the communication to the display with a logic analyzer/scope? Is anything happening over SPIx ?

/Martin

EBesh.1
EBesh.1Author
Associate
October 12, 2022

when calling MX_TouchGFX_Process() in while(1), my logic analyzer doesn't show anything at all and the fault might be with my settings.

However, I used an oscilloscope and I see 8 clock cycles ( I am using SPI - 8bit). Still the clock signal is very disturbed ( I m using 25MHz as SPI CLK speed). I checked all other lines and don't know why MOSI is always high.

MM..1
Chief III
October 10, 2022

TouchGFX and SPI displays is custom mode. You need implement parts code for hw manage.

Read docu and create first clean working code ...

EBesh.1
EBesh.1Author
Associate
October 10, 2022

I am following this tutorial https://www.youtube.com/watch?v=suMytEyQTP4&t=662s and I use TouchGFX_DataTransfer.h and TouchGFX_DataTransfer.c for connecting TouchGFX with SPI but still it doesn't work.

The functions are as follows :

/* Functions called by the TouchGFX HAL to invoke the actual data transfer to ILI9341.

 * Pero, 2021

 */

#ifndef TOUCHGFX_DATATRANSFER_H

#define TOUCHGFX_DATATRANSFER_H

#include <stdint.h>

#ifdef __cplusplus

 extern "C" {

#endif

void touchgfxDisplayDriverTransmitBlock(uint8_t* pixels, uint16_t x, uint16_t y, uint16_t w, uint16_t h);

uint32_t touchgfxDisplayDriverTransmitActive(void);

#ifdef __cplusplus

}

#endif

#endif

__________________________________________________________________________

/* Functions called by the TouchGFX HAL to invoke the actual data transfer to ILI9341.

 * Pero, 2021

 */

#include "ili9341.h"

#include "TouchGFX_DataTransfer.h"

extern void DisplayDriver_TransferCompleteCallback();

static uint8_t isTransmittingData = 0;

uint32_t touchgfxDisplayDriverTransmitActive(void)

{

return isTransmittingData;

}

void touchgfxDisplayDriverTransmitBlock(uint8_t* pixels, uint16_t x, uint16_t y, uint16_t w, uint16_t h)

{

isTransmittingData = 1;

ILI9341_SetWindow(x, y, x+w-1, y+h-1);

ILI9341_DrawBitmap(w, h, pixels);

}

void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi)

{

if (hspi->Instance == SPI1) {

ILI9341_EndOfDrawBitmap();

isTransmittingData = 0;

DisplayDriver_TransferCompleteCallback();

}

}

MM..1
Chief III
October 10, 2022

Have you tested

ILI9341_SetWindow(x, y, x+w-1, y+h-1);
ILI9341_DrawBitmap(w, h, pixels);

work without touchgfx . Scope you SPI and control signals...

Is your pinout config ok in code ?