Not Detecting BOOTSEL Presses on Adafruit Feather RP2040

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Fraubush
 
Posts: 8
Joined: Fri May 12, 2023 11:39 pm

Not Detecting BOOTSEL Presses on Adafruit Feather RP2040

Post by Fraubush »

Hey there!

I'm working on a project using the Adafruit Feather RP2040 and I'm having trouble detecting presses on the BOOTSEL button (which documentation says is also connected to GPIO4). The ultimate goal is to use this button to switch between different lighting patterns on a strip of Dotstar LEDs.

The Feather RP2040 is connected to the LEDs via the SCK and MO pins, and I have successfully run several scripts controlling the LED patterns using the FancyLED library. The BOOTSEL button is functioning as I've used it to enter bootloader mode to load CircuitPython on the board, but when I attempt to use it in any code, I don't see the expected responses.

To troubleshoot, I used this script to try print a message to the serial monitor whenever the BOOTSEL button is pressed or released:

Code: Select all

import board
import digitalio
import time

button = digitalio.DigitalInOut(board.D4)
button.switch_to_input(pull=digitalio.Pull.UP)

while True:
    if not button.value:  # button is pressed
        print("Button pressed!")
        time.sleep(0.1)  # debounce delay
But when I open the serial monitor in the Mu Editor and press the BOOTSEL button, I don't see any printouts. I'm somewhat new to this, but I've checked my connections and code several times and can't see what might be causing the issue.

Any help or suggestions would be greatly appreciated! Thanks in advance!

-Tim

User avatar
westfw
 
Posts: 2010
Joined: Fri Apr 27, 2007 1:01 pm

Re: Not Detecting BOOTSEL Presses on Adafruit Feather RP2040

Post by westfw »

the BOOTSEL button (which documentation says is also connected to GPIO4)
What documentation is that? Normally the BOOT button on a rp2040 is connected to the SS pin of the QSPI flash, which is in a separate port from the normal GPIO and isn't accessible by normal code (because it's using that pin to access code from the QSPI Flash chip.)

User avatar
Fraubush
 
Posts: 8
Joined: Fri May 12, 2023 11:39 pm

Re: Not Detecting BOOTSEL Presses on Adafruit Feather RP2040

Post by Fraubush »

Hey, thanks for the response. I thought that's what this was saying on an Adafruit Learn page about the Feather RP2040's pinout.
The Feather RP2040 has two buttons.

The BOOTSEL button is connected to GPIO4 for use in your code. It is also used to enter the bootloader. To enter the bootloader, press and hold BOOTSEL and then power up the board (either by plugging it into USB or pressing RESET). The bootloader is used to install/update CircuitPython
Am I misunderstanding something?

User avatar
neradoc
 
Posts: 542
Joined: Wed Apr 27, 2016 2:38 pm

Re: Not Detecting BOOTSEL Presses on Adafruit Feather RP2040

Post by neradoc »

No, you are perfectly correct, note however that only the revised model of the Feather RP2040 has the BOOT button connected to GP4. It's the one where the boot button is horizontal at the end, instead of vertical (like the reset button). See picture on the product page: https://www.adafruit.com/product/4884

If you have the new revision, try using microcontroller.pin.GPIO4 instead or board.D4 (which is GPIO6).
I'll check but it seems that the button pin is not yet referenced in the board module.

User avatar
westfw
 
Posts: 2010
Joined: Fri Apr 27, 2007 1:01 pm

Re: Not Detecting BOOTSEL Presses on Adafruit Feather RP2040

Post by westfw »

only the revised model of the Feather RP2040 has the BOOT button connected to GP4.
Ah. I had checked the schematic before I sent my early reply, but it was the schematic of the older version of the feather. I apologize for the resulting misinformation.

User avatar
Fraubush
 
Posts: 8
Joined: Fri May 12, 2023 11:39 pm

Re: Not Detecting BOOTSEL Presses on Adafruit Feather RP2040

Post by Fraubush »

Solved! Thanks, neradoc. I do have the newer boards and using the microcontroller library instead of board along with microcontroller.pin.GPIO4 for the button did the trick. Now I'm jumping through LED patterns with the Bootsel which was my goal.

I've only worked with the Arduino IDE and an ancient Uno board before ordering this chip and checking out CircuitPython. This is a whole lotta fun! Thanks again!

User avatar
danhalbert
 
Posts: 4688
Joined: Tue Aug 08, 2017 12:37 pm

Re: Not Detecting BOOTSEL Presses on Adafruit Feather RP2040

Post by danhalbert »

Thanks to Neradoc, this will be fixed in CircuitPython 8.1.0: https://github.com/adafruit/circuitpython/pull/7988

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”