What MCU/Processor/Board and compiler are you using?
esp32, esp-wrover-kit
freeRTOS, arduino framework
What LVGL version are you using?
8.3.4
What have you tried so far?
I created a calendar using Squareline Studio and displayed it on an LCD screen by copying and pasting the code. When I touch a date on the calendar, a panic occurs in the event handler, and it seems that an error occurs when trying to retrieve the value of txt[0] after executing the code inside the lv_calendar_get_pressed_date(obj, id) function:
maybe the txt is not terminated with a \0 like it should be. have you tried removing the first my_printf and see if it’s actually the second one that causes the core panic??
I don’t think there is a \0 on the end. the reason why I say this is because you are dealing with something that should have at most 2 characters in it yet the printed value is |�␐@�e�?␄ which is more than 2 characters. The core panic would occur because printf is not able to locate the end.
If you remove the first my_printf it will probably work correctly.
A panic error occurred, so I inserted my_printf() to find the cause. It is not because of my_printf(). The panic error still occurs even after removing my_printf(). The error happens when accessing txt[0].
There was one strange thing.
I created a calendar in squareline studio and pasted the code (ui.c) as it is, but lv_calendar_set_shown_date() did not build because an undefined reference error occurred. It was not implemented in lv_calendar.c, so I just commented it out and executed it.
could this be a problem?
c:/users/jjs/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp-wrover-kit\src\ui.c.o:(.literal.ui_ScreenSetDate_screen_init+0x18): undefined reference to `lv_calendar_set_shown_date'
c:/users/jjs/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp-wrover-kit\src\ui.c.o: in function `ui_ScreenSetDate_screen_init':
D:\Project\HVP\FreeRTOS_test_230116/src/ui.c:619: undefined reference to `lv_calendar_set_shown_date'
I didn’t use the calendar functions, so I have no experiece.
I would carefully say yes, could be a problem when you outcommet something.
Although there is missing the second parameter, it shouldn’t result in an exception.
There is something wrong before.
I am in agreement with @robekras as far as the core panic. I will have to look at the current version of LVGL and see if there are any checks in place to see if the date has been set before trying to collect it from the widget. If there isn’t there should be so this doesn’t happen.