From e2f8cc7f3ee772520d51ccec81960de10472fd53 Mon Sep 17 00:00:00 2001 From: Riku Viitanen Date: Sat, 28 Dec 2024 03:53:25 +0200 Subject: pico-serprog: enable building for multiple pico chips rp2040 and rp2530 platforms can't share a cmake build directory. we could just delete the build directory after every compilation, but that would be really wasteful (every tool would need to be recomiled every time. instead create new build directories as new plaforms are found and symlink them to the point where the build directory used to be. to find out which platform we're compiling for, we crudely parse the board headers file. there surely would be better ways to do this, but this hack works with all the boards in pico-sdk 2.1.0. Signed-off-by: Riku Viitanen --- include/rom.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/rom.sh b/include/rom.sh index ec2ad650..215b9eab 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -11,7 +11,14 @@ mkserprog() basename -as .h "$serdir/"*.h > "$TMPDIR/ser" || $err "!mk $1 $TMPDIR" while read -r sertarget; do - [ "$1" = "rp2040" ] && x_ cmake -DPICO_BOARD="$sertarget" \ + [ "$1" = "rp2040" ] && + x_ rm -rf "$sersrc/build" \ + && (pt=$(x_ grep "pico_cmake_set" \ + "$picosdk/src/boards/include/boards/$sertarget.h" \ + | grep "PICO_PLATFORM" | cut -d= -f2 | tr -d [:blank:]) + mkdir -p "$sersrc/build_$pt" + ln -srf "$sersrc/build_$pt/" "$sersrc/build") \ + && x_ cmake -DPICO_BOARD="$sertarget" \ -DPICO_SDK_PATH="$picosdk" -B "$sersrc/build" "$sersrc" \ && x_ cmake --build "$sersrc/build" [ "$1" = "stm32" ] && x_ make -C "$sersrc" \ -- cgit v1.2.1 From a5e0360992d5411c098e4434c8617c234932ede8 Mon Sep 17 00:00:00 2001 From: Riku Viitanen Date: Sat, 28 Dec 2024 04:02:08 +0200 Subject: pico-sdk: update to 2.1.0 this brings support for a new microcontroller platform rp2530. total number of pico boards supported now: 97 TEST: built them all Tested-by: Riku Viitanen Signed-off-by: Riku Viitanen --- config/git/pico-sdk/pkg.cfg | 2 +- config/git/pico-serprog/rp2040-serprog | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 120000 config/git/pico-serprog/rp2040-serprog diff --git a/config/git/pico-sdk/pkg.cfg b/config/git/pico-sdk/pkg.cfg index 284ee057..8af13d09 100644 --- a/config/git/pico-sdk/pkg.cfg +++ b/config/git/pico-sdk/pkg.cfg @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later -rev="6a7db34ff63345a7badec79ebea3aaef1712f374" +rev="95ea6acad131124694cda1c162c52cd30e0aece0" url="https://codeberg.org/libreboot/pico-sdk" bkup_url="https://github.com/raspberrypi/pico-sdk" diff --git a/config/git/pico-serprog/rp2040-serprog b/config/git/pico-serprog/rp2040-serprog new file mode 120000 index 00000000..25af91dc --- /dev/null +++ b/config/git/pico-serprog/rp2040-serprog @@ -0,0 +1 @@ +config/git/rp2040-serprog \ No newline at end of file -- cgit v1.2.1