IRC #olimex 2019-08-16

[02:27:28] <xcko> anyone experiment with flashing qmk to the teres keyboard? http://qmk.fm
[09:34:53] <diego71> xcko: is it qmk compatible with the atmel 32u4?
[10:07:27] <leon-anavi> morning
[10:10:00] <diego71> xcko: ok, probably yes (if you can fit in 16Kb flash), the next question is, does it support the touchpad?
[10:51:03] <xcko> yes, qmk does support the atmel 32u4. I've been trying to learn qmk and see if I can get it working, I think it's doable, and I think the touchpad can work too. I can push my work to a repo tomorrow if you wanna look
[10:52:11] <diego71> ok, thanks
[11:28:14] <xcko> the tricky part is this #define MAGIC_BOOT_KEY 0xDC42 defined in the teres-hid/keyboardmouse.c, not sure where to put that in qmk or to just replace the bootloader with the qmk one. Have you been able to boot into dfu access mode and use eg dfu-utils or dfu-programmer?
[11:44:53] <diego71> xcko: usually I use an arduino and a homemade pogoplug connector to flash directly the board
[11:45:35] <diego71> at least check it works once, so I know that I can flash it again in case I mess with the bootloader
[11:46:04] <diego71> /check/I checked/
[12:01:11] <diego71> xcko: I suggest to have a similar plan B, just in case of broken bootlader. Or be ready to manually reset the avr, in case the bootloader is working but not the firmware
[12:02:29] <diego71> if i remember well, in the teres firmware the key combination, just reset the cpu, so that the bootloader is ready to flash the firmware for a couple of second
[12:56:07] <jo0nas> diego71: do I read you correctly that the teres firmware pauses for a few seconds when booting? Could that be the issue causing failure to enable teres keyboard for u-boot?
[12:56:55] <jo0nas> would it perhaps be sensible to lower that delay - or do anyone know how to add a delay to mainline u-boot?
[13:06:41] <diego71> jo0nas: https://github.com/d3v1c3nv11/TERES-KBD-RELEASE/commit/afdd005eb6f5cf5207d4b35330cbdb69d33f30bd#diff-15dff23f6e443ec9aa1c791f6678e875
[13:07:13] <diego71> that should be the definition. I don't know how much can be decreased...
[13:09:27] <diego71> the point is that the avr, when powered up start in "bootloader mode" for two second, and if nothing happened, go in the "keyboard mode"
[13:14:30] <jo0nas> thanks - at least I now know where to tinker (if I ever dare mess this deep)
[13:19:53] <diego71> jo0nas: may be is possible to add a usb reset in u-boot script, when hopefuly the firmware is already in the keyboard mode
[13:22:56] <jo0nas> I tried that but (assuming I did it correctly) that failed - I also tried manually doing a usb reset which fails as well
[13:23:25] <jo0nas> u-boot fails to detect teres keyboard but works fine with other USB-based keyboard plugged in
[13:24:34] <diego71> the external keyboard works even if you attach after the power up?
[13:29:49] <jo0nas> I have not found a way to test that: Would require setting up u-boot to not auto-boot into linux which I just haven't gotten around to trying
[13:30:15] <jo0nas> (scratch the initial "have not found a way" part)
[13:30:50] <jo0nas> to answer your question: No, haven't tried that!
[13:36:20] <diego71> jo0nas: probably you can set a very long time in the u-boot timout for the auto-boot
[14:01:22] <jo0nas> sure - or I can simply make the boot fail which also works for staying in u-boot - just haven't tried that
[22:29:37] <xcko> I've experimented with stopping autoboot, plugging in an external keyboard, and seeing if u-boot picks it up. If usb reset is run after plugging in the keyboard at the uboot prompt, then the external keyboard is correctly picked up
[22:31:47] <jo0nas> xcko: ...but not the teres keyboard, right?
[22:33:21] <xcko> but not the teres keyboard, correct.
[22:37:55] <xcko> that's what lead me to believe either the "keyboard mode" fails to report itself as usb-hid correctly or u-boot has a bug in their usb drivers. And I'm leaning towards the former, which is why I'm experimenting with flashing the keyboard with qmk
[22:44:35] <xcko> https://github.com/xcko/qmk_firmware the latest commit I pushed to here has my current attempt. See https://docs.qmk.fm for details on building. So far I ran `make olimex_teres:default` and then used the hid_bootloader_cli from the teres repo to flash the .hex file, resulting in the avr booting to "bootloader mode" then timing out and doing it again.
[22:44:37] <jo0nas> moving to a vibrant independent upstream for the keyboard code sounds like a good move!