qmk / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
18.04k stars 38.76k forks source link

"undeclared here" errors while trying to compile firmware for handwired keyboard #22452

Closed Kim-Jong-U closed 6 months ago

Kim-Jong-U commented 10 months ago

Describe the Bug

I'm new to qmk and C, and I'm trying to make custom firmware for a 12 x 4 key handwired keyboard (with an Arduino Micro with an atmega32u4). But it's giving me these errors while compiling it:

./.build/obj_smolestkeyboard_default/src/info_config.h:65:31: error: 'A0' undeclared here (not in a function); 65 # define MATRIX_ROW_PINS { A0, A1, A2, A3 } ^~ quantum/matrix.c:58:58: note: in expansion of macro 'MATRIX_ROW_PINS' 58 static SPLIT_MUTABLE_ROW pin_t row_pins[ROWS_PER_HAND] = MATRIX_ROW_PINS; ^~~~~~~ ./.build/obj_smolestkeyboard_default/src/info_config.h:65:35: error: 'A1' undeclared here (not in a function); 65 # define MATRIX_ROW_PINS { A0, A1, A2, A3 } ^~ quantum/matrix.c:58:58: note: in expansion of macro 'MATRIX_ROW_PINS' 58 static SPLIT_MUTABLE_ROW pin_t row_pins[ROWS_PER_HAND] = MATRIX_ROW_PINS; ^~~~~~~ ./.build/obj_smolestkeyboard_default/src/info_config.h:65:39: error: 'A2' undeclared here (not in a function); 65 # define MATRIX_ROW_PINS { A0, A1, A2, A3 } ^~ quantum/matrix.c:58:58: note: in expansion of macro 'MATRIX_ROW_PINS' 58 static SPLIT_MUTABLE_ROW pin_t row_pins[ROWS_PER_HAND] = MATRIX_ROW_PINS; ^~~~~~~ ./.build/obj_smolestkeyboard_default/src/info_config.h:65:43: error: 'A3' undeclared here (not in a function); 65 # define MATRIX_ROW_PINS { A0, A1, A2, A3 } ^~ quantum/matrix.c:58:58: note: in expansion of macro 'MATRIX_ROW_PINS' 58 static SPLIT_MUTABLE_ROW pin_t row_pins[ROWS_PER_HAND] = MATRIX_ROW_PINS; ^~~~~~~ ./.build/obj_smolestkeyboard_default/src/info_config.h:61:63: error: 'D8' undeclared here (not in a function); 61 # define MATRIX_COL_PINS { D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12 } ^~ quantum/matrix.c:61:58: note: in expansion of macro 'MATRIX_COL_PINS' 61 static SPLIT_MUTABLE_COL pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; ^~~~~~~ ./.build/obj_smolestkeyboard_default/src/info_config.h:61:67: error: 'D9' undeclared here (not in a function); 61 # define MATRIX_COL_PINS { D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12 } ^~ quantum/matrix.c:61:58: note: in expansion of macro 'MATRIX_COL_PINS' 61 static SPLIT_MUTABLE_COL pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; ^~~~~~~ ./.build/obj_smolestkeyboard_default/src/info_config.h:61:71: error: 'D10' undeclared here (not in a function); 61 # define MATRIX_COL_PINS { D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12 } ^~~ quantum/matrix.c:61:58: note: in expansion of macro 'MATRIX_COL_PINS' 61 static SPLIT_MUTABLE_COL pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; ^~~~~~~ ./.build/obj_smolestkeyboard_default/src/info_config.h:61:76: error: 'D11' undeclared here (not in a function); 61 # define MATRIX_COL_PINS { D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12 } ^~~ quantum/matrix.c:61:58: note: in expansion of macro 'MATRIX_COL_PINS' 61 static SPLIT_MUTABLE_COL pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; ^~~~~~~ ./.build/obj_smolestkeyboard_default/src/info_config.h:61:81: error: 'D12' undeclared here (not in a function); 61 # define MATRIX_COL_PINS { D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12 } ^~~ quantum/matrix.c:61:58: note: in expansion of macro 'MATRIX_COL_PINS' 61 static SPLIT_MUTABLE_COL pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; ^~~~~~~ [ERRORS]

make[1]: [builddefs/common_rules.mk:361: .build/obj_smolestkeyboard_default/quantum/matrix.o] Error 1 Make finished with errors make: [Makefile:392: smolestkeyboard:default] Error 1

It's not giving any errors for the first 8 digital pins, but only for the following ones, as well as the analog pins. There are no typos anywhere. I assume either I have to define the pins somewhere (I couldn't find that anywhere), or qmk thinks I'm running another microcontroller that doesn't have these pins, or I am completely misunderstanding how the layout system in qmk works. It might also be that I'm using a version of avr-gcc newer than 8 (as you can see in the "qmk doctor Output" I provided), but I really dislike "solving" problems by downgrading things without completely making sure there is no other way to fix it. And I really doubt that's the issue anyways because it doesn't make sense to me how a newer version would just forget that my microcontroler has more than 8 digital pins.

Keyboard Used

smolestkeyboard

Link to product page (if applicable)

No response

Operating System

arch linux x86_64

qmk doctor Output

Ψ QMK Doctor is checking your environment.
Ψ CLI version: 1.1.2
Ψ QMK home: /home/User/qmk_firmware
Ψ Detected Linux (Arch Linux).
Ψ Git branch: master
Ψ Repo version: 0.22.14
Ψ - Latest master: 2023-11-11 20:50:33 +1100 (211fbbd16d) -- Add `qmk license-check` developer-level CLI command. (#22075)
Ψ - Latest upstream/master: 2023-11-12 03:08:26 +0800 (935c894f83) -- add 5087 keyboard (#20557)
Ψ - Latest upstream/develop: None
Ψ - Common ancestor with upstream/master: 2023-11-11 20:50:33 +1100 (211fbbd16d) -- Add `qmk license-check` developer-level CLI command. (#22075)
Ψ - Common ancestor with upstream/develop: None
Ψ All dependencies are installed.
Ψ Found arm-none-eabi-gcc version 13.2.0
Ψ Found avr-gcc version 13.2.0
⚠ We do not recommend avr-gcc newer than 8. Downgrading to 8.x is recommended.
Ψ Found avrdude version 7.2
Ψ Found dfu-programmer version 1.0.0
Ψ Found dfu-util version 0.11
Ψ Submodules are up to date.
Ψ Submodule status:
Ψ - lib/chibios: 2023-04-15 13:48:04 +0000 --  (11edb1610)
Ψ - lib/chibios-contrib: 2023-07-17 11:39:05 +0200 --  (da78eb37)
Ψ - lib/googletest: 2021-06-11 06:37:43 -0700 --  (e2239ee6)
Ψ - lib/lufa: 2022-08-26 12:09:55 +1000 --  (549b97320)
Ψ - lib/vusb: 2022-06-13 09:18:17 +1000 --  (819dbc1)
Ψ - lib/printf: 2022-06-29 23:59:58 +0300 --  (c2e3b4e)
Ψ - lib/pico-sdk: 2023-02-12 20:19:37 +0100 --  (a3398d8)
Ψ - lib/lvgl: 2022-04-11 04:44:53 -0600 --  (e19410f8)
Ψ QMK is ready to go, but minor problems were found

Is AutoHotKey / Karabiner installed

Other keyboard-related software installed

No response

Additional Context

I use arch btw :)

fauxpark commented 10 months ago

32U4 does not have a port A. You are probably using the Arduino pin names, which will not work.

github-actions[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in the next 30 days unless it is tagged properly or other activity occurs. For maintainers: Please label with bug, in progress, on hold, discussion or to do to prevent the issue from being re-flagged.

github-actions[bot] commented 6 months ago

This issue has been automatically closed because it has not had activity in the last 30 days. If this issue is still valid, re-open the issue and let us know. // [stale-action-closed]