Description
Draw buffers display duplicates / Porting to TI RM48 Controller / Winstar WF28KTZ/ST7789(SPI)
What MCU/Processor/Board and compiler are you using?
TI RM48 Controller/ Compiler: ti-cgt-arm_20.2.7.LTS / Custom board / FreeRTOS
What LVGL version are you using?
9.2/9.3
What do you want to achieve?
Display “Hello World” example after porting to this target system
What have you tried so far?
- Increased/Decreased draw buffers
- Single/Double buffer usage
- Increased various buffers e.g. LV_MEM_SIZE / LV_DRAW_LAYER_SIMPLE_BUF_SIZE /LV_DRAW_THREAD_STACK_SIZE
- SPI Tx with DMA/Polling m
Code to reproduce
#define DISPLAY_H_PIXEL 240U
#define DISPLAY_V_PIXEL 320U
#define DISPLAY_BYTE_PER_PIXEL ( LV_COLOR_FORMAT_GET_SIZE( LV_COLOR_FORMAT_RGB565 ))
#define DISPLAY_DRAW_BUF_SIZE ( DISPLAY_H_PIXEL * DISPLAY_V_PIXEL * DISPLAY_BYTE_PER_PIXEL / 10U )
uint8_t DisplayDrawBufA[ DISPLAY_DRAW_BUF_SIZE ];
uint8_t DisplayDrawBufB[ DISPLAY_DRAW_BUF_SIZE ];
/* LVGL Display data holding */
lv_display_t *Display;
/*------------------------------------------------------------------------------*/
void DisplayTask ( void *pvParamters )
/*------------------------------------------------------------------------------*/
{
/* Init LVGL */
lv_init();
/* Set LVGL tick system */
lv_tick_set_cb( xTaskGetTickCount );
/* Setup/Create display */
Display = lv_st7789_create( DISPLAY_H_PIXEL, DISPLAY_V_PIXEL, LV_LCD_FLAG_NONE, (lv_st7789_send_cmd_cb_t)DisplaySendCmd, (lv_st7789_send_color_cb_t)DisplaySendColor );
pixelSize = lv_color_format_get_size( lv_display_get_color_format( Display ));
/* Register LVGL timer system to FreeRTOS */
lv_tick_set_cb( (lv_tick_get_cb_t)pdMS_TO_TICKS( xTaskGetTickCount));
/* Display buffer setup */
lv_display_set_buffers( Display, DisplayDrawBufA, DisplayDrawBufB, sizeof( DisplayDrawBufA), LV_DISPLAY_RENDER_MODE_PARTIAL );
/* Resume DisplayLVGLTimerRunTask */
vTaskResume( DisplayLVGLTimerRunTaskHandle );
lv_lock();
lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0x003a57), LV_PART_MAIN );
/*Create a white label, set its text and align it to the center*/
label = lv_label_create(lv_screen_active());
lv_label_set_text(label, "Hello World");
lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0xffffff), LV_PART_MAIN);
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
lv_unlock();
/* Tasks endless loop */
for(;;)
{
vTaskDelay ( pdMS_TO_TICKS( 200 ));
}
}
/*------------------------------------------------------------------------------*/
/*! \brief
* Task to periodically handle LVGL timer system
*
*/
/*------------------------------------------------------------------------------*/
void
DisplayLVGLTimerRunTask ( void *pvParamters )
/*------------------------------------------------------------------------------*/
{
uint32_t timeTillNextRun_ms = 0U;
/* Put task into sleep until woken up after LVGL init within DisplayTask() */
vTaskSuspend( NULL );
/* Tasks endless loop */
for(;;)
{
timeTillNextRun_ms = lv_timer_handler();
if( timeTillNextRun_ms == LV_NO_TIMER_READY )
{
timeTillNextRun_ms = LV_DEF_REFR_PERIOD; /* Try again soon because the other thread can make the timer ready */
}
vTaskDelay( pdMS_TO_TICKS( timeTillNextRun_ms ));
}
}
Screenshot and/or video
lv_conf.h (35.6 KB)