mechboardsguides / flashing-rp2040-promicro

A brief guide on flashing the rp2040 pro micro we sell.
9 stars 1 forks source link

qmk compile fails #1

Open techscholarau opened 3 weeks ago

techscholarau commented 3 weeks ago

Newbie here just trying to get a corne v3 keyboard built but having issues getting the ProMicro RP2040 recongnised on my mac.

I have setup qmk according to this link https://docs.qmk.fm/newbs_getting_started.

This is what I get when I run: qmk doctor

/usr/local/lib/python3.10/site-packages/qmk_cli/script_qmk.py:18: UserWarning: milc.set_metadata has been deprecated, please use cli.milc_options() instead. milc.set_metadata(version=version) Ψ QMK Doctor is checking your environment. Ψ CLI version: 1.1.5 Ψ QMK home: /Users/pjw/qmk_firmware Ψ Detected macOS 13.7 (Intel). Ψ Userspace enabled: False Ψ Git branch: master Ψ Repo version: 0.26.9 Ψ - Latest master: 2024-10-28 13:59:54 +0700 (7c9e650b1c) -- [Keyboard] Add S6xty PCB (#24465) Ψ - Latest upstream/master: 2024-10-28 13:59:54 +0700 (7c9e650b1c) -- [Keyboard] Add S6xty PCB (#24465) Ψ - Latest upstream/develop: None Ψ - Common ancestor with upstream/master: 2024-10-28 13:59:54 +0700 (7c9e650b1c) -- [Keyboard] Add S6xty PCB (#24465) Ψ - Common ancestor with upstream/develop: None Ψ All dependencies are installed. Ψ Found arm-none-eabi-gcc version 14.2.0 Ψ Found avr-gcc version 9.4.0 Ψ Found avrdude version 8.0 Ψ Found dfu-programmer version 1.1.0 Ψ Found dfu-util version 0.11 Ψ Submodules are up to date. Ψ Submodule status: Ψ - lib/chibios: 2024-02-17 19:20:06 +0000 -- (be44b3305) Ψ - lib/chibios-contrib: 2024-04-03 20:39:24 +0800 -- (77cb0a4f) Ψ - 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

I can run this command to test the environment: qmk compile -kb crkbd/rev1 -km default

qmk compile -kb crkbd/rev1 -km default /usr/local/lib/python3.10/site-packages/qmk_cli/script_qmk.py:18: UserWarning: milc.set_metadata has been deprecated, please use cli.milc_options() instead. milc.set_metadata(version=version) /Users/pjw/qmk_firmware/lib/python/qmk/decorators.py:20: UserWarning: cli._subcommand has been deprecated, please use cli.subcommand_name to get the subcommand name instead. if cli.config_source[cli._subcommand.name]['keyboard'] != 'argument': /Users/pjw/qmk_firmware/lib/python/qmk/decorators.py:40: UserWarning: cli._subcommand has been deprecated, please use cli.subcommand_name to get the subcommand name instead. if cli.config_source[cli._subcommand.name]['keymap'] != 'argument': Ψ Compiling keymap with gmake -r -R -f builddefs/build_keyboard.mk -s KEYBOARD=crkbd/rev1 KEYMAP=default KEYBOARD_FILESAFE=crkbd_rev1 TARGET=crkbd_rev1_default VERBOSE=false COLOR=true SILENT=false QMK_BIN="qmk"

/usr/local/lib/python3.10/site-packages/qmk_cli/script_qmk.py:18: UserWarning: milc.set_metadata has been deprecated, please use cli.milc_options() instead. milc.set_metadata(version=version) /usr/local/lib/python3.10/site-packages/qmk_cli/script_qmk.py:18: UserWarning: milc.set_metadata has been deprecated, please use cli.milc_options() instead. milc.set_metadata(version=version) avr-gcc (Homebrew AVR GCC 9.4.0_1) 9.4.0 Copyright (C) 2019 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 26242 0 26242 6682 crkbd_rev1_default.hex

Copying crkbd_rev1_default.hex to qmk_firmware folder [OK] Checking file size of crkbd_rev1_default.hex [OK]

When I run this command, as suggested within this guide, it gives me an error: qmk compile -kb crkbd/rev1 -km default -e CONVERT_TO=rp2040_ce

qmk compile -kb crkbd/rev1 -km default -e CONVERT_TO=rp2040_ce /usr/local/lib/python3.10/site-packages/qmk_cli/script_qmk.py:18: UserWarning: milc.set_metadata has been deprecated, please use cli.milc_options() instead. milc.set_metadata(version=version) /Users/pjw/qmk_firmware/lib/python/qmk/decorators.py:20: UserWarning: cli._subcommand has been deprecated, please use cli.subcommand_name to get the subcommand name instead. if cli.config_source[cli._subcommand.name]['keyboard'] != 'argument': /Users/pjw/qmk_firmware/lib/python/qmk/decorators.py:40: UserWarning: cli._subcommand has been deprecated, please use cli.subcommand_name to get the subcommand name instead. if cli.config_source[cli._subcommand.name]['keymap'] != 'argument': Ψ Compiling keymap with gmake -r -R -f builddefs/build_keyboard.mk -s KEYBOARD=crkbd/rev1 KEYMAP=default KEYBOARD_FILESAFE=crkbd_rev1 TARGET=crkbd_rev1_default VERBOSE=false COLOR=true SILENT=false QMK_BIN="qmk" CONVERT_TO=rp2040_ce

/usr/local/lib/python3.10/site-packages/qmk_cli/script_qmk.py:18: UserWarning: milc.set_metadata has been deprecated, please use cli.milc_options() instead. milc.set_metadata(version=version) /usr/local/lib/python3.10/site-packages/qmk_cli/script_qmk.py:18: UserWarning: milc.set_metadata has been deprecated, please use cli.milc_options() instead. milc.set_metadata(version=version) arm-none-eabi-gcc (GCC) 14.2.0 Copyright (C) 2024 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.

Compiling: keyboards/crkbd/crkbd.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 : ./lib/pico-sdk/src/common/pico_base/include/pico/assert.h:18:10: fatal error: assert.h: No such file or directory 18 #include ^~~~~~ compilation terminated. [ERRORS]

gmake: *** [builddefs/common_rules.mk:373: .build/obj_crkbd_rev1_default_rp2040_ce/keyboards/crkbd/crkbd.o] Error 1

I can see the microcontroller connected to the mac as RPI-RP2 and the contents of the INFO_UF2.TXT file shows:

UF2 Bootloader v3.0 Model: Raspberry Pi RP2 Board-ID: RPI-RP2

I did start to poke around trying to fix this compiling issue but eventually got to a point where I thought I better ask for some assistance as I am WAY out of my depth.

Any ideas would be greatly appreciated.

kind regards techscholar

keyboard-magpie commented 3 weeks ago

This looks like a milc install issue. I think the qmk team are aware of the issues surrounding this package.

You can try python3 -m pip install milc==1.8.0 but a virtual environment install may be needed:


source qmk_env/bin/activate
python3 -m pip install --force-reinstall -v "milc==1.8"``` (I think)
techscholarau commented 3 weeks ago

Thanks for your comments @keyboard-magpie. I appreciate your time and effort in responding.

Not sure exactly how this fixed it, but this is the process I followed (just in case it can help someone else!):

  1. Uninstall/remove everything (from homebrew and the cloned git repository).
  2. Created a Virtual Environment using the following commands: cd ~ python3 -m venv qmk_env source qmk_env/bin/activate
  3. Ran through the QMK Firmware Getting Started page (https://docs.qmk.fm/newbs_getting_started).
  4. Tested the build environment: "qmk compile -kb crkbd/rev1 -km default" and hit 2 x path issues. I had to add the 2 x paths into my .zshrc file (export PATH=$PATH:/path/number1:/path/number2) and restarted my terminal session.
  5. Ran "qmk compile -kb crkbd/rev1 -km default" again and it worked.
  6. Ran ""qmk compile -kb crkbd/rev1 -km default -e CONVERT_TO=rp2040_ce" and it worked!
  7. I was then able to copy the .uf2 file generated onto the keyboard on the Mac and all was working!

So not rue if it was the Virtual Environment hint, but thank you as I now have a working environment on my Mac so I can start tweaking the keymap :-)

Kind regards techscholar