RPi Pico play with slackwareARM
by louigi600 from LinuxQuestions.org on (#5EK1C)
Just to dismiss any confusion: the RPi Pico is an interesting and cheap microcontroller for the features it gives.
This post is about being able to produce programs for the pico from SlackwareARM as opposed to doing that from RPiOS.
I could not resist trying a RPi Pico ... seems to to be relatively easy to build program for the pico from RPiOS (my own led blink program was a matter of minutes) ... but now I would like to build from slackware.
So I set about it but have not yet got it working. Hoping someone can help here.
Here's what I've done so far:
The core of the pico is an RP2040 which is a 32-bit dual core ARM Cortex-M0+ (armv6-m architecture) so the slackwareARM-current native compiler cannot produce code for rp2040 as it is tuned for armv7+.
It might be possible to use slackwareARM 14.2 compiler but the pico-sdk has a minimum requirement of cmake 3.12+ that is not met in 14.2.
I worked around the problem by bowworing the compiler from RPiOS.
The pico-sdk is on git so I cloned that as per their getting started documentation.
Then I setup a few environment variables to match where I put things:
Code:export PICO_SDK_PATH=/usr/src/pico/pico-sdk
export PICO_TOOLCHAIN_PATH=/usr/src/pico/pico-sdk/toolchain/usr/bin
export LD_LIBRARY_PATH=/usr/src/pico/pico-sdk/toolchain/usr/libI did not download any of the pico-examples and went ahead and created my own blink project
Code:root@rpi4:/usr/src/pico/blink# ls -l
total 16
-rw-r--r-- 1 root root 210 Feb 23 2021 CMakeLists.txt
-rw-r--r-- 1 root root 650 Feb 23 2021 blink.c
drwxr-xr-x 2 root root 4096 Jan 1 01:06 build/
-rw-r--r-- 1 root root 2763 Feb 23 2021 pico_sdk_import.cmake
root@rpi4:/usr/src/pico/blink#Went into the build subfolder and tried to build it. Cmake seems to have worked
Code:root@rpi4:/usr/src/pico/blink/build# cmake ..
Using PICO_SDK_PATH from environment ('/usr/src/pico/pico-sdk')
PICO_SDK_PATH is /usr/src/pico/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
PICO_GCC_TRIPLE defaulted to arm-none-eabi
-- The C compiler identification is GNU 7.3.1
-- The CXX compiler identification is GNU 7.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/src/pico/pico-sdk/toolchain/usr/bin/arm-none-eabi-gcc
Defaulting PICO target board to pico since not specified.
Using board configuration from /usr/src/pico/pico-sdk/src/boards/include/boards/pico.h
-- Found Python3: /usr/bin/python3.9 (found version "3.9.1") found components: Interpreter
TinyUSB available at /usr/src/pico/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; adding USB support.
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.20") found components: doxygen missing components: dot
ELF2UF2 will need to be built
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/src/pico/blink/build
root@rpi4:/usr/src/pico/blink/build#but then make fails
Code:root@rpi4:/usr/src/pico/blink/build# make
PICO_SDK_PATH is /usr/src/pico/pico-sdk
PICO platform is rp2040.
PICO compiler is
PICO_GCC_TRIPLE defaulted to arm-none-eabi
PICO target board is pico.
Using board configuration from /usr/src/pico/pico-sdk/src/boards/include/boards/pico.h
TinyUSB available at /usr/src/pico/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; adding USB support.
ELF2UF2 will need to be built
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/src/pico/blink/build
Scanning dependencies of target ELF2UF2Build
[ 1%] Creating directories for 'ELF2UF2Build'
[ 3%] No download step for 'ELF2UF2Build'
[ 5%] No update step for 'ELF2UF2Build'
[ 6%] No patch step for 'ELF2UF2Build'
[ 8%] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.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: /usr/src/pico/blink/build/elf2uf2
[ 10%] Performing build step for 'ELF2UF2Build'
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/src/pico/blink/build/elf2uf2
Scanning dependencies of target elf2uf2
make[5]: Warning: File '/usr/src/pico/pico-sdk/tools/elf2uf2/main.cpp' has modification time 1614095643 s in the future
[ 50%] Building CXX object CMakeFiles/elf2uf2.dir/main.cpp.o
[100%] Linking CXX executable elf2uf2
make[5]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target elf2uf2
[ 11%] No install step for 'ELF2UF2Build'
[ 13%] Completed 'ELF2UF2Build'
[ 13%] Built target ELF2UF2Build
Scanning dependencies of target bs2_default
make[2]: Warning: File '/usr/src/pico/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S' has modification time 1614095640 s in the future
[ 15%] Building ASM object pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/boot2_w25q080.S.obj
[ 16%] Linking ASM executable bs2_default.elf
arm-none-eabi-gcc: error: nosys.specs: No such file or directory
make[2]: *** [pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/build.make:96: pico-sdk/src/rp2_common/boot_stage2/bs2_default.elf] Error 1
make[1]: *** [CMakeFiles/Makefile2:1575: pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/all] Error 2
make: *** [Makefile:103: all] Error 2
root@rpi4:/usr/src/pico/blink/build#but nosys.specs is part of the toolchain I borrowed from RPiOS:
Code:root@rpi4:/mnt/tmp# find /usr/src/pico/pico-sdk/toolchain/ -type f -name nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/hard/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7-m/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7e-m/fpv4-sp/hard/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7e-m/fpv4-sp/softfp/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7e-m/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7e-m/fpv5/hard/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7e-m/fpv5/softfp/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7-ar/fpv3/hard/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7-ar/fpv3/hard/be/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7-ar/fpv3/softfp/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7-ar/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v8-m.main/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v8-m.main/fpv5-sp/hard/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v8-m.main/fpv5-sp/softfp/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v8-m.main/fpv5/hard/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v8-m.main/fpv5/softfp/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v8-m.base/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v6-m/nosys.specs
root@rpi4:/mnt/tmp#Anyone have any idea how to move on from here ?


This post is about being able to produce programs for the pico from SlackwareARM as opposed to doing that from RPiOS.
I could not resist trying a RPi Pico ... seems to to be relatively easy to build program for the pico from RPiOS (my own led blink program was a matter of minutes) ... but now I would like to build from slackware.
So I set about it but have not yet got it working. Hoping someone can help here.
Here's what I've done so far:
The core of the pico is an RP2040 which is a 32-bit dual core ARM Cortex-M0+ (armv6-m architecture) so the slackwareARM-current native compiler cannot produce code for rp2040 as it is tuned for armv7+.
It might be possible to use slackwareARM 14.2 compiler but the pico-sdk has a minimum requirement of cmake 3.12+ that is not met in 14.2.
I worked around the problem by bowworing the compiler from RPiOS.
The pico-sdk is on git so I cloned that as per their getting started documentation.
Then I setup a few environment variables to match where I put things:
Code:export PICO_SDK_PATH=/usr/src/pico/pico-sdk
export PICO_TOOLCHAIN_PATH=/usr/src/pico/pico-sdk/toolchain/usr/bin
export LD_LIBRARY_PATH=/usr/src/pico/pico-sdk/toolchain/usr/libI did not download any of the pico-examples and went ahead and created my own blink project
Code:root@rpi4:/usr/src/pico/blink# ls -l
total 16
-rw-r--r-- 1 root root 210 Feb 23 2021 CMakeLists.txt
-rw-r--r-- 1 root root 650 Feb 23 2021 blink.c
drwxr-xr-x 2 root root 4096 Jan 1 01:06 build/
-rw-r--r-- 1 root root 2763 Feb 23 2021 pico_sdk_import.cmake
root@rpi4:/usr/src/pico/blink#Went into the build subfolder and tried to build it. Cmake seems to have worked
Code:root@rpi4:/usr/src/pico/blink/build# cmake ..
Using PICO_SDK_PATH from environment ('/usr/src/pico/pico-sdk')
PICO_SDK_PATH is /usr/src/pico/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
PICO_GCC_TRIPLE defaulted to arm-none-eabi
-- The C compiler identification is GNU 7.3.1
-- The CXX compiler identification is GNU 7.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/src/pico/pico-sdk/toolchain/usr/bin/arm-none-eabi-gcc
Defaulting PICO target board to pico since not specified.
Using board configuration from /usr/src/pico/pico-sdk/src/boards/include/boards/pico.h
-- Found Python3: /usr/bin/python3.9 (found version "3.9.1") found components: Interpreter
TinyUSB available at /usr/src/pico/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; adding USB support.
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.20") found components: doxygen missing components: dot
ELF2UF2 will need to be built
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/src/pico/blink/build
root@rpi4:/usr/src/pico/blink/build#but then make fails
Code:root@rpi4:/usr/src/pico/blink/build# make
PICO_SDK_PATH is /usr/src/pico/pico-sdk
PICO platform is rp2040.
PICO compiler is
PICO_GCC_TRIPLE defaulted to arm-none-eabi
PICO target board is pico.
Using board configuration from /usr/src/pico/pico-sdk/src/boards/include/boards/pico.h
TinyUSB available at /usr/src/pico/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; adding USB support.
ELF2UF2 will need to be built
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/src/pico/blink/build
Scanning dependencies of target ELF2UF2Build
[ 1%] Creating directories for 'ELF2UF2Build'
[ 3%] No download step for 'ELF2UF2Build'
[ 5%] No update step for 'ELF2UF2Build'
[ 6%] No patch step for 'ELF2UF2Build'
[ 8%] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.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: /usr/src/pico/blink/build/elf2uf2
[ 10%] Performing build step for 'ELF2UF2Build'
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/src/pico/blink/build/elf2uf2
Scanning dependencies of target elf2uf2
make[5]: Warning: File '/usr/src/pico/pico-sdk/tools/elf2uf2/main.cpp' has modification time 1614095643 s in the future
[ 50%] Building CXX object CMakeFiles/elf2uf2.dir/main.cpp.o
[100%] Linking CXX executable elf2uf2
make[5]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target elf2uf2
[ 11%] No install step for 'ELF2UF2Build'
[ 13%] Completed 'ELF2UF2Build'
[ 13%] Built target ELF2UF2Build
Scanning dependencies of target bs2_default
make[2]: Warning: File '/usr/src/pico/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S' has modification time 1614095640 s in the future
[ 15%] Building ASM object pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/boot2_w25q080.S.obj
[ 16%] Linking ASM executable bs2_default.elf
arm-none-eabi-gcc: error: nosys.specs: No such file or directory
make[2]: *** [pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/build.make:96: pico-sdk/src/rp2_common/boot_stage2/bs2_default.elf] Error 1
make[1]: *** [CMakeFiles/Makefile2:1575: pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/all] Error 2
make: *** [Makefile:103: all] Error 2
root@rpi4:/usr/src/pico/blink/build#but nosys.specs is part of the toolchain I borrowed from RPiOS:
Code:root@rpi4:/mnt/tmp# find /usr/src/pico/pico-sdk/toolchain/ -type f -name nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/hard/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7-m/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7e-m/fpv4-sp/hard/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7e-m/fpv4-sp/softfp/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7e-m/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7e-m/fpv5/hard/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7e-m/fpv5/softfp/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7-ar/fpv3/hard/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7-ar/fpv3/hard/be/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7-ar/fpv3/softfp/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v7-ar/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v8-m.main/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v8-m.main/fpv5-sp/hard/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v8-m.main/fpv5-sp/softfp/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v8-m.main/fpv5/hard/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v8-m.main/fpv5/softfp/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v8-m.base/nosys.specs
/usr/src/pico/pico-sdk/toolchain/usr/lib/arm-none-eabi/newlib/thumb/v6-m/nosys.specs
root@rpi4:/mnt/tmp#Anyone have any idea how to move on from here ?