qmk / qmk_firmware

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

[Bug] xd75 doesn't build on head #23654

Closed xster closed 5 months ago

xster commented 5 months ago

Describe the Bug

Ψ Compiling keymap with gmake -r -R -f builddefs/build_keyboard.mk -s KEYBOARD=xiudi/xd75 KEYMAP=default KEYBOARD_FILESAFE=xiudi_xd75 TARGET=xiudi_xd75_default INTERMEDIATE_OUTPUT=.build/obj_xiudi_xd75_default VERBOSE=false COLOR=true SILENT=false QMK_BIN="qmk"

Generating: .build/obj_xiudi_xd75_default/src/info_deps.d                                           [OK]
avr-gcc (Homebrew AVR GCC 8.5.0_2) 8.5.0
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.

Generating: .build/obj_xiudi_xd75_default/src/info_config.h                                         [OK]
Generating: .build/obj_xiudi_xd75_default/src/default_keyboard.c                                    [OK]
Generating: .build/obj_xiudi_xd75_default/src/default_keyboard.h                                    [OK]
Compiling: keyboards/xiudi/xd75/xd75.c                                                              [OK]
Compiling: .build/obj_xiudi_xd75_default/src/default_keyboard.c                                     [OK]
Compiling: quantum/keymap_introspection.c                                                           [OK]
Compiling: quantum/quantum.c                                                                        [OK]
Compiling: quantum/bitwise.c                                                                        [OK]
Compiling: quantum/led.c                                                                            [OK]
Compiling: quantum/action.c                                                                         [OK]
Compiling: quantum/action_layer.c                                                                   [OK]
Compiling: quantum/action_tapping.c                                                                 [OK]
Compiling: quantum/action_util.c                                                                    [OK]
Compiling: quantum/eeconfig.c                                                                       [OK]
Compiling: quantum/keyboard.c                                                                       [OK]
Compiling: quantum/keymap_common.c                                                                  [OK]
Compiling: quantum/keycode_config.c                                                                 [OK]
Compiling: quantum/sync_timer.c                                                                     [OK]
Compiling: quantum/logging/debug.c                                                                  [OK]
Compiling: quantum/logging/sendchar.c                                                               [OK]
Compiling: quantum/matrix_common.c                                                                  [OK]
Compiling: quantum/matrix.c                                                                         [OK]
Compiling: quantum/debounce/sym_defer_g.c                                                           [OK]
Compiling: quantum/main.c                                                                           [OK]
Assembling: platforms/avr/xprintf.S                                                                 [OK]
Compiling: platforms/avr/printf.c                                                                   [OK]
Compiling: quantum/color.c                                                                          [OK]
Compiling: quantum/rgblight/rgblight.c                                                              [OK]
Compiling: quantum/rgblight/rgblight_drivers.c                                                      [OK]
Compiling: quantum/process_keycode/process_rgb.c                                                    [OK]
Compiling: quantum/backlight/backlight.c                                                            [OK]
Compiling: quantum/process_keycode/process_backlight.c                                              [OK]
Compiling: quantum/backlight/backlight_driver_common.c                                              [OK]
Compiling: platforms/avr/drivers/backlight_pwm.c                                                   platforms/avr/drivers/backlight_pwm.c: In function 'enable_pwm':
platforms/avr/drivers/backlight_pwm.c:133:5: error: 'TCCRxA' undeclared (first use in this function); did you mean 'TCCR0A'?
     TCCRxA |= _BV(COMxx1) | _BV(COMxx0);
     ^~~~~~
     TCCR0A
platforms/avr/drivers/backlight_pwm.c:133:5: note: each undeclared identifier is reported only once for each function it appears in
In file included from /opt/homebrew/Cellar/avr-gcc@8/8.5.0_2/avr/include/avr/io.h:99,
                 from platforms/avr/_pin_defs.h:18,
                 from platforms/pin_defs.h:22,
                 from platforms/gpio.h:18,
                 from platforms/avr/drivers/backlight_pwm.c:2:
platforms/avr/drivers/backlight_pwm.c:133:19: error: 'COMxx1' undeclared (first use in this function); did you mean 'COM1B1'?
     TCCRxA |= _BV(COMxx1) | _BV(COMxx0);
                   ^~~~~~
platforms/avr/drivers/backlight_pwm.c:133:33: error: 'COMxx0' undeclared (first use in this function); did you mean 'COM0A0'?
     TCCRxA |= _BV(COMxx1) | _BV(COMxx0);
                                 ^~~~~~
platforms/avr/drivers/backlight_pwm.c: In function 'disable_pwm':
platforms/avr/drivers/backlight_pwm.c:141:5: error: 'TCCRxA' undeclared (first use in this function); did you mean 'TCCR0A'?
     TCCRxA &= ~(_BV(COMxx1) | _BV(COMxx0));
     ^~~~~~
     TCCR0A
In file included from /opt/homebrew/Cellar/avr-gcc@8/8.5.0_2/avr/include/avr/io.h:99,
                 from platforms/avr/_pin_defs.h:18,
                 from platforms/pin_defs.h:22,
                 from platforms/gpio.h:18,
                 from platforms/avr/drivers/backlight_pwm.c:2:
platforms/avr/drivers/backlight_pwm.c:141:21: error: 'COMxx1' undeclared (first use in this function); did you mean 'COM1B1'?
     TCCRxA &= ~(_BV(COMxx1) | _BV(COMxx0));
                     ^~~~~~
platforms/avr/drivers/backlight_pwm.c:141:35: error: 'COMxx0' undeclared (first use in this function); did you mean 'COM0A0'?
     TCCRxA &= ~(_BV(COMxx1) | _BV(COMxx0));
                                   ^~~~~~
platforms/avr/drivers/backlight_pwm.c: In function 'cie_lightness':
platforms/avr/drivers/backlight_pwm.c:147:24: error: 'ICRx' undeclared (first use in this function); did you mean 'ICR3'?
     if (v <= (uint32_t)ICRx / 12) // If the value is less than or equal to ~8% of max
                        ^~~~
                        ICR3
platforms/avr/drivers/backlight_pwm.c: In function 'set_pwm':
platforms/avr/drivers/backlight_pwm.c:170:5: error: 'OCRxx' undeclared (first use in this function); did you mean 'OCR1C'?
     OCRxx = val;
     ^~~~~
     OCR1C
platforms/avr/drivers/backlight_pwm.c: In function 'backlight_set':
platforms/avr/drivers/backlight_pwm.c:184:45: error: 'ICRx' undeclared (first use in this function); did you mean 'ICR3'?
     set_pwm(cie_lightness(rescale_limit_val(ICRx * (uint32_t)level / BACKLIGHT_LEVELS)));
                                             ^~~~
                                             ICR3
platforms/avr/drivers/backlight_pwm.c: In function 'backlight_init_ports':
platforms/avr/drivers/backlight_pwm.c:316:5: error: 'TCCRxA' undeclared (first use in this function); did you mean 'TCCR0A'?
     TCCRxA = _BV(COMxx1) | _BV(WGM11);            // = 0b00001010;
     ^~~~~~
     TCCR0A
In file included from /opt/homebrew/Cellar/avr-gcc@8/8.5.0_2/avr/include/avr/io.h:99,
                 from platforms/avr/_pin_defs.h:18,
                 from platforms/pin_defs.h:22,
                 from platforms/gpio.h:18,
                 from platforms/avr/drivers/backlight_pwm.c:2:
platforms/avr/drivers/backlight_pwm.c:316:18: error: 'COMxx1' undeclared (first use in this function); did you mean 'COM1B1'?
     TCCRxA = _BV(COMxx1) | _BV(WGM11);            // = 0b00001010;
                  ^~~~~~
platforms/avr/drivers/backlight_pwm.c:317:5: error: 'TCCRxB' undeclared (first use in this function); did you mean 'TCCR0B'?
     TCCRxB = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001;
     ^~~~~~
     TCCR0B
platforms/avr/drivers/backlight_pwm.c:318:5: error: 'ICRx' undeclared (first use in this function); did you mean 'ICR3'?
     ICRx   = BACKLIGHT_RESOLUTION;
     ^~~~
     ICR3
 [ERRORS]
 |
 |
 |
gmake: *** [builddefs/common_rules.mk:373: .build/obj_xiudi_xd75_default/platforms/avr/drivers/backlight_pwm.o] Error 1

Keyboard Used

xd75

Link to product page (if applicable)

No response

Operating System

macOS 14.4.1

qmk doctor Output

Ψ QMK Doctor is checking your environment.
Ψ CLI version: 1.1.5
Ψ QMK home: /Users/xster/development/qmk_firmware
Ψ Detected macOS 14.4.1 (Apple Silicon).
Ψ Userspace enabled: False
Ψ Git branch: updated_ergodox
Ψ Repo version: 0.19.2
⚠ Git has unstashed/uncommitted changes.
Ψ - Latest updated_ergodox: 2024-05-02 16:53:21 -0700 (dc2f8781e9) -- updated to head for ergodox and it works
Ψ - Latest upstream/master: 2024-05-02 22:11:23 -0700 (8075003e60) -- ZSA Voyager Layout Fix (#23651)
Ψ - Latest upstream/develop: 2024-05-03 15:21:29 +1000 (d09a06a1b3) -- Update GPIO API usage in keyboard code (#23361)
Ψ - Common ancestor with upstream/master: 2022-12-07 08:44:19 +1100 (3fa1e8e273) -- Bump anothrNick/github-tag-action from 1.53.0 to 1.54.0 (#19246)
Ψ - Common ancestor with upstream/develop: 2022-12-07 08:44:19 +1100 (3fa1e8e273) -- Bump anothrNick/github-tag-action from 1.53.0 to 1.54.0 (#19246)
Ψ CLI installed in virtualenv.
Ψ All dependencies are installed.
Ψ Found arm-none-eabi-gcc version 8.3.1
Ψ Found avr-gcc version 8.5.0
Ψ Found avrdude version 7.3
Ψ Found dfu-programmer version 1.1.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-11-27 18:15:44 +0100 --  (9d7a7f90)
Ψ - 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 --  (e19410f)
Ψ QMK is ready to go, but minor problems were found


### Is AutoHotKey / Karabiner installed

- [ ] AutoHotKey (Windows)
- [ ] Karabiner (macOS)

### Other keyboard-related software installed

_No response_

### Additional Context

_No response_
lesshonor commented 5 months ago

I am not sure what you mean by "sync qmk_firmware to tip of tree". screenshot of user branch that is almost 4000 commits behind QMK master

QMK has some documentation on working with git which you may find helpful.

Be warned that in the intervening years, xd75 has been moved to xiudi/xd75. There have likely been many other changes which could break your keymaps. I would honestly recommend doing a git fetch upstream && git checkout upstream/master so you can scope things out with a detached HEAD before taking any plunges. Best of luck.

xster commented 5 months ago

oops my bad. I didn't in fact merge correctly with tip of tree. Thought I did yesterday :S

qmk compile -kb xd75 -km default does indeed build on qmk/qmk_firmware:master. Sorry for the noise.

xster commented 5 months ago

Perhaps what I should be really asking is that there seems to be a regression on xd75 on head with the backlight feature.

Putting aside my userspace keymap for the time being, setting https://github.com/qmk/qmk_firmware/blob/8075003e6068d6f8fa5396972c2a17d39d14c584/keyboards/xiudi/xd75/rules.mk#L10 to yes no longer seems to work with the default keymap. But the hardware itself does have LEDs on the board and a per key LED which used to work in the past.

zvecr commented 5 months ago

The following compiles fine on develop

diff --git a/keyboards/xiudi/xd75/keyboard.json b/keyboards/xiudi/xd75/keyboard.json
index a928b43f9b..7d0e6c1bfc 100644
--- a/keyboards/xiudi/xd75/keyboard.json
+++ b/keyboards/xiudi/xd75/keyboard.json
@@ -15,6 +15,7 @@
         "extrakey": true,
         "mousekey": true,
         "nkro": false,
+        "backlight": true,
         "rgblight": true
     },
     "matrix_pins": {
@@ -24,6 +25,7 @@
     "diode_direction": "COL2ROW",
     "backlight": {
         "pin": "F5",
+        "driver": "timer",
         "levels": 6,
         "on_state": 0
     },
xster commented 5 months ago

I see. I suppose it works on master too with

BACKLIGHT_ENABLE = yes
BACKLIGHT_DRIVER = timer

Unclear how users would know to set BACKLIGHT_DRIVER as well. Perhaps this was implicit at one point further up in the tree when rules.mk for this keyboard used to set the MCU, etc. Not sure if related.

Either way, I can build my keymap on master now. Thanks!