AnsweredAssumed Answered

STemWin on STM32F769I-DISCO

Question asked by Christian B on Jul 4, 2018
Latest reply on Jul 6, 2018 by Christian B

Hi,

 

I'm trying to run a STemWin hello world example on the STM32F769I-DISCO but I only get a black screen. I generated code with CubeMX and I think something of the configuration is wrong.

 

Here is some of the generated configuration code:

 

HW_Init.c:

void MX_LCD_Init(void)
{
 LTDC_LayerCfgTypeDef pLayerCfg;

 

/* De-Initialize LTDC */
  HAL_LTDC_DeInit(&hltdc);
/* Configure LTDC */

 

  hltdc.Instance = LTDC;
  hltdc.Init.HSPolarity = LTDC_HSPOLARITY_AL;
  hltdc.Init.VSPolarity = LTDC_VSPOLARITY_AL;
  hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AL;
  hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
  hltdc.Init.HorizontalSync = 7;
  hltdc.Init.VerticalSync = 3;
  hltdc.Init.AccumulatedHBP = 14;
  hltdc.Init.AccumulatedVBP = 5;
  hltdc.Init.AccumulatedActiveW = 814;
  hltdc.Init.AccumulatedActiveH = 485;
  hltdc.Init.TotalWidth = 820;
  hltdc.Init.TotalHeigh = 487;
  hltdc.Init.Backcolor.Blue = 0;
  hltdc.Init.Backcolor.Green = 0;
  hltdc.Init.Backcolor.Red = 0;
  if (HAL_LTDC_Init(&hltdc) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

 

  pLayerCfg.WindowX0 = 0;
  pLayerCfg.WindowX1 = 0;
  pLayerCfg.WindowY0 = 0;
  pLayerCfg.WindowY1 = 0;
  pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
  pLayerCfg.Alpha = 0;
  pLayerCfg.Alpha0 = 0;
  pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
  pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
  pLayerCfg.FBStartAdress = 0xC0000000;
  pLayerCfg.ImageWidth = 800;
  pLayerCfg.ImageHeight = 480;
  pLayerCfg.Backcolor.Blue = 0;
  pLayerCfg.Backcolor.Green = 0;
  pLayerCfg.Backcolor.Red = 0;
  if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

 

}

 

void MX_FMC_Init(void)
{  
/* FMC initialization function */
  FMC_SDRAM_TimingTypeDef SdramTiming;

 

  /** Perform the SDRAM1 memory initialization sequence
  */
  hsdram1.Instance = FMC_SDRAM_DEVICE;
  /* hsdram1.Init */
  hsdram1.Init.SDBank = FMC_SDRAM_BANK1;
  hsdram1.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_8;
  hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_12;
  hsdram1.Init.MemoryDataWidth = FMC_SDRAM_MEM_BUS_WIDTH_16;
  hsdram1.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
  hsdram1.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_2;
  hsdram1.Init.WriteProtection = FMC_SDRAM_WRITE_PROTECTION_DISABLE;
  hsdram1.Init.SDClockPeriod = FMC_SDRAM_CLOCK_PERIOD_2;
  hsdram1.Init.ReadBurst = FMC_SDRAM_RBURST_ENABLE;
  hsdram1.Init.ReadPipeDelay = FMC_SDRAM_RPIPE_DELAY_0;
  /* SdramTiming */
  SdramTiming.LoadToActiveDelay = 2;
  SdramTiming.ExitSelfRefreshDelay = 7;
  SdramTiming.SelfRefreshTime = 4;
  SdramTiming.RowCycleDelay = 7;
  SdramTiming.WriteRecoveryTime = 3;
  SdramTiming.RPDelay = 2;
  SdramTiming.RCDDelay = 2;

 

  if (HAL_SDRAM_Init(&hsdram1, &SdramTiming) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

 

}

[...]

 

void MX_DMA2D_Init(void)
{
/* Configure the DMA2D default mode */

 

  hdma2d.Instance = DMA2D;
  hdma2d.Init.Mode = DMA2D_M2M;
  hdma2d.Init.ColorMode = DMA2D_OUTPUT_ARGB8888;
  hdma2d.Init.OutputOffset = 0;
  hdma2d.LayerCfg[1].InputOffset = 0;
  hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_ARGB8888;
  hdma2d.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
  hdma2d.LayerCfg[1].InputAlpha = 0;
  hdma2d.LayerCfg[1].AlphaInverted = DMA2D_REGULAR_ALPHA;
  hdma2d.LayerCfg[1].RedBlueSwap = DMA2D_RB_REGULAR;
  if (HAL_DMA2D_Init(&hdma2d) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

 

  if (HAL_DMA2D_ConfigLayer(&hdma2d, 1) != HAL_OK)
  {
    _Error_Handler(__FILE__, __LINE__);
  }

 

}

[...]

 

STemwin_wrapper.c

#define XSIZE_PHYS      800
#define YSIZE_PHYS      480   

 

#define NUM_BUFFERS         2   /* Number of multiple buffers to be used */
#define NUM_VSCREENS        1  /* Number of virtual screens to be used */

 

#define COLOR_CONVERSION_0      GUICC_8888
#define DISPLAY_DRIVER_0        GUIDRV_LIN_32

 

#define LCD_LAYER0_FRAME_BUFFER        ((uint32_t)0xc0000000) /* LTDC Layer 0 frame buffer */

 

extern LTDC_HandleTypeDef    hltdc;
extern DMA2D_HandleTypeDef   hdma2d;

 

extern volatile GUI_TIMER_TIME OS_TimeMS;

 

static          LCD_LayerPropTypedef          layer_prop[GUI_NUM_LAYERS];
volatile char   TransferInProgress  = 0;

 

static const LCD_API_COLOR_CONV * apColorConvAPI[] =
{
  COLOR_CONVERSION_0,

};

[...]

 

GUI_App.c

[...]

void GRAPHICS_MainTask(void) {

 

    /* USER CODE BEGIN GRAPHICS_MainTask */
    /* User can implement his graphic application here */
    /* Hello Word example */
    GUI_Clear();
    GUI_SetColor(GUI_RED);
    GUI_SetFont(&GUI_Font32_1);
    GUI_DispStringAt("Hello world!", (LCD_GetXSize() - 150) / 2, (LCD_GetYSize() - 20) / 2);

 

    /* USER CODE END GRAPHICS_MainTask */
    while(1)
    {
        GUI_Delay(100);
    }
}

main.cpp

[...]

int main(void)
{
  /* USER CODE BEGIN 1 */

 

//    JPEG_InitColorTables();
  /* USER CODE END 1 */

 

  /* Enable I-Cache-------------------------------------------------------------*/
    SCB_EnableICache();

 

  /* Enable D-Cache-------------------------------------------------------------*/
    SCB_EnableDCache();

 

  /* MCU Configuration----------------------------------------------------------*/

 

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
//  HAL_Init();

 

  /* USER CODE BEGIN Init */

 

  /* USER CODE END Init */

 

  /* Configure the system clock */
    SystemClock_Config();

 

  /* USER CODE BEGIN SysInit */

 

  /* USER CODE END SysInit */

 

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_DMA_Init();
  MX_ADC1_Init();
  MX_ADC3_Init();
  MX_I2C1_Init();
  MX_I2C4_Init();
  MX_QUADSPI_Init();
  MX_RTC_Init();
  MX_SAI1_Init();
  MX_SAI2_Init();
  MX_SPDIFRX_Init();
  MX_SPI2_Init();
  MX_TIM3_Init();
  MX_TIM10_Init();
  MX_TIM11_Init();
  MX_TIM12_Init();
  MX_UART5_Init();
  MX_USART1_UART_Init();
  MX_USART6_UART_Init();
  MX_USB_OTG_HS_PCD_Init();
  MX_JPEG_Init();
  MX_LIBJPEG_Init();
  MX_DSIHOST_DSI_Init();
  MX_HDMI_CEC_Init();
  MX_CRC_Init();
  /* USER CODE BEGIN 2 */
  /* USER CODE END 2 */

 

/* Initialise the graphical hardware */
  GRAPHICS_HW_Init();

 

  /* Initialise the graphical stack engine */
  GRAPHICS_Init();
 
  /* Graphic application */  
  GRAPHICS_MainTask();
    
  /* Infinite loop */
  for(;;);
}

[...]

GUIConf.c

[...]

#define GUI_NUMBYTES  (1024) *  110   // x KByte

[...]

 

Can someone tell me why it's not working? I think I posted the most related code but if something is missing I can post it.

Edit: I uploaded the .ioc file


Thanks in advanced!

Attachments

Outcomes