Use of PICO_HARD_FLOAT_ABI #3160

Closed
opened 2026-08-25 09:14:22 -05:00 by dpgeorge · 3 comments
dpgeorge commented 2026-08-25 09:14:22 -05:00 (Migrated from github.com)

In MicroPython we want to enable -mfloat-abi=hard for all RP2350 boards when in ARM mode.

But simply adding set(PICO_HARD_FLOAT_ABI ON) to our CMakeLists.txt forces it to be on for RP2040 as well which leads to a compile error.

On the other hand, we don't know that we are on RP2350 until we have included ${PICO_SDK_PATH}/pico_sdk_init.cmake and done pico_sdk_init(), but by then it's too late to set PICO_HARD_FLOAT_ABI.

Maybe I'm missing something simple here... how to enable hard float ABI for only the RP2350 ARM builds?

In MicroPython we want to enable `-mfloat-abi=hard` for all RP2350 boards when in ARM mode. But simply adding `set(PICO_HARD_FLOAT_ABI ON)` to our `CMakeLists.txt` forces it to be on for RP2040 as well which leads to a compile error. On the other hand, we don't know that we are on RP2350 until we have included `${PICO_SDK_PATH}/pico_sdk_init.cmake` and done `pico_sdk_init()`, but by then it's too late to set `PICO_HARD_FLOAT_ABI`. Maybe I'm missing something simple here... how to enable hard float ABI for only the RP2350 ARM builds?
dpgeorge commented 2026-08-30 20:03:55 -05:00 (Migrated from github.com)

I did find somewhat of a workaround for this, which requires each board to set PICO_PLATFORM (and all rp2350 boards already did that):

# include board-specific config
# ...

if(PICO_PLATFORM)
    if(${PICO_PLATFORM} STREQUAL "rp2350")
        set(PICO_HARD_FLOAT_ABI ON)
    endif()
endif()

# include and set up pico-sdk
# ...
I did find somewhat of a workaround for this, which requires each board to set `PICO_PLATFORM` (and all rp2350 boards already did that): ``` # include board-specific config # ... if(PICO_PLATFORM) if(${PICO_PLATFORM} STREQUAL "rp2350") set(PICO_HARD_FLOAT_ABI ON) endif() endif() # include and set up pico-sdk # ... ```
kilograham commented 2026-09-01 11:22:48 -05:00 (Migrated from github.com)

sorted in develop

sorted in develop
dpgeorge commented 2026-09-01 22:12:33 -05:00 (Migrated from github.com)

Thank you!

Thank you!
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk#3160
No description provided.