Transplanting TouchGFX on ART-Pi H750 (1)——Use STM32CUBMX to generate TouchGFX project

table of Contents

Transplant TouchGFX on ART-Pi H750 (1)-Use STM32CUBMX to generate TouchGFX project
Transplant TouchGFX on ART-Pi H750 (2)-Make MDK's external QSPI-FLASH programming algorithm
Transplant TouchGFX on ART-Pi H750 ( Three)-Transplant TouchGFX to RT-Thread system Transplant TouchGFX
on ART-Pi H750 (four)-Use RT-Thread Studio to transplant TouchGFX and transplant TouchGFX
on ART-Pi H750 (5)-Make ST-LINK external QSPI-FLASH programming algorithm

experiment platform:

Hardware: RT-Thread official ART-PI H750 development version, Punctual Atom 4.3 inch RGBLCD screen (800*480)
Software: the latest version of STM32CubeH7 firmware library, TouchGFXDesigner v4.14 and STM32CubeMX V6.0.1, development environment MDK v5.29
Insert picture description here

Code download:

CSDN:https://download.csdn.net/download/sinat_31039061/12849862

Contact the author:

Follow the official account, view it for free, reply to "add group", join the technical exchange group
Insert picture description here

Create a TouchGFX UI project from scratch

Select MCU model (STM32H750XBH6)

Insert picture description here

Select and configure components (systems, peripherals, middleware)

Insert picture description here

System needs

RCC

SYS

GUI function required

I2C

FMC

Add the initialization code of SDRAM in the main program:

#define REFRESH_COUNT        677
#define SDRAM_TIMEOUT                            ((uint32_t)0xFFFF)
#define SDRAM_MODEREG_BURST_LENGTH_1             ((uint16_t)0x0000)
#define SDRAM_MODEREG_BURST_LENGTH_2             ((uint16_t)0x0001)
#define SDRAM_MODEREG_BURST_LENGTH_4             ((uint16_t)0x0002)
#define SDRAM_MODEREG_BURST_LENGTH_8             ((uint16_t)0x0004)
#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL      ((uint16_t)0x0000)
#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED     ((uint16_t)0x0008)
#define SDRAM_MODEREG_CAS_LATENCY_2              ((uint16_t)0x0020)
#define SDRAM_MODEREG_CAS_LATENCY_3              ((uint16_t)0x0030)
#define SDRAM_MODEREG_OPERATING_MODE_STANDARD    ((uint16_t)0x0000)
#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000) 
#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE     ((uint16_t)0x0200) 
void MX_SDRAM_InitEx(void)
{
    
    
  __IO uint32_t tmpmrd = 0;
  
  /* Step 1: Configure a clock configuration enable command */
  Command.CommandMode            = FMC_SDRAM_CMD_CLK_ENABLE;
  Command.CommandTarget          =  FMC_SDRAM_CMD_TARGET_BANK1;
  Command.AutoRefreshNumber      = 1;
  Command.ModeRegisterDefinition = 0;

  /* Send the command */
  HAL_SDRAM_SendCommand(&hsdram1, &Command, SDRAM_TIMEOUT);

  /* Step 2: Insert 100 us minimum delay */ 
  /* Inserted delay is equal to 1 ms due to systick time base unit (ms) */
  HAL_Delay(1);
    
  /* Step 3: Configure a PALL (precharge all) command */ 
  Command.CommandMode            = FMC_SDRAM_CMD_PALL;
  Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
  Command.AutoRefreshNumber      = 1;
  Command.ModeRegisterDefinition = 0;

  /* Send the command */
  HAL_SDRAM_SendCommand(&hsdram1, &Command, SDRAM_TIMEOUT);  
  
  /* Step 4: Configure an Auto Refresh command */ 
  Command.CommandMode            = FMC_SDRAM_CMD_AUTOREFRESH_MODE;
  Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
  Command.AutoRefreshNumber      = 4;
  Command.ModeRegisterDefinition = 0;

  /* Send the command */
  HAL_SDRAM_SendCommand(&hsdram1, &Command, SDRAM_TIMEOUT);
  
  /* Step 5: Program the external memory mode register */
  tmpmrd = (uint32_t)SDRAM_MODEREG_BURST_LENGTH_4          |\
                     SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL   |\
                     SDRAM_MODEREG_CAS_LATENCY_2           |\
                     SDRAM_MODEREG_OPERATING_MODE_STANDARD |\
                     SDRAM_MODEREG_WRITEBURST_MODE_SINGLE;

  Command.CommandMode            = FMC_SDRAM_CMD_LOAD_MODE;
  Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
  Command.AutoRefreshNumber      = 1;
  Command.ModeRegisterDefinition = tmpmrd;

  /* Send the command */
  HAL_SDRAM_SendCommand(&hsdram1, &Command, SDRAM_TIMEOUT);
  
  /* Step 6: Set the refresh rate counter */
  /* Set the device refresh rate */
  HAL_SDRAM_ProgramRefreshRate(&hsdram1, REFRESH_COUNT); 
}

QUADSPI

DMA2D

LCDC
LTDC basic parameter setting

Layer parameter setting
Insert picture description here
CRC

NVIC

Middleware needs

Basic parameter configuration

Tasks and queues

Insert picture description here
TouchGFX software package

Application layer needs

UART
UART4

Configure the clock tree

Insert picture description here
Insert picture description here

Set up the project and generate the project

Insert picture description here
Insert picture description here

Execute TouchGFX Designer

Insert picture description here
Insert picture description here

Test TouchGFX display basic UI

Insert picture description here

Guess you like

Origin blog.csdn.net/sinat_31039061/article/details/108599356