페이지 선택

TPS42 조립을 완료하고 나서 부딪혔던 문제는 트랙포인트 작동이 원활하지 않았다는 점이었습니다. 그래서 최신 QMK 로 펌웨어를 다시 컴파일 하면서 만났던 에러와 해결 방법에 대해서 까먹기 전에 정리 해 둡니다.

들어가기 전에

제목에 “compile”이라는 거창한(?) 단어가 들어갔지만 저는 구글링과 QMK 문서를 보면서 이것저것 넣어보다가 겨우 빌드 시킨것이라서, 왜 작동하지 저는 잘 모릅니다. ㅜ.ㅜ 이점 참고해주세요

빌드 환경

QMK doctor 로 확인한 QMK repo version은 0.21.0입니다.

deprecated in favor of `usb.device_version` in info.json

// ⚠ tps42/rev1: DEVICE_VER in config.h is deprecated in favor of `usb.device_version` in info.json and will be removed at a lat er date
// ⚠ tps42/rev1: MANUFACTURER in config.h is deprecated in favor of `manufacturer` in info.json and will be removed at a later d ate
// ⚠ tps42/rev1: PRODUCT in config.h is deprecated in favor of `keyboard_name` in info.json and will be removed at a later date
// ⚠ tps42/rev1: PRODUCT_ID in config.h is deprecated in favor of `usb.pid` in info.json and will be removed at a later date
// ⚠ tps42/rev1: VENDOR_ID in config.h is deprecated in favor of `usb.vid` in info.json and will be removed at a later date

해결

빌드하는데 문제는 없지만, config.h에서 해당 항목 주석 처리 합니다.

위 항목의 주석 처리 여부와는 상관없이 usb_descriptor.c에서 에러는 발생했습니다.

usb_descriptor.c 오류

Compiling: tmk_core/protocol/lufa/lufa.c                                                            [OK]
Compiling: tmk_core/protocol/usb_descriptor.c                                                      tmk_core/protocol/usb_descriptor.c:455:35: error: 'VENDOR_ID' undeclared here (not in a function)
     .VendorID                   = VENDOR_ID,
                                   ^~~~~~~~~
tmk_core/protocol/usb_descriptor.c:456:35: error: 'PRODUCT_ID' undeclared here (not in a function); did you mean 'PRODUCT'?
     .ProductID                  = PRODUCT_ID,
                                   ^~~~~~~~~~
                                   PRODUCT
tmk_core/protocol/usb_descriptor.c:457:35: error: 'DEVICE_VER' undeclared here (not in a function)
     .ReleaseNumber              = DEVICE_VER,
                                   ^~~~~~~~~~
In file included from tmk_core/protocol/usb_descriptor.c:42:
tmk_core/protocol/usb_descriptor_common.h:21:29: error: 'LMANUFACTURER' undeclared here (not in a function)
 #define USBSTR(s) USBCONCAT(L, s)
                             ^
tmk_core/protocol/usb_descriptor_common.h:20:25: note: in definition of macro 'USBCONCAT'
 #define USBCONCAT(a, b) a##b
                         ^
tmk_core/protocol/usb_descriptor.c:1066:42: note: in expansion of macro 'USBSTR'
         .Size                   = sizeof(USBSTR(MANUFACTURER)),
                                          ^~~~~~
 [ERRORS]
 |
 |
 |
make[1]: *** [builddefs/common_rules.mk:361: .build/obj_tps42_rev1_arc/usb_descriptor.o] 오류 1
Make finished with errors
make: *** [Makefile:392: tps42/rev1:arc] 오류 1

해결

    "manufacturer": "crehmann",
    "usb": {
        "vid": "0xFEED",
        "pid": "0xB077",
        "device_version": "0.0.1"
    },

usb_descriptor.c 관련 에러는 info.json에 manufacture, usb-vid/pid/device_version 정보 추가해서 해결 했습니다.

undefined reference to `pbuf_has_data’

Compiling: tmk_core/protocol/lufa/usb_util.c                                                        [OK]
Linking: .build/tps42_rev1_arc.elf                                                                  [ERRORS]
 |
 | c:/qmk_msys/mingw64/bin/../lib/gcc/avr/12.2.0/../../../../avr/bin/ld.exe: C:\QMK_MSYS\tmp\cc02PJ6m.ltrans0.ltrans.o: in function `.Loc.5103':  | C:\Users\pgh\qmk_firmware/drivers/ps2/ps2_mouse.c:93: undefined reference to `pbuf_has_data'
 | collect2.exe: error: ld returned 1 exit status
 |
make[1]: *** [builddefs/common_rules.mk:268: .build/tps42_rev1_arc.elf] 오류 1
Make finished with errors
make: *** [Makefile:392: tps42/rev1:arc] 오류 1

config.h에 아래 코드 넣어서 해결 했습니다.

#define PS2_MOUSE_USE_REMOTE_MODE

수정 중인 소스코드

기타 키코드 문제 및 사소한 문제들은 qmk 버그 내용을 확인 하시면 손쉽게 수정 가능 하며, 직접 수정하기 어려우신 분들은 소스코드 참고해주시면 될 것 같습니다.

https://github.com/li-fo/tps42

vial 적용 관련

추가로 vial 적용도 진행 했는데, 프로마이크로의 공간 문제로 대부분의 기능이 빠졌습니다.

최대한 줄여서 98byte가 남습니다. 이 때문에 kb2040과 같은 컨트롤러로 변경하고 싶은데, 컨버팅에 에러가 발생해서 막혀있습니다.