Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Usage of Bootsel Button for Pico 2 #2869

Merged
merged 4 commits into from
Nov 14, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion hw/bsp/rp2040/family.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ bool __no_inline_not_in_flash_func(get_bootsel_button)(void) {

// The HI GPIO registers in SIO can observe and control the 6 QSPI pins.
// Note the button pulls the pin *low* when pressed.
bool button_state = (sio_hw->gpio_hi_in & (1u << CS_PIN_INDEX));

#ifdef __ARM_ARCH_6M__ // CM0 for rp2040
#define CS_BIT (1u << 1)
#else // rp2350 (cm33/risv)
#define CS_BIT SIO_GPIO_HI_IN_QSPI_CSN_BITS
#endif
bool button_state = (sio_hw->gpio_hi_in & CS_BIT);

// Need to restore the state of chip select, else we are going to have a
// bad time when we return to code in flash!
Expand Down
Loading