C Raspberry Pi Pico

No, it's invoking the target g++ compiler and that is picking up the host includes. If I manually run what that makefile is doing:
Code:
% arm-none-eabi-g++ -c /home/arg/work/pico/pico-sdk/src/rp2_common/pico_standard_link/new_delete.cpp
In file included from /usr/include/c++/v1/cstdlib:84,
                 from /home/arg/work/pico/pico-sdk/src/rp2_common/pico_standard_link/new_delete.cpp:10:
/usr/include/c++/v1/__config:1132:6: error: #error "No thread API"
 #    error "No thread API"
and looking at line 10 of that file, it's just:
Code:
#include <cstdlib>
So the include path for the g++ in the arm-none-eabi-gcc port appears to be wrong.
 
Deleting the arm-none-eabi package and replacing it with gcc-arm-embedded makes it work. Since gcc-arm-embedded installs in a separate directory rather than /usr/local/bin, you also need to set PICO_TOOLCHAIN_PATH=/usr/local/gcc-arm-embedded , but it then successfully builds all of the examples.
 
Downloading executables by mounting the USB mass storage exposed by the Pico and copying UF2 images onto it works fine, but I find it a bit clunky:

Code:
# camcontrol devlist
… other drives here ….
<RPI RP2 2>                        at scbus8 target 0 lun 0 (da0,pass4)
# mount -t msdos /dev/da0s1 /mnt
# cp work/pico/pico-examples/build/blink/blink.uf2 /mnt
# umount /mnt

Picotool is nicer for a shell user, and it almost builds out-of-the-box (Appendix B in the 'getting started' guide), however the Cmake script fails to locate FreeBSD's libusb correctly because the library is called 'libusb' rather than 'libusb-1.0'. I'm not sure if this is a defect in FreeBSD's package description (/usr/libdata/pkgconfig/libusb-1.0.pc) or that pkgtool/cmake just can't handle this automatically, but it's easily fixed in the cmake script that comes in the picotool source:

Code:
% git diff
diff --git a/cmake/FindLIBUSB.cmake b/cmake/FindLIBUSB.cmake
index c8cc62c..560e023 100644
--- a/cmake/FindLIBUSB.cmake
+++ b/cmake/FindLIBUSB.cmake
@@ -20,7 +20,7 @@ else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
     ENDIF(NOT WIN32)
     FIND_PATH(LIBUSB_INCLUDE_DIR libusb.h
             PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
-    FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0
+    FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0 usb
             PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
     include(FindPackageHandleStandardArgs)
     FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)

ie. just add "usb" after "usb-1.0" on the FIND_LIBRARY line.

The USB console examples work just fine with FreeBSD, popping up as /dev/ttyU0 etc.
 
I'm going to have another go at this tonight. Thanks for the missing info, I was kind of stumped why it didn't work. I had a feeling it has something to do with the include directories (why was it trying to pull in include files from FreeBSD's /usr/include) but couldn't figure out why that happened.
 
I hacked up a version of pico_setup.sh for FreeBSD - the examples and picoprobe build for me. I haven't tested vscode but it does install. Building openocd failed due to one of its dependencies (libjaylink) failing.
 

Attachments

  • pico_setup.sh.txt
    4.3 KB · Views: 126
If I have some time this weekend I'll have a look at it.
 
I spent a little more time on this and have openocd building (with a small patch which I'll try to push upstream) and I was able to build and run/debug the pico examples in vscode using openocd and picoprobe. To build in vscode, you may need to configure the CMake Tools extension to use the 'Unix Makefiles' generator instead of Ninja.
 

Attachments

  • pico_setup.sh.txt
    3.9 KB · Views: 149
Hi everyone,

I've been wanting learn C and programming it on a Pico W seemed like a fun way to learn.
I was able to install Thonny and follow the steps in this thread to get the MicroPython interpreter working on the Pico. However, I haven't been so lucky when trying to install build chain for C.

I followed the basic steps from the Getting Started guide, and after that didn't work I did my best to follow what I could find on these forums. Unfortunately since I'm still new to compiling projects, tool chains, and UNIX some of it went over my head.

Following the above starter guide, I installed git and clone pico-skd and pico-examples to a directory my local machine.

Next I installed the packages I believed were required to compile the code for the pico:
pkg install arm-none-eabi-gcc
pkg install arm-none-eabi-newlib

and ran the cmake in the build directory.

I issued the command export PICO_SDK_PATH=../../pico-sdk followed by cmake .. and it responded with the following output indicating that the build files had been successfully written.

PICO_SDK_PATH is /home/jholloway/pico/pico-sdk
PICO platform is rp2040.
Build type is Release
PICO target board is pico.
Using board configuration from /home/jholloway/pico/pico-sdk/src/boards/include/boards/pico.h
TinyUSB available at /home/jholloway/pico/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB.
BTstack available at /home/jholloway/pico/pico-sdk/lib/btstack
cyw43-driver available at /home/jholloway/pico/pico-sdk/lib/cyw43-driver
Pico W Bluetooth build support available.
lwIP available at /home/jholloway/pico/pico-sdk/lib/lwip
mbedtls available at /home/jholloway/pico/pico-sdk/lib/mbedtls
Skipping TinyUSB dual examples, as TinyUSB hw/mcu/raspberry_pi/Pico-PIO-USB submodule unavailable
-- Configuring done (1.1s)
-- Generating done (1.1s)
-- Build files have been written to: /home/jholloway/pico/pico-examples/build
However, when I ran make in the build folder, I receive the following error message:

$ make
[ 0%] Built target bs2_default
[ 0%] Performing build step for 'PioasmBuild'
[100%] Built target pioasm
[ 0%] No install step for 'PioasmBuild'
[ 0%] Completed 'PioasmBuild'
[ 0%] Built target PioasmBuild
[ 0%] Built target bs2_default_padded_checksummed_asm
[ 0%] Performing build step for 'ELF2UF2Build'
[100%] Built target elf2uf2
[ 0%] No install step for 'ELF2UF2Build'
[ 0%] Completed 'ELF2UF2Build'
[ 0%] Built target ELF2UF2Build
[ 0%] Building CXX object blink/CMakeFiles/blink.dir/home/jholloway/pico/pico-sdk/src/rp2_common/pico_standard_link/new_delete.cpp.obj
/home/jholloway/pico/pico-sdk/src/rp2_common/pico_standard_link/new_delete.cpp:11:10: fatal error: cstdlib: No such file or directory
11 | #include <cstdlib>
| ^~~~~~~~~
compilation terminated.
*** Error code 1

Stop.
make[2]: stopped in /home/jholloway/pico/pico-examples/build
*** Error code 1

Stop.
make[1]: stopped in /home/jholloway/pico/pico-examples/build
*** Error code 1

Stop.
make: stopped in /home/jholloway/pico/pico-examples/build
$
I'm not exactly sure what this error message means, but it looked similar to what was in Arg's post. I removed the packages for arm-none-eabi-gcc and arm-none-eabi-newlib, and issued the command pkg install gcc-arm-embedded to install the package recommended in the post. Unfortunately, when I go back to the build directory and run make I encounter this error message stating that arm-none-eabi-gcc is not found:

$ make
[ 0%] Built target bs2_default
[ 0%] Performing build step for 'PioasmBuild'
[100%] Built target pioasm
[ 0%] No install step for 'PioasmBuild'
[ 0%] Completed 'PioasmBuild'
[ 0%] Built target PioasmBuild
[ 0%] Built target bs2_default_padded_checksummed_asm
[ 0%] Performing build step for 'ELF2UF2Build'
[100%] Built target elf2uf2
[ 0%] No install step for 'ELF2UF2Build'
[ 0%] Completed 'ELF2UF2Build'
[ 0%] Built target ELF2UF2Build
[ 0%] Building C object blink/CMakeFiles/blink.dir/blink.c.obj
/bin/sh: /usr/local/bin/arm-none-eabi-gcc: not found
*** Error code 127
make[2]: *** blink/CMakeFiles/blink.dir/blink.c.obj removed

Stop.
make[2]: stopped in /home/jholloway/pico/pico-examples/build
*** Error code 1

Stop.
make[1]: stopped in /home/jholloway/pico/pico-examples/build
*** Error code 1

Stop.
make: stopped in /home/jholloway/pico/pico-examples/build

I'm not sure if I understood the command in Arg's subsequent post, I tried to use export PICO_TOOLCHAIN_PATH=/usr/local/gcc-arm-embedded however, running make afterwards results in the same error message as the above text.

Do I have to do something different to change the compiler for this program? Is it something else?

I'm afraid I'm new to all of this, so some of it is going over my head regarding compilers, cmake and make. Any advice would be greatly appreciated.

Thanks in advance to everyone!
 
I'm not sure if I understood the command in Arg's subsequent post, I tried to use export PICO_TOOLCHAIN_PATH=/usr/local/gcc-arm-embedded however, running make afterwards results in the same error message as the above text.

Do I have to do something different to change the compiler for this program? Is it something else?
I did not work with this for some time, but I used slightly different path for Pico Toolchain:

env PICO_TOOLCHAIN_PATH=/usr/local/gcc-arm-embedded-10.3-2021.10/arm-none-eabi/bin cmake ..

Caveat: this is from my history file and may not be the last working version, so take it just as an example.
 
Thanks dino1. I tried setting the toolchain using the command you provided, but it didn't seem to work.

Checking the version number for gcc-arm-embedded it appears to be the same version of 10.3
$ pkg info gcc-arm-embedded
gcc-arm-embedded-10.3.20210921
Name : gcc-arm-embedded
Version : 10.3.20210921


When setting the toolchain via env PICO_TOOLCHAIN_PATH=/usr/local/gcc-arm-embedded-10.3-2021.10/arm-none-eabi/bin is it to be done before running cmake or running make? I noticed in your example it was before running cmake ..

If I enter either that command or env PICO_TOOLCHAIN_PATH=/usr/local/gcc-arm-embedded followed by make it results in the following error output:
$ env PICO_TOOLCHAIN_PATH=/usr/local/gcc-arm-embedded/
PICO_TOOLCHAIN_PATH=/usr/local/gcc-arm-embedded/
LOGNAME=jholloway
LANG=C.UTF-8
XAUTHORITY=/home/jholloway/.Xauthority
MAIL=/var/mail/jholloway
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin
SESSION_MANAGER=local/jh.holloway.bsd:/tmp/.ICE-unix/1777
SSH_AUTH_SOCK=/tmp/ssh-9oRIZaeAIozL/agent.1791
DISPLAY=unix:0.0
PWD=/home/jholloway/pico/pico-examples/build
VTE_VERSION=7002
TERM=xterm-256color
DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-BoEIGsknmK,guid=c8d2324c46c7dc5ae43d8a6d65304974
HOME=/home/jholloway
USER=jholloway
COLORTERM=truecolor
SHELL=/bin/sh
PANEL_GDK_CORE_DEVICE_EVENTS=0
MM_CHARSET=UTF-8
WINDOWID=56651375
XDG_SESSION_COOKIE=jh.holloway.bsd-1697663348.373391-1941614651
SSH_AGENT_PID=1792
$ pwd
/home/jholloway/pico/pico-examples/build
$ make
PICO_SDK_PATH is /home/jholloway/pico/pico-sdk
PICO platform is rp2040.
Build type is Release
PICO target board is pico.
Using board configuration from /home/jholloway/pico/pico-sdk/src/boards/include/boards/pico.h
TinyUSB available at /home/jholloway/pico/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB.
BTstack available at /home/jholloway/pico/pico-sdk/lib/btstack
cyw43-driver available at /home/jholloway/pico/pico-sdk/lib/cyw43-driver
Pico W Bluetooth build support available.
lwIP available at /home/jholloway/pico/pico-sdk/lib/lwip
mbedtls available at /home/jholloway/pico/pico-sdk/lib/mbedtls
Skipping TinyUSB dual examples, as TinyUSB hw/mcu/raspberry_pi/Pico-PIO-USB submodule unavailable
-- Configuring done (0.9s)
-- Generating done (0.8s)
-- Build files have been written to: /home/jholloway/pico/pico-examples/build
[ 0%] Built target bs2_default
[ 0%] Performing build step for 'PioasmBuild'
[100%] Built target pioasm
[ 0%] No install step for 'PioasmBuild'
[ 0%] Completed 'PioasmBuild'
[ 0%] Built target PioasmBuild
[ 0%] Built target bs2_default_padded_checksummed_asm
[ 0%] Performing build step for 'ELF2UF2Build'
[100%] Built target elf2uf2
[ 0%] No install step for 'ELF2UF2Build'
[ 0%] Completed 'ELF2UF2Build'
[ 0%] Built target ELF2UF2Build
[ 0%] Building C object blink/CMakeFiles/blink.dir/blink.c.obj
In file included from /home/jholloway/pico/pico-sdk/src/rp2040/hardware_structs/include/hardware/structs/timer.h:12,
from /home/jholloway/pico/pico-sdk/src/rp2_common/hardware_timer/include/hardware/timer.h:11,
from /home/jholloway/pico/pico-sdk/src/common/pico_time/include/pico/time.h:11,
from /home/jholloway/pico/pico-sdk/src/common/pico_stdlib/include/pico/stdlib.h:12,
from /home/jholloway/pico/pico-examples/blink/blink.c:7:
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:157:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
157 | __force_inline static void hw_write_masked(io_rw_32 *addr, uint32_t values, uint32_t write_mask) {
| ^~~~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:141:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
141 | __force_inline static void hw_xor_bits(io_rw_32 *addr, uint32_t mask) {
| ^~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:131:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
131 | __force_inline static void hw_clear_bits(io_rw_32 *addr, uint32_t mask) {
| ^~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:121:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
121 | __force_inline static void hw_set_bits(io_rw_32 *addr, uint32_t mask) {
| ^~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:93:32: warning: 'always_inline' function might not be inlinable [-Wattributes]
93 | __force_inline static uint32_t xip_alias_check_addr(const void *addr) {
| ^~~~~~~~~~~~~~~~~~~~
In file included from /home/jholloway/pico/pico-sdk/src/common/pico_base/include/pico.h:33,
from /home/jholloway/pico/pico-sdk/src/common/pico_stdlib/include/pico/stdlib.h:10,
from /home/jholloway/pico/pico-examples/blink/blink.c:7:
/home/jholloway/pico/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:517:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
517 | __force_inline static uint get_core_num(void) {
| ^~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:481:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
481 | static __force_inline uint __get_current_exception(void) {
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:446:31: warning: 'always_inline' function might not be inlinable [-Wattributes]
446 | __force_inline static int32_t __mul_instruction(int32_t a, int32_t b) {
| ^~~~~~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:434:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
434 | static __force_inline void tight_loop_contents(void) {}
| ^~~~~~~~~~~~~~~~~~~
In file included from /home/jholloway/pico/pico-sdk/src/common/pico_base/include/pico.h:33,
from /home/jholloway/pico/pico-sdk/src/common/pico_stdlib/include/pico/stdlib.h:10,
from /home/jholloway/pico/pico-examples/blink/blink.c:7:
/home/jholloway/pico/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:360:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
360 | __force_inline static void __compiler_memory_barrier(void) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
[ 1%] Building C object blink/CMakeFiles/blink.dir/home/jholloway/pico/pico-sdk/src/common/pico_time/time.c.obj
In file included from /home/jholloway/pico/pico-sdk/src/common/pico_time/time.c:9:
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:58:26: error: expected ';' before 'typedef'
58 | __NULLABILITY_PRAGMA_PUSH
| ^
| ;
59 |
60 | typedef __off_t fpos_t;
| ~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:60:9: error: unknown type name '__off_t'
60 | typedef __off_t fpos_t;
| ^~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:75:9: error: unknown type name '__off_t'
75 | typedef __off_t off_t;
| ^~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:79:9: error: unknown type name '__ssize_t'
79 | typedef __ssize_t ssize_t;
| ^~~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:85:9: error: unknown type name '__off64_t'
85 | typedef __off64_t off64_t;
| ^~~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:90:9: error: unknown type name '__va_list'
90 | typedef __va_list __not_va_list__;
| ^~~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:148:29: error: expected ')' before '_close'
148 | int (* _Nullable _close)(void *);
| ^~~~~~~
| )
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:149:29: error: expected ')' before '_read'
149 | int (* _Nullable _read)(void *, char *, int);
| ^~~~~~
| )
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:150:29: error: expected ')' before '_seek'
150 | fpos_t (* _Nullable _seek)(void *, fpos_t, int);
| ^~~~~~
| )
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:151:29: error: expected ')' before '_write'
151 | int (* _Nullable _write)(void *, const char *, int);
| ^~~~~~~
| )
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:173:9: error: unknown type name '__mbstate_t'
173 | __mbstate_t _mbstate; /* multibyte conversion state */
| ^~~~~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:372:25: error: unknown type name '__off_t'; did you mean '_off_t'?
372 | int fseeko(FILE *, __off_t, int);
| ^~~~~~~
| _off_t
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:373:1: error: unknown type name '__off_t'; did you mean '_off_t'?
373 | __off_t ftello(FILE *);
| ^~~~~~~
| _off_t
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:426:20: error: conflicting types for '_Nullable'; have 'int (*)(void *, const char *, int)'
426 | int (* _Nullable)(void *, const char *, int),
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:425:20: note: previous definition of '_Nullable' with type 'int (*)(void *, char *, int)'
425 | int (* _Nullable)(void *, char *, int),
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:427:23: error: conflicting types for '_Nullable'; have 'fpos_t (*)(void *, fpos_t, int)' {aka 'int (*)(void *, int, int)'}
427 | fpos_t (* _Nullable)(void *, fpos_t, int),
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:426:20: note: previous definition of '_Nullable' with type 'int (*)(void *, const char *, int)'
426 | int (* _Nullable)(void *, const char *, int),
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:428:20: error: conflicting types for '_Nullable'; have 'int (*)(void *)'
428 | int (* _Nullable)(void *));
| ~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:427:23: note: previous definition of '_Nullable' with type 'fpos_t (*)(void *, fpos_t, int)' {aka 'int (*)(void *, int, int)'}
427 | fpos_t (* _Nullable)(void *, fpos_t, int),
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:432:9: error: unknown type name '__ssize_t'
432 | typedef __ssize_t cookie_read_function_t(void *, char *, size_t);
| ^~~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:433:9: error: unknown type name '__ssize_t'
433 | typedef __ssize_t cookie_write_function_t(void *, const char *, size_t);
| ^~~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:449:25: error: unknown type name '__off_t'; did you mean '_off_t'?
449 | int ftruncate(int, __off_t);
| ^~~~~~~
| _off_t
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:453:1: error: unknown type name '__off_t'; did you mean '_off_t'?
453 | __off_t lseek(int, __off_t, int);
| ^~~~~~~
| _off_t
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:453:21: error: unknown type name '__off_t'; did you mean '_off_t'?
453 | __off_t lseek(int, __off_t, int);
| ^~~~~~~
| _off_t
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:457:46: error: unknown type name '__off_t'; did you mean '_off_t'?
457 | void *mmap(void *, size_t, int, int, int, __off_t);
| ^~~~~~~
| _off_t
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:461:33: error: unknown type name '__off_t'; did you mean '_off_t'?
461 | int truncate(const char *, __off_t);
| ^~~~~~~
| _off_t
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdio.h:545:1: error: unknown type name '__NULLABILITY_PRAGMA_POP'
545 | __NULLABILITY_PRAGMA_POP
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/jholloway/pico/pico-sdk/src/common/pico_time/time.c:10:
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdlib.h:50:26: error: expected ';' before 'typedef'
50 | __NULLABILITY_PRAGMA_PUSH
| ^
| ;
......
54 | typedef __rune_t rune_t;
| ~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdlib.h:54:9: error: unknown type name '__rune_t'
54 | typedef __rune_t rune_t;
| ^~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdlib.h:115:14: error: expected ',' or ';' before '__alloc_size2'
115 | __alloc_size2(1, 2);
| ^~~~~~~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdlib.h:306:27: error: unknown type name '__mode_t'
306 | char *devname(__dev_t, __mode_t);
| ^~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdlib.h:307:29: error: unknown type name '__mode_t'
307 | char *devname_r(__dev_t, __mode_t, char *, int);
| ^~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdlib.h:335:13: error: expected ',' or ';' before '__alloc_size2'
335 | __alloc_size2(2, 3);
| ^~~~~~~~~~~~~
/usr/local/lib/gcc/arm-none-eabi/11.3.0/include-fixed/stdlib.h:417:25: error: expected ';' before 'void'
417 | __NULLABILITY_PRAGMA_POP
| ^
| ;
In file included from /home/jholloway/pico/pico-sdk/src/common/pico_sync/include/pico/lock_core.h:12,
from /home/jholloway/pico/pico-sdk/src/common/pico_sync/include/pico/sem.h:10,
from /home/jholloway/pico/pico-sdk/src/common/pico_sync/include/pico/sync.h:15,
from /home/jholloway/pico/pico-sdk/src/common/pico_time/time.c:14:
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:314:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
314 | __force_inline static void spin_unlock(spin_lock_t *lock, uint32_t saved_irq) {
| ^~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:287:32: warning: 'always_inline' function might not be inlinable [-Wattributes]
287 | __force_inline static uint32_t spin_lock_blocking(spin_lock_t *lock) {
| ^~~~~~~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:274:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
274 | __force_inline static void spin_unlock_unsafe(spin_lock_t *lock) {
| ^~~~~~~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:261:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
261 | __force_inline static void spin_lock_unsafe_blocking(spin_lock_t *lock) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:249:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
249 | __force_inline static uint spin_lock_get_num(spin_lock_t *lock) {
| ^~~~~~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:238:36: warning: 'always_inline' function might not be inlinable [-Wattributes]
238 | __force_inline static spin_lock_t *spin_lock_instance(uint lock_num) {
| ^~~~~~~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:228:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
228 | __force_inline static void restore_interrupts(uint32_t status) {
| ^~~~~~~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:214:32: warning: 'always_inline' function might not be inlinable [-Wattributes]
214 | __force_inline static uint32_t save_and_disable_interrupts(void) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:197:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
197 | __force_inline static void __mem_fence_release(void) {
| ^~~~~~~~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:181:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
181 | __force_inline static void __mem_fence_acquire(void) {
| ^~~~~~~~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:174:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
174 | __force_inline static void __isb(void) {
| ^~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:163:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
163 | __force_inline static void __dsb(void) {
| ^~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:152:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
152 | __force_inline static void __dmb(void) {
| ^~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:141:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
141 | __force_inline static void __wfi(void) {
| ^~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:130:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
130 | __force_inline static void __wfe(void) {
| ^~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_sync/include/hardware/sync.h:118:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
118 | __force_inline static void __sev(void) {
| ^~~~~
In file included from /home/jholloway/pico/pico-sdk/src/rp2040/hardware_structs/include/hardware/structs/timer.h:12,
from /home/jholloway/pico/pico-sdk/src/rp2_common/hardware_timer/include/hardware/timer.h:11,
from /home/jholloway/pico/pico-sdk/src/common/pico_time/include/pico/time.h:11,
from /home/jholloway/pico/pico-sdk/src/common/pico_time/time.c:12:
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:157:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
157 | __force_inline static void hw_write_masked(io_rw_32 *addr, uint32_t values, uint32_t write_mask) {
| ^~~~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:141:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
141 | __force_inline static void hw_xor_bits(io_rw_32 *addr, uint32_t mask) {
| ^~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:131:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
131 | __force_inline static void hw_clear_bits(io_rw_32 *addr, uint32_t mask) {
| ^~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:121:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
121 | __force_inline static void hw_set_bits(io_rw_32 *addr, uint32_t mask) {
| ^~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:93:32: warning: 'always_inline' function might not be inlinable [-Wattributes]
93 | __force_inline static uint32_t xip_alias_check_addr(const void *addr) {
| ^~~~~~~~~~~~~~~~~~~~
In file included from /home/jholloway/pico/pico-sdk/src/common/pico_base/include/pico.h:33,
from /home/jholloway/pico/pico-sdk/src/common/pico_time/time.c:11:
/home/jholloway/pico/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:517:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
517 | __force_inline static uint get_core_num(void) {
| ^~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:481:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
481 | static __force_inline uint __get_current_exception(void) {
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:446:31: warning: 'always_inline' function might not be inlinable [-Wattributes]
446 | __force_inline static int32_t __mul_instruction(int32_t a, int32_t b) {
| ^~~~~~~~~~~~~~~~~
/home/jholloway/pico/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:434:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
434 | static __force_inline void tight_loop_contents(void) {}
| ^~~~~~~~~~~~~~~~~~~
In file included from /home/jholloway/pico/pico-sdk/src/common/pico_base/include/pico.h:33,
from /home/jholloway/pico/pico-sdk/src/common/pico_time/time.c:11:
/home/jholloway/pico/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:360:28: warning: 'always_inline' function might not be inlinable [-Wattributes]
360 | __force_inline static void __compiler_memory_barrier(void) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
*** Error code 1

Stop.
make[2]: stopped in /home/jholloway/pico/pico-examples/build
*** Error code 1

Stop.
make[1]: stopped in /home/jholloway/pico/pico-examples/build
*** Error code 1

Stop.
make: stopped in /home/jholloway/pico/pico-examples/build
$

Just to make sure I'm not messing things up, is the proper way to set the variable for either the PICO_SDK_PATH or PICO_TOOLCHAIN_PATH to use export or env?


I think I might need to spend more time learning how cmake and make function. They're new and a little confusing for me.
 
Thank's everyone, I was able to get it working.

While following the Pico getting started guide I had to run the command
env PICO_TOOLCHAIN_PATH=/usr/local/gcc-arm-embedded PICO_SDK_PATH=../../pico-sdk cmake ..

Once the build files had been written, I was able to run make and have the pico-example C programs compile successfully.

I just double checked what packages I have installed:
arm-none-eabi-gcc
arm-none-eabi-binutils-2.40_4,1 (comes installed with the above)
and
gcc-arm-embedded

Some other pages said that arm-none-eabi-newlib is required, but I was able to build the examples with the three packages above.

Thanks everyone for your assistance!
 
I got a Pi Pico and a Pico Demo VGA Board for Christmas - going to try installing the Doom port on it.

I've already connected the Pico and the Pico Demo board together on the headers - do I need to disconnect them in order to upload the .UF2 file?

I feel overwhelmed already. Not built for this!
 
I've already connected the Pico and the Pico Demo board together on the headers - do I need to disconnect them in order to upload the .UF2 file?
Separating the two seems to be fairly fatal. I've tried connecting by holding the BOOTSEL button down and connecting it to USB on a couple of different operating systems, but no response, with the Pi Pico connected to the vgaboard.

Edit: got it. Ignore me. Having a meltdown or something.
 
Back
Top