lvgl: compile error when #define LV_USE_OS LV_OS_FREERTOS

LVGL version

9.0.1

What happened?

In Visual Studio + PlatformIO, when I change lv_conf.h to set LV_USE_OS to LV_OS_FREERTOS, I get the following compile error:

In file included from C:/Users/Bart/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/freertos/include/freertos/portable.h:51,
                 from C:/Users/Bart/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/freertos/include/freertos/FreeRTOS.h:63,
                 from lib/lvgl/src/osal/lv_freertos.h:26,
                 from lib/lvgl/src/osal/lv_os.h:30,
                 from lib/lvgl/src/osal/lv_freertos.c:15:
lib/lvgl/src/osal/lv_freertos.c: In function 'prvCheckMutexInit':
C:/Users/Bart/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/freertos/port/xtensa/include/freertos/portmacro.h:476:53: error: too few arguments to function 'vPortEnterCritical'
 #define portENTER_CRITICAL(mux)                     vPortEnterCritical(mux)
                                                     ^~~~~~~~~~~~~~~~~~
C:/Users/Bart/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/freertos/include/freertos/task.h:222:35: note: in expansion of macro 'portENTER_CRITICAL'
 #define taskENTER_CRITICAL( x )   portENTER_CRITICAL( x )
                                   ^~~~~~~~~~~~~~~~~~
lib/lvgl/src/osal/lv_freertos.c:339:9: note: in expansion of macro 'taskENTER_CRITICAL'
         taskENTER_CRITICAL();
         ^~~~~~~~~~~~~~~~~~
C:/Users/Bart/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/freertos/port/xtensa/include/freertos/portmacro.h:576:51: note: declared here 
 static inline void __attribute__((always_inline)) vPortEnterCritical(portMUX_TYPE *mux)

The problem seems to be in lib/lvgl/src/osal/lv_freertos.c:339:9 because taskENTER_CRITICAL() is called without mutex argument.

I’m using the espressif32 platform.

Processing esp32-s3-devkitc-1 (platform: espressif32; board: esp32-s3-devkitc-1; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-s3-devkitc-1.html
PLATFORM: Espressif 32 (6.5.0) > Espressif ESP32-S3-DevKitC-1-N8 (8 MB QD, No PSRAM)
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
DEBUG: Current (esp-builtin) On-board (esp-builtin) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 @ 3.20014.231204 (2.0.14)
 - tool-esptoolpy @ 1.40501.0 (4.5.1)
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5   
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 35 compatible libraries
Scanning dependencies...
Dependency Graph
|-- TFT_eSPI @ 2.5.43
|-- lvgl @ 9.0.1-dev

lv_conf.zip

How to reproduce?

My full lv_conf.zp is attached for reference.

My main.cpp is only a skeleton file so far:


#include <Arduino.h>
#define COLOR_DEPTH 16

#include <TFT_eSPI.h>
TFT_eSPI    tft = TFT_eSPI();
//#include <../lv_conf.h>
#include "lvgl.h"

lv_display_t *display;

void setup() {
  lv_init();
  display = lv_display_create(296, 240);
}

void loop() {
}

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Reactions: 1
  • Comments: 23 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @kisvegabor

Sounds like an excellent idea to me. I’ll work on it. If you can @BahuMan I would like to ask you if you could test my changes when finished because I don’t have an development environment for ESP. I can share with you @BahuMan the branch where I’ll make the changes.

Regards Hanes

@kisvegabor In the meantime I’ll configure my development environment for ESP32 for future issues in this platform.

Sorry for the delay @kisvegabor and @BahuMan .

Yes @kisvegabor, I’ve and ESP32, I don’t remember which ont exactly but I’ve one. To test the implementation I need to prepare the development environment because I’ve never developed with the ESP32 and I must try to add the FreeRTOS of Espressif. Anyway I would like to prepare the development environment because the ESP32 is used a lot with LVGL and it could be a starting point for other issues.

Regarding testing @BahuMan. The first thing I would like to achieve is a successful compilation with the Espressif of FreeRTOS in your environment. After that we can test it with an FreeRTOS and LVGL implementation.

I’ll try to have the changes ready for this Monday in a new branch and I’ll share them with you.