zmkfirmware / zmk

ZMK Firmware Repository
https://zmk.dev/
MIT License
2.51k stars 2.57k forks source link

Display not initialising after recent PR #2361

Closed NightB1ade closed 1 week ago

NightB1ade commented 2 weeks ago

2358 appears to have had an unintended consequence that the OLED displays (on my board at least) are not showing anything any more.

Tested:

Repo here: Repo refreshed after testing ~- will be iterating my keymap later on the repo - so specific commits are:~

petejohanson commented 2 weeks ago

@NightB1ade can you please gather logging of the startup sequence?

My guess is that the OLED init sequence may be occuring before the VCC power is enabled, but I want to be sure. Also: does VCC properly read 3.3v on the new firmware?

NightB1ade commented 2 weeks ago

I think I saw a page on the docs for the logging - is it this one? https://zmk.dev/docs/development/usb-logging If so - I'll work on getting that next I get a chance!

Is there a particular place you want me to measure for the voltage? VCC to GND on the OLED?

Edit: Checked VCC to GND on the OLED - seems to be getting 3.3V all okay

NightB1ade commented 2 weeks ago

2024_07_04_1743 Waterfowl Logs.txt

[00:00:00.827,239] <err> i2c_nrfx_twi: Error on I2C line occurred for message 0
[00:00:00.827,362] <err> ssd1306: Failed to initialize device!
[00:00:00.827,423] <dbg> zmk: kscan_matrix_init_input_inst: Configured pin 0 on                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 gpio@50000300 for input
[00:00:00.827,453] <dbg> zmk: kscan_matrix_init_input_inst: Configured pin 22 on                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 gpio@50000000 for input
[00:00:00.827,514] <dbg> zmk: kscan_matrix_init_input_inst: Configured pin 24 on                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 gpio@50000000 for input
[00:00:00.827,575] <dbg> zmk: kscan_matrix_init_input_inst: Configured pin 11 on                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 gpio@50000000 for input
[00:00:00.827,606] <dbg> zmk: kscan_matrix_init_output_inst: Configured pin 31 o                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                n gpio@50000000 for output
[00:00:00.827,667] <dbg> zmk: kscan_matrix_init_output_inst: Configured pin 29 o                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                n gpio@50000000 for output
[00:00:00.827,697] <dbg> zmk: kscan_matrix_init_output_inst: Configured pin 2 on                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 gpio@50000000 for output
[00:00:00.827,758] <dbg> zmk: kscan_matrix_init_output_inst: Configured pin 15 o                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                n gpio@50000300 for output
[00:00:00.827,789] <dbg> zmk: kscan_matrix_init_output_inst: Configured pin 13 o                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                n gpio@50000300 for output
[00:00:00.827,880] <dbg> zmk: vddh_init: VDDHDIV5 setup returned 0
*** Booting Zephyr OS build 8f87b3be1e76 ***
[00:00:00.834,594] <inf> fs_nvs: 8 Sectors of 4096 bytes
[00:00:00.834,594] <inf> fs_nvs: alloc wra: 0, f60
[00:00:00.834,625] <inf> fs_nvs: data wra: 0, f0
[00:00:00.836,212] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.836,212] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.836,242] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                x00) Version 3.5 Build 0
[00:00:00.836,608] <inf> bt_hci_core: No ID address. App must call settings_load                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ()
[00:00:00.836,730] <dbg> zmk: zmk_sensors_init_item: Init sensor at index 0
[00:00:00.841,857] <dbg> zmk: zmk_sensors_init_item: Init sensor at index 1
[00:00:00.846,954] <dbg> zmk: zmk_sensors_init_item: Init sensor at index 2
[00:00:00.846,954] <dbg> zmk: zmk_sensors_init_item: No local device for 2
[00:00:00.846,984] <dbg> zmk: zmk_sensors_init_item: Init sensor at index 3
[00:00:00.846,984] <dbg> zmk: zmk_sensors_init_item: No local device for 3
[00:00:00.847,015] <dbg> zmk: zmk_usb_get_conn_state: state: 11
[00:00:00.847,015] <dbg> zmk: get_selected_transport: No endpoint transports are                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ready.
[00:00:00.847,045] <err> lvgl: Display device not ready.
[00:00:00.847,290] <inf> zmk: Welcome to ZMK!

[00:00:00.847,534] <dbg> zmk: ble_profiles_handle_set: Setting BLE value periphe                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ral_addresses/0
[00:00:00.847,930] <dbg> zmk: ble_profiles_handle_set: Setting BLE value periphe                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ral_address
[00:00:00.848,205] <inf> usb_hid: Device connected
[00:00:00.848,236] <dbg> zmk: zmk_usb_get_conn_state: state: 2
[00:00:00.848,266] <dbg> zmk: zmk_usb_get_conn_state: state: 2
[00:00:00.848,297] <dbg> zmk: get_selected_transport: No endpoint transports are                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ready.
[00:00:00.848,724] <inf> bt_hci_core: Identity: F4:97:BB:13:95:BA (random)
[00:00:00.848,754] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x0000, m                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                anufacturer 0x05f1
[00:00:00.848,785] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0xffff
[00:00:00.851,318] <inf> usb_hid: Device suspended
[00:00:00.851,348] <dbg> zmk: zmk_usb_get_conn_state: state: 5
[00:00:00.851,379] <dbg> zmk: zmk_usb_get_conn_state: state: 5
[00:00:00.851,379] <dbg> zmk: get_selected_transport: Only USB is ready.
[00:00:00.851,409] <dbg> zmk: zmk_endpoints_send_report: usage page 0x07
[00:00:00.851,440] <dbg> zmk: zmk_endpoints_send_report: usage page 0x0C
[00:00:00.851,501] <inf> zmk: Endpoint changed: USB
[00:00:00.851,898] <dbg> zmk: zmk_ble_ready: ready? 0
[00:00:00.851,928] <dbg> zmk: update_advertising: advertising from 0 to 2
[00:00:00.852,905] <dbg> zmk: start_scanning: Scanning successfully started
[00:00:00.853,027] <dbg> zmk: initialize_display:
[00:00:00.853,057] <err> zmk: Failed to find display device
[00:00:00.853,088] <dbg> zmk: zmk_display_init:
[00:00:00.853,118] <wrn> zmk: Not sending, no active address for current profile
[00:00:00.853,118] <wrn> zmk: Not sending, no active address for current profile
[00:00:00.948,638] <inf> usb_hid: Device resumed
[00:00:00.948,669] <inf> usb_hid: from suspend
[00:00:00.948,730] <inf> usb_hid: Device reset detected
[00:00:00.948,760] <dbg> zmk: zmk_usb_get_conn_state: state: 1
[00:00:00.948,760] <dbg> zmk: zmk_usb_get_conn_state: state: 1
[00:00:00.948,791] <dbg> zmk: get_selected_transport: No endpoint transports are                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ready.
[00:00:00.948,791] <dbg> zmk: zmk_endpoints_send_report: usage page 0x07
[00:00:00.948,822] <err> zmk: FAILED TO SEND OVER USB: -19
[00:00:00.948,822] <dbg> zmk: zmk_endpoints_send_report: usage page 0x0C
[00:00:00.948,852] <err> zmk: FAILED TO SEND OVER USB: -19
[00:00:00.948,883] <inf> zmk: Endpoint changed: BLE:0
[00:00:01.075,653] <inf> usb_hid: Device reset detected
[00:00:01.075,683] <dbg> zmk: zmk_usb_get_conn_state: state: 1
[00:00:01.075,714] <dbg> zmk: zmk_usb_get_conn_state: state: 1
[00:00:01.075,714] <dbg> zmk: get_selected_transport: No endpoint transports are                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ready.
[00:00:01.113,677] <dbg> zmk: vddh_sample_fetch: ADC raw 3005 ~ 4400 mV => 100%
[00:00:01.113,677] <dbg> zmk: zmk_battery_update: Setting BAS GATT battery level                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 to 100.
[00:00:01.321,472] <inf> usb_hid: Device configured
[00:00:01.321,502] <dbg> zmk: zmk_usb_get_conn_state: state: 3
[00:00:01.321,533] <dbg> zmk: zmk_usb_get_conn_state: state: 3
[00:00:01.321,533] <dbg> zmk: get_selected_transport: Only USB is ready.
[00:00:01.321,563] <dbg> zmk: zmk_endpoints_send_report: usage page 0x07
[00:00:01.321,594] <dbg> zmk: zmk_endpoints_send_report: usage page 0x0C
[00:00:01.321,655] <inf> zmk: Endpoint changed: USB
[00:00:01.321,685] <wrn> zmk: Not sending, no active address for current profile
[00:00:01.321,716] <wrn> zmk: Not sending, no active address for current profile
[00:00:01.649,932] <dbg> zmk: split_central_device_found: [DEVICE]: FA:0D:AC:5F:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                C9:8F (public), AD evt type 0, AD data len 29, RSSI -88
[00:00:01.649,932] <dbg> zmk: split_central_eir_parse: [AD]: 1 data_len 1
[00:00:01.649,963] <dbg> zmk: split_central_eir_parse: [AD]: 22 data_len 24
[00:00:01.957,244] <dbg> zmk: split_central_device_found: [DEVICE]: 29:32:67:03:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0E:B2 (random), AD evt type 2, AD data len 0, RSSI -86

Does this cover the right bit? I scanned it and can see some relevant entries, but don't know enough to know if it's all you need!

petejohanson commented 1 week ago

Thanks for the logs. This is almost certainly a side effect of the ext_power_generic.c refactor that delayed the settings loading until after the OLED init, meaning the VCC does eventually turn on, but not until after the OLED attempts to initialize. Considering the "right" fix.

petejohanson commented 1 week ago

@NightB1ade Please give #2362 a try by following the instructions on https://zmk.dev/docs/features/beta-testing and let me know if that fixes things for you. TIA!

NightB1ade commented 1 week ago

It worked! Another new repo, repointed the west.yml (see below to check I got it right), and then activated the display only in config. Thank you!

manifest:
  remotes:
    - name: zmkfirmware
      url-base: https://github.com/zmkfirmware
    - name: petejohanson
      url-base: https://github.com/petejohanson
    # Additional modules containing boards/shields/custom code can be listed here as well
    # See https://docs.zephyrproject.org/3.2.0/develop/west/manifest.html#projects
  projects:
    - name: zmk
      remote: petejohanson
      revision: core/oled-init-delayed-settings-load-fix
      import: app/west.yml
  self:
    path: config