STM32F429-DISC1 issue

Description

I’ve taken the stm32f429_disco_no_os_sw4stm32 git project and set it up for my STM32F429-DISC1 board using IAR to build. I have it compiling and loading Ok, but I have a screen issue that someone may possibly know how to fix quickly. It’s showing some things multiple times. I didn’t change any of the project settings.

What MCU/Processor/Board and compiler are you using?

STM32F429-DISC1 board with IAR EWARM 9.50.2

What LVGL version are you using?

8.0.0

What do you want to achieve?

Fix the screen splitting issue

What have you tried so far?

I checked all the vectors were correct (I had to change the startup file) and I checked SysTick_Handler() is being called and in turn it calls lv_tick_inc(). I checked the schematics between DISC0 and DISC1 and they connected some jumpers for a serial port which I think weren’t connected on the DISC0. I updated the stm32f429i_discovery.h/.c files to get the latest USE_STM32F429I_DISCOVERY_REVD define and I defined it in the IAR project setup (I know it’s not that causing the issue, but thought I’d mention it anyway). I recently had another touchscreen based on the ili9341 not work at all and that turned out to be a timing issue, and this looks something like it could be a timing issue. Any ideas where to look first? The ili9341 startup code is being called and running through with no issues.

1 Like

I checked all the LCD setup commands and timings against the ST project for the board and they are identical. I haven’t checked the SDRAM setup yet, but then I was playing around on the screen and this image came up.

As that keyboard is being displayed properly, and the background isn’t I thought I’d update LVGL in case there was a bugfix or something.I updated to LVGL 8.0.2 There was no change after that.

Still looking.

The original buff setup code in tft.c was:

static lv_color_t disp_buf1[TFT_HOR_RES * 60];
static lv_color_t disp_buf2[TFT_HOR_RES * 60];
static lv_disp_draw_buf_t buf;
lv_disp_draw_buf_init(&buf, disp_buf1, disp_buf2, TFT_HOR_RES * 40);

The screen shown was:

I changed it to the following to see if there were any changes:
static lv_color_t disp_buf1[TFT_HOR_RES * 10];
static lv_color_t disp_buf2[TFT_HOR_RES * 10];
static lv_disp_draw_buf_t buf;
lv_disp_draw_buf_init(&buf, disp_buf1, disp_buf2, TFT_HOR_RES * 10);

The screen changed to:

Then I defined LV_USE_REFR_DEBUG as 1
/1: Draw random colored rectangles over the redrawn areas/
#define LV_USE_REFR_DEBUG 1

The screen changed to:

Now I can scroll down and it looks like it’s working except for the colored rectangles.

I also get an unused var (y1_flush) from compiler in tft_flush():

static void tft_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_p)
{
/Return if the area is out the screen/
if(area->x2 < 0) return;
if(area->y2 < 0) return;
if(area->x1 > TFT_HOR_RES - 1) return;
if(area->y1 > TFT_VER_RES - 1) return;

/*Truncate the area to the screen*/
int32_t act_x1 = area->x1 < 0 ? 0 : area->x1;
int32_t act_y1 = area->y1 < 0 ? 0 : area->y1;
int32_t act_x2 = area->x2 > TFT_HOR_RES - 1 ? TFT_HOR_RES - 1 : area->x2;
int32_t act_y2 = area->y2 > TFT_VER_RES - 1 ? TFT_VER_RES - 1 : area->y2;

x1_flush = act_x1;
y1_flush = act_y1;
x2_flush = act_x2;
y2_fill = act_y2;
y_fill_act = act_y1;
buf_to_flush = color_p;


  /*##-7- Start the DMA transfer using the interrupt mode #*/
  /* Configure the source, destination and buffer size DMA fields and Start DMA Stream transfer */
  /* Enable All the DMA interrupts */
HAL_StatusTypeDef err;
err = HAL_DMA_Start_IT(&DmaHandle,(uint32_t)buf_to_flush, (uint32_t)&my_fb[y_fill_act * TFT_HOR_RES + x1_flush],
		  (x2_flush - x1_flush + 1));
if(err != HAL_OK)
{
	while(1);	/*Halt on error*/
}

}

I’ll dig further here as it looks like I’m perhaps on the right track.

That was all good. Once I checked that function and traced it back up I knew I was on the wrong track as it obv goes back into well tested code in lvgl_refr.c.

So I started looking at project settings and I started turning off warnings (enum mixed with another type) and things like that and then I was able to see that the DMA2D clock was not enabled in lv_gpu_stm32_dma2d.c as STM32F4 was not enabled at that point. It was defined eventually and I had checked that but it was NOT defined when this file was compiled. So I set it in my project settings and: