Xiao ESP32S3 + Round Display + Squareline Studio = blank screen?

What am I doing wrong. I downloaded squareline studio. Installed it.
Created a new project for arduino, lvgl 8.3, round display, 240x240,16 bit. Rechecked in project settings.

Made a simple UI with an Arc, a label value, and an event. Play in Squareline: works. Export.

Then in ArduinoIDE, I replaced the lvgl files by those from seeed, samen for tft-espi. Set the correct folders and changed the code slightly.

First I got a crashing ESP on loop. This turned out to be the BSP. Downgraded to 2.0.8, and now it compiles, does not crash, and on the serial port it sais ‘setup done’.

However, there’s nothing on the screen.

The relevant code (chaged to use the round display driver from seeed):


#include "Arduino.h"
#define TOUCH_CS 21
#define USE_TFT_ESPI_LIBRARY

#include <lv_xiao_round_screen.h>


#include <ui.h>

static const uint16_t screenWidth  = 240;
static const uint16_t screenHeight = 240;

static lv_disp_draw_buf_t draw_buf;
static lv_color_t buf[ screenWidth * screenHeight / 10 ];

#if LV_USE_LOG != 0
void my_print(const char * buf)
{
    Serial.printf(buf);
    Serial.flush();
}
#endif

void my_disp_flush( lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p )
{
    uint32_t w = ( area->x2 - area->x1 + 1 );
    uint32_t h = ( area->y2 - area->y1 + 1 );

    tft.startWrite();
    tft.setAddrWindow( area->x1, area->y1, w, h );
    tft.pushColors( ( uint16_t * )&color_p->full, w * h, true );
    tft.endWrite();

    lv_disp_flush_ready( disp );
}

void my_touchpad_read( lv_indev_drv_t * indev_driver, lv_indev_data_t * data )
{
    uint16_t touchX = 0, touchY = 0;

    bool touched = false;//tft.getTouch( &touchX, &touchY, 600 );

    if( !touched )
    {
        data->state = LV_INDEV_STATE_REL;
    }
    else
    {
        data->state = LV_INDEV_STATE_PR;

        /*Set the coordinates*/
        data->point.x = touchX;
        data->point.y = touchY;

        Serial.print( "Data x " );
        Serial.println( touchX );

        Serial.print( "Data y " );
        Serial.println( touchY );
    }
}

void setup()
{
    Serial.begin( 115200 ); /* prepare for possible serial debug */
    while (!Serial) {}
    delay(1000);
    String LVGL_Arduino = "Hello Arduino! ";
    LVGL_Arduino += String('V') + lv_version_major() + "." + lv_version_minor() + "." + lv_version_patch();

    Serial.println( LVGL_Arduino );
    Serial.println( "I am LVGL_Arduino" );

    lv_init();
    lv_xiao_disp_init();
    lv_xiao_touch_init();

#if LV_USE_LOG != 0
    lv_log_register_print_cb( my_print ); /* register print function for debugging */
#endif

    tft.begin();          /* TFT init */
    tft.setRotation( 3 ); /* Landscape orientation, flipped */

    lv_disp_draw_buf_init( &draw_buf, buf, NULL, screenWidth * screenHeight / 10 );


    [bunch of code cut out to shorten post]

    ui_init();

    Serial.println( "Setup done" );
}

void loop()
{
    lv_timer_handler(); /* let the GUI do its work */
    delay(5);
}
2 Likes

The compiler output:

FQBN: esp32:esp32:XIAO_ESP32S3
Using board 'XIAO_ESP32S3' from platform in folder: C:\Users\Boss\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8
Using core 'esp32' from platform in folder: C:\Users\Boss\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8

Alternatives for lv_xiao_round_screen.h: [Seeed Arduino Round [email protected]]
ResolveLibrary(lv_xiao_round_screen.h)
  -> candidates: [Seeed Arduino Round [email protected]]
Alternatives for lvgl.h: [[email protected]]
ResolveLibrary(lvgl.h)
  -> candidates: [[email protected]]
C:\Users\Boss\AppData\Local\Arduino15\packages\esp32
Alternatives for SPI.h: [[email protected]]
ResolveLibrary(SPI.h)
  -> candidates: [[email protected]]
Alternatives for Wire.h: [[email protected]]
ResolveLibrary(Wire.h)
  -> candidates: [[email protected]]
C:\Users\Boss\AppData\Local
Alternatives for TFT_eSPI.h: [[email protected]]
ResolveLibrary(TFT_eSPI.h)
  -> candidates: [[email protected]]
C:ternatives for FS.h: [[email protected]]
ResolveLibrary(FS.h)
  -> candidates: [[email protected]]
C:ternatives for SPIFFS.h: [[email protected]]
ResolveLibrary(SPIFFS.h)
  -> candidates: [[email protected]]
C:ternatives for ui.h: [[email protected]]
ResolveLibrary(ui.h)
  -> candidates: [[email protected]]
Successfully created esp32s3 image.
Using library Seeed Arduino Round display at version 1.0.0 in folder: C:\Users\Boss\Documents\Arduino\Zetleffs\Zethleffs\libraries\Seeed_Arduino_Round_display 
Using library lvgl at version 8.3.4 in folder: C:\Users\Boss\Documents\Arduino\Zetleffs\Zethleffs\libraries\lvgl 
Using library SPI at version 2.0.0 in folder: C:\Users\Boss\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\SPI 
Using library Wire at version 2.0.0 in folder: C:\Users\Boss\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\Wire 
Using library TFT_eSPI at version 2.5.43 in folder: C:\Users\Boss\Documents\Arduino\Zetleffs\Zethleffs\libraries\TFT_eSPI 
Using library FS at version 2.0.0 in folder: C:\Users\Boss\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\FS 
Using library SPIFFS at version 2.0.0 in folder: C:\Users\Boss\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\SPIFFS 
Using library ui at version 1.0 in folder: C:\Users\Boss\Documents\Arduino\Zetleffs\Zethleffs\libraries\ui 
"C:\\Users\\Boss\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\xtensa-esp32s3-elf-gcc\\esp-2021r2-patch5-8.4.0/bin/xtensa-esp32s3-elf-size" -A "C:\\Users\\Boss\\AppData\\Local\\arduino\\sketches\\875BA762347BFD895E39EA50296BDC30/ui.ino.elf"
Sketch uses 589477 bytes (17%) of program storage space. Maximum is 3342336 bytes.
Global variables use 87056 bytes (26%) of dynamic memory, leaving 240624 bytes for local variables. Maximum is 327680 bytes.
"Cptool.py v4.5.1
Serial port COM19
Connecting...
Chip is ESP32-S3 (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: d8:3b:da:74:96:b4
Uploading stub...
Running stub...
Stub running...

So, what am I doing wrong?

1 Like

Hi there,

Probably something basic , you missed…
It works though to be sure… :+1: /, <UI.C> and all…


GL :slight_smile: PJ :v:

Zdi
to be Imprint sure… :+1: between Keyboard and the Floor :grin:
Tested working with S3 & S3-Plus.
A few Moments Later…
And the C6 as Well…

And yet another answer which helps no-one.

You just could not resist, could you?

Oh the irony… I got it working fine now, including touch and bluetooth.

The issue was caused by… PJ_Glasso. Who stated in another thread the only correct BSP for this would be 2.0.8.

This caused the issue. As 2.0.8 didn’t work. Upgraded back to the latest version, and see there, it works.

Gotta love the irony…

1 Like

A monkeyface can sometimes give bad advice… but the concept was sound definatly every module can have different quirks so usually the new modules are not fully supported… he may have made that statement back when the MCU was not yet fully supported in the code

mightt be, doesn’t really matter. In any case, got it to work.

@zikken - Thanks for the update :slight_smile: Saved me a lot of issues with BSP versioning!

Hi there,

So exactly correct, Some Sketches like the GifPlayer the BSP was 2.0.8 but it relied on the edits too in the TFT lib User.selects. file.
of course LvGL is different, only experienced users would know.

For the SLS stuff you need, 3.0.7 and LvGL at 8.3.4. I did not disclose it because I was not asked :grin: instead the other.
It’s all good in the END , as I show it’s great hardware the Round display, a little complex for some but it works and Looks really good!

As you were…

GL :slight_smile: PJ :v:

and here is the useful video :+1: