pok3r-custom / pok3r_re_firmware

Reverse engineering project for the POK3R and related keyboards.
219 stars 17 forks source link

How-to questions and current status of the project #36

Open felixfoertsch opened 3 years ago

felixfoertsch commented 3 years ago

Hello @ChaoticEnigma!

Why I am here

I just encountered an annoying little bug with my Pok3r: I want to use FN on the physical location of L_CTRL. However, moving it there with the DIP switch leads to confusing behavior: Holding FN+L_WIN enters demo mode; the backlights start flashing and it changes the other bindings somehow. It becomes unusable for me.

Turns out FN+L_CTRL+L_WIN is the culprit. It's the combination to enter demo mode. My hypothesis: After moving FN to L_CTRL, the one button somehow counts as two (both FN AND L_CTRL), triggering the demo mode while in fact only pressing FN+L_WIN. Very annoying.

After filing a bug report with Vortex (where I don't expect to get an answer tbh), It dawned on me that there might be a custom firmware out there somewhere that could fix this.

What I found on my own

Hence, I found your repository. I read through all the issue lists and wiki entries and tried to understand what to do and if it is possible to change the firmware. From what I could gather:

  1. It is possible to flash the regular Pok3r. Check. That's the one I have. It breaks the backlight, but I am not using it anyway.
  2. The tool to flash the firmware is pok3rtool.
  3. However: It is necessary to first unlock the keyboard before it can be flashed. To do that a hardware debugger is required. And this also involves soldering an interface to the board that the debugger connects to.

My questions

  1. Can a custom firmware fix the bug I've found?
  2. Are my above findings correct?
  3. Is there a more comprehensive guide on how to go about the whole process?
  4. And last but not least: Is this project still active? Is there a solution on the horizon that does not involve unlocking?

I'd be willing to document the whole process and/or write a guide, if you think that's a worthy contribution to your project.

Thanks in advance Felix

ChaoticEnigma commented 3 years ago

Hi Felix,

  1. Yes, you are looking for qmk_pok3r, which is a version of QMK I ported to the Pok3r a while ago.
  2. Yes, that's pretty much right.
  3. Not really. I'm sure you've seen the wiki for this repo. I think all the most important information is written somewhere, but not explicit steps. This is mostly because I've never considered this project ready for general use. I know a couple people have independently made use of it, and that's great. That's why I made all this public.
  4. Sort of. I've had scarce time to work on it for a while, and the important things to work on have been mired in roadblocks. The unlocking requirement is a big one, but also a massive PITA. I've worked on two different ways to fix this problem: a. Figure out why the RTOS doesn't work when the MCU is locked (huge pain because you can't connect a debugger when the MCU is locked). b. Rewrite the firmware without the RTOS (just a ton of work).

I plan to make progress on this project again, potentially fixing the issues with locked MCUs. But, I don't know if I'd call it "on the horizon".

I'm happy to answer questions, I just can't promise how much time I can spend on this.

manuel-arguelles commented 2 years ago

Hi,

Sorry to jump into this thread, but I just got an old Pok3r and would be pretty could to get QMK on it. After reading the wiki, I think I have all the steps required, however I'm not 100% sure yet, could you please let me know:

  1. Get a JTAG adapter (no idea which one should I get, any recommendations?, The cheaper the better)
  2. Get wires into the SWD header (CN2), it seems that probably no soldering is required for this, since the pcb has some holes for this, probably with some header pins it would work, right?. Also the JTAG to SWD is not clear, are pin 1, 4 and 5 required to be connected to the JTAG? (almost sure about vdd and gnd, but nRST?) Also, what about SEL1 and SEL2?
  3. Once the JTAG is connected to the pc and into SWD, use openocd-ht32 to mass erase and flash disassemble/pok3r/builtin/firmware_builtin.bin
  4. Use pok3rtool to upload the QMK firmware