Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8112

SDK • SDK 2.0.0 Migration: #error no SW_SPIN_TRY_LOCK available

$
0
0
I am trying to migrate to a new development board. Old board was W6100-EVB-PICO. Original code ran on Pico SDK 1.5.1.

New board is W6100-EVB-PICO2. SDK 1.5.1 lacks support for Pico2.

I was able to compile to Pico 1 using Pico SDK 2.0.0, and code ran fine.

In my CMakeLists.txt, I changed PICO_PLATFORM to rp2350 and PICO_BOARD to pico2.

I get error "no SW_SPIN_TRY_LOCK available for PICO_USE_SW_SPIN_LOCK on this platform"

I found a similar post, and comments suggested deleting build folder and rebuilding. I deleted build folder, restarted VSCode, and rebuilt, and still had the same error.

Digging through SDK, I find pico2.h, which has:
#define PICO_RP2350A 1

I also found spin_lock.h has the following:
#if PICO_RP2350
#define PICO_USE_SW_SPIN_LOCKS 1
#endif

Many files in the SDK use #ifdef PICO_RP2350A, but very few (including spin_lock.h) seem to use #ifdef PICO_RP2350.

I suspect that the naming convention has been changed, and these files were not modified with the new convention.

I have tried modifying spin_lock.h to use PICO_RP2350A, but when I build, the file reverts back to PICO_RP2350.

Question 1: is this a bug in the Pico SDK?
Question 2: how can I keep this file from automatically reverting so I can test this change?

Statistics: Posted by ccutler — Wed Nov 20, 2024 2:12 am



Viewing all articles
Browse latest Browse all 8112

Trending Articles