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

Turning on USB logging interferes with TX/RX pins on Xiao BLE #1887

Closed
caksoylar opened this issue Jul 31, 2023 · 4 comments · Fixed by #2672
Closed

Turning on USB logging interferes with TX/RX pins on Xiao BLE #1887

caksoylar opened this issue Jul 31, 2023 · 4 comments · Fixed by #2672
Labels
board PRs and issues related to boards. bug Something isn't working

Comments

@caksoylar
Copy link
Contributor

I have this issue where turning on USB logging via CONFIG_ZMK_USB_LOGGING=y prevents the matrix pin I have at RX (D7/P1.12) from working. I am guessing this is because they are assigned to UART pins at https://github.com/zmkfirmware/zephyr/blob/v3.2.0%2Bzmk-fixes/boards/arm/seeeduino_xiao_ble/seeeduino_xiao_ble-pinctrl.dtsi#L7 and logging turns it on via https://github.com/zmkfirmware/zephyr/blob/v3.2.0%2Bzmk-fixes/boards/arm/seeeduino_xiao_ble/seeeduino_xiao_ble.dts#L17.

I see some shield configs deleting these properties, e.g. https://github.com/zmkfirmware/zmk/blob/main/app/boards/shields/hummingbird/hummingbird.overlay#L13. Should this be something that every shield does, or would it be better to solve it at the seeeduino_xiao_ble.overlay level?

@caksoylar
Copy link
Contributor Author

caksoylar commented Jul 31, 2023

Actually I didn't have any luck with enabling USB logging with those nodes deleted. The stock hummingbird shield fails building too:

> west build -p -d build/hummingbird -b seeeduino_xiao_ble -- -DSHIELD=hummingbird -DCONFIG_ZMK_USB_LOGGING=y
[...]
/home/.../zmk/zephyr/include/zephyr/device.h:104:39: error: '__device_dts_ord_DT_CHOSEN_zephyr_console_ORD' undeclared here (not in a function)
[...]

@caksoylar caksoylar added bug Something isn't working board PRs and issues related to boards. labels Jul 31, 2023
@xudongzheng
Copy link
Contributor

I believe the issue is that USB logging enables UART, which causes this UART https://github.com/zmkfirmware/zephyr/blob/v3.2.0%2Bzmk-fixes/boards/arm/seeeduino_xiao_ble/seeeduino_xiao_ble.dts#L64 to be enabled internally within Zephyr.

My initial guess is UART_CONSOLE https://github.com/zmkfirmware/zmk/blob/main/app/Kconfig#L438C12-L438C24 needs to be removed.

@caksoylar
Copy link
Contributor Author

caksoylar commented Jul 31, 2023

Thanks, FWIW, removing select UART_CONSOLE gets the pins working again (but only when combined with deleting the chosen properties) and gets the hummingbird shield building. But I guess it is necessary for logging, since the COM port shows up but nothing gets logged in this case (even if the chosen properties are preserved).

@xudongzheng
Copy link
Contributor

xudongzheng commented Jul 31, 2023

Two small observations:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
board PRs and issues related to boards. bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants