Lv_qr_code fails with stack overflow


I am using a esp32 board with ssd1306 128x64 oled display. I am trying to render a qr code using lv_qr_code library, the lv_qrcode_create() function works fine. But on calling lv_qrcode_update();, there’s a stack overflow and board crashes

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


What LVGL version are you using?


What do you want to achieve?

render qr code on the ssd1306 oled

What have you tried so far?

This is the logs I got

I (1054) lvgl_helpers: Initializing I2C master for display
I (1064) lvgl_helpers: Initializing I2C master port 0...
I (1064) lvgl_helpers: SDA pin: 21, SCL pin: 22, Speed: 400000 (Hz)
I (1074) lvgl_helpers: Setting I2C master configuration...
I (1084) lvgl_helpers: Installing I2C master driver...
I (1104) bdg: init

***ERROR*** A stack overflow in task gui has been detected.

Backtrace:0x4008851f:0x3ffc98a0 0x40088bbd:0x3ffc98c0 0x40088e65:0x3ffc98e0 0x40089ad2:0x3ffc9960 0x40088f58:0x3ffc9980 0x40088f0e:0x00000000 |<-CORRUPTED
0x4008851f: panic_abort at /home/vedant/esp/esp-idf/components/esp_system/panic.c:330

0x40088bbd: esp_system_abort at /home/vedant/esp/esp-idf/components/esp_system/system_api.c:106

0x40088e65: vApplicationStackOverflowHook at /home/vedant/esp/esp-idf/components/freertos/xtensa/port.c:436

0x40089ad2: vTaskSwitchContext at /home/vedant/esp/esp-idf/components/freertos/tasks.c:2770

0x40088f58: _frxt_dispatch at /home/vedant/esp/esp-idf/components/freertos/xtensa/portasm.S:431

0x40088f0e: _frxt_int_exit at /home/vedant/esp/esp-idf/components/freertos/xtensa/portasm.S:231

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

image_qr_code_group_4_2 = lv_qrcode_create(scr4[2], 50, lv_color_hex3(0x000), lv_color_hex3(0xfff));
const char *data = "hello-world";
lv_qrcode_update(image_qr_code_group_4_2, data, strlen(data));

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

What’s your current stack size? Try with at least 4K if you aren’t already.

4096, tried with 8192 too. Still it crashed. It worked with 15000 size