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

Enable debugging messages through the HID interface #111

Open
borisfaure opened this issue Mar 2, 2023 · 4 comments
Open

Enable debugging messages through the HID interface #111

borisfaure opened this issue Mar 2, 2023 · 4 comments

Comments

@borisfaure
Copy link
Contributor

When programming with qmk (https://docs.qmk.fm/#/), it is possible to use printf() to debug code when CONSOLE_ENABLE is set. Those messages can be read through hid_listen (https://www.pjrc.com/teensy/hid_listen.html).
Could the same trick be implemented in keyberon?
Do you have any pointers to do something like this when using no debugging probe?
Thanks

@TeXitoi
Copy link
Owner

TeXitoi commented Mar 2, 2023

Keyberon is a library, so it doesn't enable any fancy thing. Without a probe, you can create a serial usb line, and log what you want in it. Every keyberon object should be Debug, so it should be quite easy.

@TeXitoi
Copy link
Owner

TeXitoi commented Mar 3, 2023

looks like https://github.com/rgoulter/keyboard-labs/blob/master/firmware/keyberon/src/bin/minif4-36-rev2021_1-rhs.rs use a HID and a serial usb endpoint at the same time, might be an interesting base.

@borisfaure
Copy link
Contributor Author

I managed to run an example of a usb serial implementation on the chipset, as a standalone. However, I failed to have it run on the same pins as the HID implementation from Keyberon.
I tried going a different way by having 2 HIDs (one for debugging) but so far, I can only make them conflict.
Do you have any example of keyberon with 2 HIDs (one keyboard and one mouse for example)?

@gzeronet
Copy link

I managed to run an example of a usb serial implementation on the chipset, as a standalone. However, I failed to have it run on the same pins as the HID implementation from Keyberon. I tried going a different way by having 2 HIDs (one for debugging) but so far, I can only make them conflict. Do you have any example of keyberon with 2 HIDs (one keyboard and one mouse for example)?

Seems here is you need: https://github.com/dlkj/usbd-human-interface-device/blob/main/examples/src/bin/multi_device.rs#L83

Actually, I have let 2 HIDs (keyboard matrix and trackpoint module) work together on a stm32f401 board by sending usbd-human-interface-device keyboard & mouse reports to usb_device, and let mouse scroll button works on keyboard (but my code looks ugly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants