pok3r-custom / pok3r_re_firmware

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

Flashing pok3r QMK doesn't work #30

Closed Vesyrak closed 4 years ago

Vesyrak commented 5 years ago

Hello,

I've reset the security bit following the tips from the wiki and issue #23 . However, I notice the following: regular firmware (disassemble/pok3r/v117/firmware_v117_patched.bin) flashes like a dream, but the QMK_pok3r does not.

The following happens when I attempt to flash the chaos keymap.

sudo ../pok3rtool/build/pok3rtool -t pok3r flash QMK_TEST .build/vortex_pok3r_chaos.bin

WARNING: THIS TOOL IS RELATIVELY UNTESTED, AND HAS A VERY REAL RISK OF CORRUPTING YOUR KEYBOARD, MAKING IT UNUSABLE WITHOUT EXPENSIVE DEVELOPMENT TOOLS. PROCEED AT YOUR OWN RISK.
Type "OK" to continue:
OK
Proceeding...
Opened Vortex POK3R
Update Firmware: .build/vortex_pok3r_chaos.bin
Reset to Bootloader
Current Version: TEST
Clear Version
Erase...
Write...
Check...
Clear Version
Writing Version: QMK_TEST
Reset to Firmware
true

No errors are detected whatsoever, but the keyboard stops responding after and I need to re-plug it in to be redetected and working.

Dmesg gives a generic error can't set config #1, error -110 And when I list the connected devices using pok3rtool it gives me the following: Vortex POK3R (bootloader): CLEARED Showing that it's put in bootloader mode(?) and the version doesn't get written.

What could be the issue, and how could it be resolved?

Thanks in advance!

ChaoticEnigma commented 5 years ago

That is interesting. In the directory you ran pok3rtool from there should be a logs directory with some very verbose log files. Could you attach the corresponding log file here?

Vesyrak commented 5 years ago

Thanks for the quick response! I attached the log of uploading QMK firmware as a file.

pok3rtool_2019-06-08_13.01.01.log

Forgot to note, that if I try to change the version after attempting to load a QMK firmware, I get the following:

WARNING: THIS TOOL IS RELATIVELY UNTESTED, AND HAS A VERY REAL RISK OF CORRUPTING YOUR KEYBOARD, MAKING IT UNUSABLE WITHOUT EXPENSIVE DEVELOPMENT TOOLS. PROCEED AT YOUR OWN RISK.
Type "OK" to continue:
OK
Proceeding...
Opened Vortex POK3R (bootloader)
Old Version: CLEARED
Clear Version
Writing Version: x
1
Reset to Firmware
open error
false

Not sure if this is expected behavior. I guess it could be possible something went wrong when clearing the bit with the J-Link, but wouldn't that cause a failure instead of writing without errors?

ChaoticEnigma commented 5 years ago

Ok, so I think this expected behavior. Can you check if any of the DIP switches on the bottom of your keyboard are on? If switch 4 is on, the firmware will erase itself, as a safety feature.

Vesyrak commented 5 years ago

Ah yes, it was turned on.

I turned it off and did the same (write poker_re_firmware to ensure a clean slate, then write qmk firmware) and had the same results ( no errors, write "succeeded", unable to type until reconnecting and the version becomin "CLEARED").

Log file just in case. pok3rtool_2019-06-09_17.40.05.log

ChaoticEnigma commented 5 years ago

The log says that the tool correctly sets the version, so the only way to clear it is for that page to be erased. The only part of the firmware that does that is triggered if DIP 4 is on. I'm using the same firmware right now, and I can't think of a reason it would be different on yours. Can you give the exact git revision you are building from?

Vesyrak commented 5 years ago

All of them are on the latest commit of the master branch, and have always been since I attempted it about a good month ago and the latest commit is at January.

Could it be something that went wrong when disabling the security bit?

Vesyrak commented 5 years ago

Also note, that if I upload the firmware with DIP4 off, I need to turn DIP4 on again before it gets detected by my computer.

Vesyrak commented 4 years ago

Closing this issue, tried uploading again with latest versions and works perfectly now.