Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LVGL All The Things! #539

Merged
merged 39 commits into from
Dec 11, 2024
Merged

LVGL All The Things! #539

merged 39 commits into from
Dec 11, 2024

Conversation

mutatrum
Copy link
Contributor

@mutatrum mutatrum commented Dec 1, 2024

Combined PR for the LVGL implementation. For the bare bones implementation of LVGL alone, please have a look at #434 first. This PR pushes it a lot further, by leveraging LVGL functionalities and cleanup up a lot of code. Some noticeable:

  • Long text scrolling labels;
  • Screen transition animations;
  • Button click and hold handling;
  • System task and user input task are gone;

Implementation wise the biggest change is that a lot of data is passed through GLOBAL_STATE, which cleans up a lot of display logic form other places.

Things to do/check:

  • IP address changes;
  • Pool changes, both fallback as well as configuration changes;
  • Block found screen;
  • Invalid ASIC model. When does this happen and what should be displayed?
  • Checking of overheat mode reset is moved to power management task;
  • Show connection screen again if AP mode is enabled;

image

@mutatrum mutatrum mentioned this pull request Dec 1, 2024
@eandersson
Copy link
Collaborator

Upgraded my Supra without a screen and it unfortunately didn't come back online. I'll plug in the USB later to get the logs.

@eandersson
Copy link
Collaborator

I (1364) display: Install panel IO
I (1364) display: Install SSD1306 panel driver
E (1364) i2c.master: I2C transaction unexpected nack detected
E (1374) i2c.master: s_i2c_synchronous_transaction(872): I2C transaction failed
E (1374) i2c.master: i2c_master_transmit(1074): I2C transaction failed
E (1384) lcd_panel.io.i2c: panel_io_i2c_tx_buffer(179): i2c transaction failed
E (1394) lcd_panel.ssd1306: panel_ssd1306_init(147): io tx param SSD1306_CMD_SET_MULTIPLEX failed
E (1404) display: display_init(77): Panel init failed
W (1404) SystemModule: OLED init failed!
I (1414) gpio: GPIO[0]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x420317b8  PS      : 0x00060d30  A0      : 0x82031836  A1      : 0x3fcb84e0  
0x420317b8: tcp_process at /opt/esp/idf/components/lwip/lwip/src/core/tcp_in.c:886 (discriminator 4)

A2      : 0x00000000  A3      : 0x3fcb8500  A4      : 0x3fcb8504  A5      : 0x00060f23  
A6      : 0x0000005e  A7      : 0x00000000  A8      : 0x00000010  A9      : 0x3fcb84c0  
A10     : 0x00000003  A11     : 0x3fcb8500  A12     : 0x3fcb8504  A13     : 0x00060f23  
A14     : 0x3c0e6168  A15     : 0x0000cdcd  SAR     : 0x00000020  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000014  LBEG    : 0x400570e8  LEND    : 0x400570f3  LCOUNT  : 0x00000000  
0x400570e8: memset in ROM
0x400570f3: memset in ROM

@mutatrum
Copy link
Contributor Author

mutatrum commented Dec 1, 2024

Found the issue. I2C error on panel init stops it from initialising LVGL, which is needed later on.

main/lv_conf.h Outdated Show resolved Hide resolved
main/screen.c Outdated Show resolved Hide resolved
@mutatrum
Copy link
Contributor Author

mutatrum commented Dec 2, 2024

Upgraded my Supra without a screen and it unfortunately didn't come back online. I'll plug in the USB later to get the logs.

I got the button working without the screen. It does complain a lot on boot:

I (1293) display: Install panel IO
I (1293) display: Install SSD1306 panel driver
E (1293) i2c.master: I2C hardware NACK detected
E (1293) i2c.master: I2C transaction unexpected nack detected
E (1303) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (1303) i2c.master: i2c_master_multi_buffer_transmit(1166): I2C transaction failed
E (1313) lcd_panel.io.i2c: panel_io_i2c_tx_buffer(193): i2c transaction failed
E (1323) lcd_panel.ssd1306: panel_ssd1306_init(151): io tx param SSD1306_CMD_SET_MULTIPLEX failed
E (1333) display: Panel init failed, no display connected?
I (1333) display: Initialize LVGL
I (1343) LVGL: Starting LVGL task
E (1343) i2c.master: I2C hardware NACK detected
E (1343) i2c.master: I2C transaction unexpected nack detected
E (1353) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (1353) i2c.master: i2c_master_multi_buffer_transmit(1166): I2C transaction failed
E (1363) lcd_panel.io.i2c: panel_io_i2c_tx_buffer(193): i2c transaction failed
E (1373) lcd_panel.ssd1306: panel_ssd1306_mirror(237): io tx param SSD1306_CMD_MIRROR_X_ON/OFF failed
E (1383) i2c.master: I2C hardware NACK detected
E (1383) i2c.master: I2C transaction unexpected nack detected
E (1393) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (1393) i2c.master: i2c_master_multi_buffer_transmit(1166): I2C transaction failed
E (1403) lcd_panel.io.i2c: panel_io_i2c_tx_buffer(193): i2c transaction failed
E (1413) lcd_panel.ssd1306: panel_ssd1306_draw_bitmap(196): io tx param SSD1306_CMD_SET_COLUMN_RANGE failed
W (1423) display: No display found.
W (1423) SystemModule: OLED init failed!
I (1433) input: Install button driver
I (1433) gpio: GPIO[0]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 

This also means self test succeeds even without a display. It does throw the same errors.

@eandersson
Copy link
Collaborator

Upgraded my Supra without a screen and it unfortunately didn't come back online. I'll plug in the USB later to get the logs.

I got the button working without the screen. It does complain a lot on boot:

I (1293) display: Install panel IO
I (1293) display: Install SSD1306 panel driver
E (1293) i2c.master: I2C hardware NACK detected
E (1293) i2c.master: I2C transaction unexpected nack detected
E (1303) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (1303) i2c.master: i2c_master_multi_buffer_transmit(1166): I2C transaction failed
E (1313) lcd_panel.io.i2c: panel_io_i2c_tx_buffer(193): i2c transaction failed
E (1323) lcd_panel.ssd1306: panel_ssd1306_init(151): io tx param SSD1306_CMD_SET_MULTIPLEX failed
E (1333) display: Panel init failed, no display connected?
I (1333) display: Initialize LVGL
I (1343) LVGL: Starting LVGL task
E (1343) i2c.master: I2C hardware NACK detected
E (1343) i2c.master: I2C transaction unexpected nack detected
E (1353) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (1353) i2c.master: i2c_master_multi_buffer_transmit(1166): I2C transaction failed
E (1363) lcd_panel.io.i2c: panel_io_i2c_tx_buffer(193): i2c transaction failed
E (1373) lcd_panel.ssd1306: panel_ssd1306_mirror(237): io tx param SSD1306_CMD_MIRROR_X_ON/OFF failed
E (1383) i2c.master: I2C hardware NACK detected
E (1383) i2c.master: I2C transaction unexpected nack detected
E (1393) i2c.master: s_i2c_synchronous_transaction(917): I2C transaction failed
E (1393) i2c.master: i2c_master_multi_buffer_transmit(1166): I2C transaction failed
E (1403) lcd_panel.io.i2c: panel_io_i2c_tx_buffer(193): i2c transaction failed
E (1413) lcd_panel.ssd1306: panel_ssd1306_draw_bitmap(196): io tx param SSD1306_CMD_SET_COLUMN_RANGE failed
W (1423) display: No display found.
W (1423) SystemModule: OLED init failed!
I (1433) input: Install button driver
I (1433) gpio: GPIO[0]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 

This also means self test succeeds even without a display. It does throw the same errors.

Complaining is fine, as long as it does not spam (or even worse impact performance) after boot is done.

@mutatrum
Copy link
Contributor Author

mutatrum commented Dec 2, 2024

Complaining is fine, as long as it does not spam (or even worse impact performance) after boot is done.

No, it only complains at boot. All screen handling and updating is done in an lv_timer, which is not started if the display is not attached.

ESP-Miner/main/screen.c

Lines 306 to 317 in 78ec3c8

if (GLOBAL_STATE->SYSTEM_MODULE.is_screen_active) {
SystemModule * module = &GLOBAL_STATE->SYSTEM_MODULE;
screens[SCR_SELF_TEST] = create_scr_self_test();
screens[SCR_OVERHEAT] = create_scr_overheat(module);
screens[SCR_CONFIGURE] = create_scr_configure(module);
screens[SCR_CONNECTION] = create_scr_connection(module);
screens[SCR_LOGO] = create_scr_logo();
screens[SCR_URLS] = create_scr_urls(module);
screens[SCR_STATS] = create_scr_stats();
lv_timer_create(screen_update_cb, SCREEN_UPDATE_MS, NULL);

@WantClue WantClue added enhancement New feature or request design Design Enhancements labels Dec 2, 2024
@WantClue WantClue merged commit 848c780 into skot:master Dec 11, 2024
1 check passed
@mutatrum mutatrum deleted the lvgl-all-the-things branch December 11, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Design Enhancements enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants