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

SDK • Re: Where is PICO_PLATFORM specified when a board is used

$
0
0

Code:

// pico_cmake_set PICO_PLATFORM=rp2350
This is what sets the PICO_PLATFORM when you specify a board - these pico_cmake_set and pico_cmake_set_default comments are parsed by the SDK in cmake/generic_board.cmake, to set the platform based on the board file
Or is this pico_flash_region.ld generated based on PICO_FLASH_SIZE_BYTES?
Yes, it is set by the "pico_cmake_set_default PICO_FLASH_SIZE_BYTES = ..." comment in the board file
Wow, thanks for both these answers. But boy, that first answer, it's April 1st and I almost couldn't believe it to be real, but indeed it seems that regex is parsing the commented line. :o Why was it done this way? This is the most magical thing yet I've seen in a build system, where commented parts are actually parsed and used in this way for critical things. Was this done by design? Is this documented anywhere? To be honest, I think it's a bad idea to use commented lines in this way, and super confusing to anybody trying to understand it. I guess it may have been done this way as a bit of a hack so you don't need an additional file for the cmake settings? Either way, thanks so much for this clarification, but it would be super nice if you could somehow make this more transparent.

Statistics: Posted by piconico — Tue Apr 01, 2025 8:48 pm



Viewing all articles
Browse latest Browse all 8037

Trending Articles