qmk / qmk_firmware

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

[Bug] Compilation errors with CONVERT_TO=promicro_rp2040 #21685

Closed AOrazaev closed 1 year ago

AOrazaev commented 1 year ago

Describe the Bug

I've tried to build converter/usb_usb/pro_micro with added CONVERT_TO=promicro_rp2040 into rules.md, but hit missing headers errors inside different libs (pico-sdk and usb host shield)

Fails on both master and develop branches.

Repro steps:

  1. Get this keymap file https://github.com/AOrazaev/kinesis360_config/blob/master/qmk_config.json
  2. Apply next diff to the rules.mk: Full diff of rules.mk;
    --- a/keyboards/converter/usb_usb/pro_micro/rules.mk
    +++ b/keyboards/converter/usb_usb/pro_micro/rules.mk
    @@ -1,2 +1,3 @@
    # Processor frequency
    -F_CPU = 8000000
    +
    +CONVERT_TO=promicro_rp2040
  3. run qmk compile qmk_config.json

Compilation errors

The compiler complains that cassert.h is missing inside pico-sdk.

arm-none-eabi-gcc (15:8-2019-q3-1+b1) 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
      0   25222       0   25222    6286 converter_usb_usb_pro_micro_k360_colemak_dh_with_mouse_layer.uf2

Compiling: keyboards/converter/usb_usb/custom_matrix.cpp                                           cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
In file included from ./lib/pico-sdk/src/common/pico_base/include/pico/types.h:12,
                 from ./lib/pico-sdk/src/common/pico_base/include/pico.h:24,
                 from ./lib/pico-sdk/src/rp2_common/hardware_flash/include/hardware/flash.h:10,
                 from ./platforms/chibios/drivers/wear_leveling/wear_leveling_rp2040_flash_config.h:6,
                 from <command-line>:
./lib/pico-sdk/src/common/pico_base/include/pico/assert.h:14:10: fatal error: cassert: No such file or directory
 #include <cassert>
          ^~~~~~~~~
compilation terminated.
 [ERRORS]
 |
 |
 |
gmake: *** [builddefs/common_rules.mk:360: .build/obj_converter_usb_usb_pro_micro_k360_colemak_dh_with_mouse_layer/custom_matrix.o] Error 1

I've tried to hack my way through it by patching lib/pico-sdk/src/common/pico_base/include/pico/assert.h the way it includes C-s header assert.h instead of cassert, but got another missing header from avr:

arm-none-eabi-gcc (15:8-2019-q3-1+b1) 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
      0   25222       0   25222    6286 converter_usb_usb_pro_micro_k360_colemak_dh_with_mouse_layer.uf2

Compiling: keyboards/converter/usb_usb/custom_matrix.cpp                                           cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
In file included from lib/usbhost/USB_Host_Shield_2.0/version_helper.h:24,
                 from lib/usbhost/USB_Host_Shield_2.0/settings.h:81,
                 from lib/usbhost/USB_Host_Shield_2.0/Usb.h:27,
                 from keyboards/converter/usb_usb/custom_matrix.cpp:22:
lib/usbhost/arduino-1.0.1/cores/arduino/Arduino.h:8:10: fatal error: avr/pgmspace.h: No such file or directory
 #include <avr/pgmspace.h>
          ^~~~~~~~~~~~~~~~
compilation terminated.
 [ERRORS]
 |
 |
 |
gmake: *** [builddefs/common_rules.mk:360: .build/obj_converter_usb_usb_pro_micro_k360_colemak_dh_with_mouse_layer/custom_matrix.o] Error 1

I'm up to help resolving this myself, but I guess I need some guidance.

Keyboard Used

converter/usb_usb/pro_micro

Link to product page (if applicable)

No response

Operating System

WSL

qmk doctor Output

Ψ QMK Doctor is checking your environment.
Ψ CLI version: 1.1.1
Ψ QMK home: /home/qmk/qmk_firmware
Ψ Detected Linux (WSL, Debian GNU/Linux 11 (bullseye)).
Ψ Git branch: develop
Ψ Repo version: 0.21.6
⚠ Git has unstashed/uncommitted changes.
Ψ - Latest develop: 2023-08-03 08:04:04 +0000 (c9fa2006d9) -- Merge remote-tracking branch 'origin/master' into develop
Ψ - Latest upstream/master: 2023-08-03 10:03:29 +0200 (37b62606ce) -- Add VIA layout for Dactyl Manuform 5x6 (#21649)
Ψ - Latest upstream/develop: 2023-08-03 08:04:04 +0000 (c9fa2006d9) -- Merge remote-tracking branch 'origin/master' into develop
Ψ - Common ancestor with upstream/master: 2023-08-03 10:03:29 +0200 (37b62606ce) -- Add VIA layout for Dactyl Manuform 5x6 (#21649)
Ψ - Common ancestor with upstream/develop: 2023-08-03 08:04:04 +0000 (c9fa2006d9) -- Merge remote-tracking branch 'origin/master' into develop
Ψ All dependencies are installed.
Ψ Found arm-none-eabi-gcc version 8.3.1
Ψ Found avr-gcc version 5.4.0
Ψ Found avrdude version 6.4
Ψ Found dfu-programmer version 0.7.2
Ψ Found dfu-util version 0.11
Would you like to clone the submodules? [Y/n] Y
Ψ 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

No response

fauxpark commented 1 year ago

This board won't work with converters, the USB host code is AVR only.