Buggy homebrew display firmware - help me fix the co5300/sh8601 driver + lvgl9 setup?

Hello,

I’ve been struggling to get a knob-style display to work as ebike-display. Device is a 1.5" amoled display powered by an esp32s3 and co5300 qspi ic. All compilation and libraries issue seem resolved and right now I’m just trying to print stuff on the screen using lvlg-master (so 9.3). Couldn’t get it to run with the co5300 driver so I used sh8601 and the custom init command from the vendor. It definitely shows something, but it’s very buggy and the colors are wrong. I learned a lot in the last weeks but still a noob when it comes to low level hardware setups, so any help would be greatly appreciated. Attached the main code. Thanks!

knob_display.c (4.9 KB)

static void lv_tick_inc_cb(void *arg) {
    lv_tick_inc((uint32_t)(uintptr_t)arg);
}

this isnt ok by me.?

Tried this but it doesn t make any difference.
static void lv_tick_inc_cb(void *arg) { lv_tick_inc(2); }

Do you think the tick implementation is the problem ? This portion of code is from the vendor’s example, but I can try using the lv_tick_set_cb(); command instead.

For simple basic checking i place to display some spinner. Must smooth animate… Next issues seems be in traffic your gui to display maybe try start with slower SPI clock… And why (2) if your timer is set to 1ms ???

Sorry, that’s a typo. I played around with the ticker and don’t think that’s the culprit since the quality is not improving. I put on a simple spinner (Thanks for the tip!) and lowered the clock in file esp_lcd_sh8601.h to 20 (from 40). Still looks horrible. Notice that the animation actually runs smoothly, it’s only the way it’s rendered that sucks! Also the serial console shows that the watchdog is triggered every 1-2min, so something goes quite wrong…

EDIT: I’m comparing the vendor’s example (which kindof works) with lvlg8.3 to my lvlg9 port, and one of the main difference is
LVLG8:

lv_color_t *buf1 = heap_caps_malloc(EXAMPLE_LVGL_BUFF_SIZE * sizeof(lv_color_t), MALLOC_CAP_DMA);
    assert(buf1);
    lv_color_t *buf2 = heap_caps_malloc(EXAMPLE_LVGL_BUFF_SIZE * sizeof(lv_color_t), MALLOC_CAP_DMA);
    assert(buf2);
    // initialize LVGL draw buffers
    lv_disp_draw_buf_init(&disp_buf, buf1, buf2, EXAMPLE_LVGL_BUFF_SIZE);

My code:

size_t buf_size = (LCD_H_RES * LCD_V_RES / 10) * 2;  // 2 bytes per pixel for RGB565
    uint8_t *buf1 = heap_caps_aligned_alloc(64, buf_size, MALLOC_CAP_DMA);
    assert(buf1);
    lv_display_set_buffers(disp, buf1, NULL, buf_size, LV_DISPLAY_RENDER_MODE_PARTIAL);

Is there a problem with lv_display_set_buffers on my device ? Am I calling the function with the wrong parameters ?

I’ve narrowed the problem down to the migration from 8.3 to 9 - currently posted here in a new topic for better clarity since this description can be misleading. Can someone close / delete this topic ? Thank you!