QMK Firmware 0.1.3
Making vortex/core with keymap default
make[1]: Entering directory '/home/hoge/src/qmk_pok3r'
arm-none-eabi-gcc.exe (GNU Tools for Arm Embedded Processors 8-2019-q3-update) 8.3.1 20190703
(release) [gcc-8-branch revision 273027]
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Size before:
text data bss dec hex filename
27028 3120 13620 43768 aaf8 ./.build/vortex_core_default.elf
Compiling: keyboards/vortex/vortex.c [OK]
Compiling: keyboards/vortex/keymaps/default/keymap.c [OK]
Compiling: ./tmk_core/common/command.c [OK]
Linking: .build/vortex_core_default.elf [OK]
Creating binary load file for flashing: .build/vortex_core_default.bin [OK]
Creating load file for flashing: .build/vortex_core_default.hex [OK]
Size after:
text data bss dec hex filename
27046 3120 13620 43786 ab0a ./.build/vortex_core_default.elf
Copying vortex_core_default.bin to qmk_firmware folder [OK]
31204 vortex_core_default.bin
make[1]: Leaving directory '/home/hoge/src/qmk_pok3r'
Open On-Chip Debugger 0.10.0-rc1-dev-00005-ge3fa2ecb (2022-04-24-20:56)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
0x4000
0x10000
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 12 kHz
trst_only separate trst_push_pull
Info : Unable to match requested speed 12 kHz, using 5 kHz
Info : Unable to match requested speed 12 kHz, using 5 kHz
Info : clock speed 5 kHz
Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.247431
Info : ht32f165x.cpu: hardware has 6 breakpoints, 4 watchpoints
> ht32f165x mass_erase 0
ht32f165x probe: 64 pages, 0x400 bytes, 0x10000 total
Target not halted
ht32f165x mass erase failed
"Target not halted" と言われて消去できなかったので、halt コマンド後に ht32f165x mass_erase 0 を実行する。そのあと新しい初期ファームの書き込み。
$ telnet 127.0.0.1 4444
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Open On-Chip Debugger
> halt
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x01000003 pc: 0x00000124 msp: 0x20000710
> ht32f165x mass_erase 0
ht32f165x probe: 64 pages, 0x400 bytes, 0x10000 total
ht32f165x mass erase complete
$ openocd -c 'set HT32_SRAM_SIZE 0x4000' -c 'set HT32_FLASH_SIZE 0x10000' -f /mingw64/share/openocd/scripts/interface/stlink-v2.cfg -f /mingw64/share/openocd/scripts/target/ht32f165x.cfg
Open On-Chip Debugger 0.10.0-rc1-dev-00005-ge3fa2ecb (2022-04-24-20:56)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
0x4000
0x10000
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 12 kHz
trst_only separate trst_push_pull
Info : Unable to match requested speed 12 kHz, using 5 kHz
Info : Unable to match requested speed 12 kHz, using 5 kHz
Info : clock speed 5 kHz
Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.247431
Info : ht32f165x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'telnet' connection on tcp/4444
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x01000003 pc: 0x00000124 msp: 0x20000710
Info : ht32f165x probe: 64 pages, 0x400 bytes, 0x10000 total
ht32f165x mass erase complete
Info : ht32f165x probe: 64 pages, 0x400 bytes, 0x10000 total
wrote 8856 bytes from file
./src/pok3r_re_firmware/disassemble/core/builtin_core/firmware_builtin_core.bin in 456.586639s (0.019 KiB/s)
Info : dropped 'telnet' connection
$ cd ~/src/pok3rtool-build
$ ./pok3rtool -t vortex-core flash QMK_CORE ~/src/qmk_pok3r/vortex_core_default.bin
下記のように表示されますが、OK をタイプして続行、OK は大文字にしなければダメでした。
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 Core (bootloader)
Update Firmware: C:\msys64\home\hoge\src\qmk_pok3r\vortex_core_default.bin
Current Version: CLEARED
Firmware CRC D: 7b359562
Firmware CRC E: 45c12403
crc 0
sum 0
Current CRC: 00000000
Erase...
Write...
crc 45c12403
sum 45e6cc48
New CRC: 45c12403
Writing Version: QMK_CORE
Reset to Firmware
true
$ ./pok3rtool -t vortex-core flash QMK_CORE ~/src/qmk_pok3r/vortex_core_default.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 Core [QMK]
Update Firmware: C:\msys64\home\hoge\src\qmk_pok3r\vortex_core_default.bin
Reset to Bootloader
false
リセット&再書き込み
bootloader コマンドの実行。
$ ./pok3rtool -t vortex-core bootloader
Opened Vortex Core [QMK]
Reset to Bootloader
true
再書き込み。
$ ./pok3rtool -t vortex-core flash QMK_CORE ~/src/qmk_pok3r/vortex_core_default.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 Core [QMK]
Update Firmware: C:\msys64\home\moto-\src\qmk_pok3r\vortex_core_default.bin
Reset to Bootloader
false
また失敗なので、bootloader コマンドの実行からやり直し。
$ ./pok3rtool -t vortex-core bootloader
Opened Vortex Core [QMK]
Reset to Bootloader
true
$ ./pok3rtool -t vortex-core flash QMK_CORE ~/src/qmk_pok3r/vortex_core_default.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 Core (bootloader)
Update Firmware: C:\msys64\home\moto-\src\qmk_pok3r\vortex_core_default.bin
Current Version: QMK_CORE
Firmware CRC D: 0199cb8f
Firmware CRC E: 3f6d7aee
crc fe209faa
sum e8559d3b
Current CRC: fe209faa
Erase...
Write...
crc a01092b8
sum 7bc2ac6f
New CRC: a01092b8
CRCs do not match, firmware write failed
false
また失敗。めげずにやり続ける。
$ ./pok3rtool -t vortex-core bootloader
Opened Vortex Core (bootloader)
true
$ ./pok3rtool -t vortex-core flash QMK_CORE ~/src/qmk_pok3r/vortex_core_default.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 Core (bootloader)
Update Firmware: C:\msys64\home\moto-\src\qmk_pok3r\vortex_core_default.bin
Current Version: CLEARED
Firmware CRC D: 0199cb8f
Firmware CRC E: 3f6d7aee
crc a01092b8
sum 7bc2ac6f
Current CRC: a01092b8
Erase...
Write...
crc 3f6d7aee
sum 5088c541
New CRC: 3f6d7aee
Writing Version: QMK_CORE
Reset to Firmware
true