Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 22.04 : Build error #113

Closed
OrpheeGT opened this issue Jun 27, 2024 · 5 comments
Closed

Ubuntu 22.04 : Build error #113

OrpheeGT opened this issue Jun 27, 2024 · 5 comments

Comments

@OrpheeGT
Copy link

Hello,

I'm not able to build from source on Ubuntu 22.04.

I first had the following error :

cmake -S . -B build
PICO_SDK_PATH is /home/orphee/Downloads/PCB/deskhop/pico-sdk
Defaulting PICO_PLATFORM to rp2040 since not specified.
Defaulting PICO platform compiler to pico_arm_gcc since not specified.
-- Defaulting build type to 'Release' since not specified.
PICO compiler is pico_arm_gcc
CMake Error at pico-sdk/cmake/preload/toolchains/find_compiler.cmake:28 (message):
  Compiler 'arm-none-eabi-gcc' not found, you can specify search path with
  "PICO_TOOLCHAIN_PATH".
Call Stack (most recent call first):
  pico-sdk/cmake/preload/toolchains/pico_arm_gcc.cmake:20 (pico_find_compiler)
  /usr/share/cmake-3.22/Modules/CMakeDetermineSystem.cmake:124 (include)
  CMakeLists.txt:12 (project)


CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_ASM_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

Fixed by installing gcc-arm-none-eabi package

But now i have the following error :

$ cmake -S . -B build
PICO_SDK_PATH is /home/orphee/Downloads/PCB/deskhop/pico-sdk
Defaulting PICO_PLATFORM to rp2040 since not specified.
Defaulting PICO platform compiler to pico_arm_gcc since not specified.
-- Defaulting build type to 'Release' since not specified.
PICO compiler is pico_arm_gcc
-- The C compiler identification is GNU 10.3.1
-- The CXX compiler identification is GNU 10.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/arm-none-eabi-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/arm-none-eabi-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/arm-none-eabi-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Build type is Release
Defaulting PICO target board to pico since not specified.
Using board configuration from /home/orphee/Downloads/PCB/deskhop/pico-sdk/src/boards/include/boards/pico.h
-- Found Python3: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter 
TinyUSB available at /home/orphee/Downloads/PCB/deskhop/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/orphee/Downloads/PCB/deskhop/build

$ cmake --build build
Scanning dependencies of target bs2_default
[  1%] Building ASM object pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/compile_time_choice.S.obj
[  1%] Linking ASM executable bs2_default.elf
[  1%] Built target bs2_default
[  2%] Generating bs2_default.bin
[  2%] Generating bs2_default_padded_checksummed.S
[  2%] Built target bs2_default_padded_checksummed_asm
[  3%] Creating directories for 'PioasmBuild'
[  4%] No download step for 'PioasmBuild'
[  5%] No update step for 'PioasmBuild'
[  5%] No patch step for 'PioasmBuild'
[  5%] Performing configure step for 'PioasmBuild'
loading initial cache file /home/orphee/Downloads/PCB/deskhop/build/pioasm/tmp/PioasmBuild-cache-Release.cmake
-- The CXX compiler identification is GNU 13.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/orphee/Downloads/PCB/deskhop/build/pioasm
[  5%] Performing build step for 'PioasmBuild'
[ 10%] Building CXX object CMakeFiles/pioasm.dir/main.cpp.o
[ 20%] Building CXX object CMakeFiles/pioasm.dir/pio_assembler.cpp.o
[ 30%] Building CXX object CMakeFiles/pioasm.dir/pio_disassembler.cpp.o
[ 40%] Building CXX object CMakeFiles/pioasm.dir/gen/lexer.cpp.o
[ 50%] Building CXX object CMakeFiles/pioasm.dir/gen/parser.cpp.o
[ 60%] Building CXX object CMakeFiles/pioasm.dir/c_sdk_output.cpp.o
[ 70%] Building CXX object CMakeFiles/pioasm.dir/python_output.cpp.o
[ 80%] Building CXX object CMakeFiles/pioasm.dir/hex_output.cpp.o
[ 90%] Building CXX object CMakeFiles/pioasm.dir/ada_output.cpp.o
[100%] Linking CXX executable pioasm
[100%] Built target pioasm
[  5%] No install step for 'PioasmBuild'
[  6%] Completed 'PioasmBuild'
[  6%] Built target PioasmBuild
[  6%] Generating usb_tx.pio.h
[  6%] Built target Pico-PIO-USB_usb_tx_pio_h
[  7%] Generating usb_rx.pio.h
[  7%] Built target Pico-PIO-USB_usb_rx_pio_h
Scanning dependencies of target Pico-PIO-USB
[  7%] Building C object CMakeFiles/Pico-PIO-USB.dir/Pico-PIO-USB/src/pio_usb.c.obj
[  8%] Building C object CMakeFiles/Pico-PIO-USB.dir/Pico-PIO-USB/src/pio_usb_host.c.obj
[  8%] Building C object CMakeFiles/Pico-PIO-USB.dir/Pico-PIO-USB/src/usb_crc.c.obj
[  9%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_stdlib/stdlib.c.obj
[  9%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/hardware_gpio/gpio.c.obj
[ 10%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_platform/platform.c.obj
[ 10%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/hardware_claim/claim.c.obj
[ 10%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/hardware_sync/sync.c.obj
[ 11%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/hardware_irq/irq.c.obj
[ 11%] Building ASM object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/hardware_irq/irq_handler_chain.S.obj
[ 12%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/common/pico_sync/sem.c.obj
[ 12%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/common/pico_sync/lock_core.c.obj
[ 13%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/common/pico_sync/mutex.c.obj
[ 13%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/common/pico_sync/critical_section.c.obj
[ 13%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/common/pico_time/time.c.obj
[ 14%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/common/pico_time/timeout_helper.c.obj
[ 14%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/hardware_timer/timer.c.obj
[ 15%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/common/pico_util/datetime.c.obj
[ 15%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/common/pico_util/pheap.c.obj
[ 16%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/common/pico_util/queue.c.obj
[ 16%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/hardware_uart/uart.c.obj
[ 16%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/hardware_clocks/clocks.c.obj
[ 17%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/hardware_pll/pll.c.obj
[ 17%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/hardware_vreg/vreg.c.obj
[ 18%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/hardware_watchdog/watchdog.c.obj
[ 18%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/hardware_xosc/xosc.c.obj
[ 19%] Building ASM object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/hardware_divider/divider.S.obj
[ 19%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_runtime/runtime.c.obj
[ 19%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_printf/printf.c.obj
[ 20%] Building ASM object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_bit_ops/bit_ops_aeabi.S.obj
[ 20%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_bootrom/bootrom.c.obj
[ 21%] Building ASM object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_divider/divider.S.obj
[ 21%] Building ASM object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_double/double_aeabi.S.obj
[ 22%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_double/double_init_rom.c.obj
[ 22%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_double/double_math.c.obj
[ 22%] Building ASM object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_double/double_v1_rom_shim.S.obj
[ 23%] Building ASM object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_int64_ops/pico_int64_ops_aeabi.S.obj
[ 23%] Building ASM object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_float/float_aeabi.S.obj
[ 24%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_float/float_init_rom.c.obj
[ 24%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_float/float_math.c.obj
[ 25%] Building ASM object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_float/float_v1_rom_shim.S.obj
[ 25%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_malloc/pico_malloc.c.obj
[ 25%] Building ASM object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_mem_ops/mem_ops_aeabi.S.obj
[ 26%] Building ASM object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_standard_link/crt0.S.obj
[ 26%] Building CXX object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_standard_link/new_delete.cpp.obj
[ 27%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_standard_link/binary_info.c.obj
[ 27%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_stdio/stdio.c.obj
[ 28%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_stdio_uart/stdio_uart.c.obj
[ 28%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/pico_multicore/multicore.c.obj
[ 28%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/hardware_pio/pio.c.obj
[ 29%] Building C object CMakeFiles/Pico-PIO-USB.dir/pico-sdk/src/rp2_common/hardware_dma/dma.c.obj
[ 29%] Linking CXX static library libPico-PIO-USB.a
[ 29%] Built target Pico-PIO-USB
[ 29%] Creating directories for 'ELF2UF2Build'
[ 29%] No download step for 'ELF2UF2Build'
[ 29%] No update step for 'ELF2UF2Build'
[ 30%] No patch step for 'ELF2UF2Build'
[ 31%] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is GNU 13.1.0
-- The CXX compiler identification is GNU 13.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/orphee/Downloads/PCB/deskhop/build/elf2uf2
[ 31%] Performing build step for 'ELF2UF2Build'
[ 50%] Building CXX object CMakeFiles/elf2uf2.dir/main.cpp.o
[100%] Linking CXX executable elf2uf2
[100%] Built target elf2uf2
[ 32%] No install step for 'ELF2UF2Build'
[ 32%] Completed 'ELF2UF2Build'
[ 32%] Built target ELF2UF2Build
Scanning dependencies of target board_A
[ 32%] Building C object CMakeFiles/board_A.dir/src/usb_descriptors.c.obj
[ 32%] Building C object CMakeFiles/board_A.dir/src/defaults.c.obj
[ 33%] Building C object CMakeFiles/board_A.dir/src/hid_parser.c.obj
[ 33%] Building C object CMakeFiles/board_A.dir/src/utils.c.obj
[ 34%] Building C object CMakeFiles/board_A.dir/src/handlers.c.obj
[ 34%] Building C object CMakeFiles/board_A.dir/src/setup.c.obj
[ 35%] Building C object CMakeFiles/board_A.dir/src/keyboard.c.obj
[ 35%] Building C object CMakeFiles/board_A.dir/src/mouse.c.obj
[ 35%] Building C object CMakeFiles/board_A.dir/src/led.c.obj
[ 36%] Building C object CMakeFiles/board_A.dir/src/uart.c.obj
[ 36%] Building C object CMakeFiles/board_A.dir/src/usb.c.obj
/home/orphee/Downloads/PCB/deskhop/src/usb.c: In function 'tuh_hid_mount_cb':
/home/orphee/Downloads/PCB/deskhop/src/usb.c:135:13: error: a label can only be part of a statement and a declaration is not a statement
  135 |             uint8_t num_parsed
      |             ^~~~~~~
gmake[2]: *** [CMakeFiles/board_A.dir/build.make:216 : CMakeFiles/board_A.dir/src/usb.c.obj] Erreur 1
gmake[1]: *** [CMakeFiles/Makefile2:1588 : CMakeFiles/board_A.dir/all] Erreur 2
gmake: *** [Makefile:91 : all] Erreur 2

I updated gcc to version 13 (was 11 at first) but did not fix the issue.

What do I miss ?

Thanks

@hrvach
Copy link
Owner

hrvach commented Jun 27, 2024

Try git pulling again and rebuilding, moved that variable out of the case block... it's funny, doesn't complain for me.

@OrpheeGT
Copy link
Author

OrpheeGT commented Jun 27, 2024

Thanks I will try just now.

another question :
https://github.com/hrvach/deskhop/blob/main/src/user_config.h#L35

How to set combined key ? like LEFT SHIFT + CAPS ?

@hrvach
Copy link
Owner

hrvach commented Jun 27, 2024

Check keyboard.c, there is a hotkey_combo_t struct at the beginning. It's hopefully well documented.

@OrpheeGT
Copy link
Author

Ok,

Replacing https://github.com/hrvach/deskhop/blob/main/src/keyboard.c#L26

by {.modifier = KEYBOARD_MODIFIER_LEFTSHIFT,

Should do the job if I understood the other combos correctly :)

@OrpheeGT
Copy link
Author

Thanks, it works now ;)

@OrpheeGT OrpheeGT changed the title Ubuntu p22.04 : Build error Ubuntu 22.04 : Build error Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants