Skip to content

Add board definition for Adafruit Feather RP2040 Adalogger #2524

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

Merged
merged 2 commits into from
Jun 18, 2025

Conversation

b4shful
Copy link

@b4shful b4shful commented Jun 14, 2025

Fixes #2522

Based off of the existing Adafruit Feather RP2040 header (adafruit_feather_rp2040.h)

The only changes made from the regular Feather RP2040 board header are:

  • Change NeoPixel/WS2812 pin PICO_DEFAULT_WS2812_PIN from 16 to 17

  • Add defs for SD card pins (see SD section in header).

Note on SD card pin defs:

I followed the conventions used for other boards with SD card pins defined, although none of the other boards I looked at had the SD "Card Detect" pin mapped so I named its pin PICO_SD_CARD_DETECT_PIN.

I think this should be all that is needed to provide minimal support for Pico SDK on this board variant, but please do let me know if I'm missing something.

@b4shful
Copy link
Author

b4shful commented Jun 14, 2025

I realised that PICO_DEFAULT_SPI is currently set to 0. However this is the SPI peripheral Adafruit specifies is used for the SD card.

SPI1 is unused by default and corresponds to the MOSI/MISO/SCK silkscreen labels on the Feather RP2040 Adalogger, so perhaps I should have defined PICO_DEFAULT_SPI as 1 instead?

@b4shful b4shful marked this pull request as draft June 14, 2025 22:11
@b4shful
Copy link
Author

b4shful commented Jun 14, 2025

Sorry, got a bit confused there.

The default SPI instance and pins from the original Feather RP2040 header file are what the Adalogger board uses for the SD card. So I will need to edit the PICO_DEFAULT_SPI defs to instead use SPI1 and the correct pins for this as silkscreened on the board.

@lurch lurch self-assigned this Jun 16, 2025
@b4shful
Copy link
Author

b4shful commented Jun 16, 2025

Sorry, got a bit confused there.

The default SPI instance and pins from the original Feather RP2040 header file are what the Adalogger board uses for the SD card. So I will need to edit the PICO_DEFAULT_SPI defs to instead use SPI1 and the correct pins for this as silkscreened on the board.

Committed the required edits for this.

As a note, the macros PICO_DEFAULT_SPI_TX_PIN and PICO_DEFAULT_SPI_RX_PIN seem confusingly named as TX and RX could be the complete opposite depending on the role the SPI peripheral is configured in.

I set TX to the pin silkscreened on the board as MOSI, and RX for the silkscreened MISO, should be correct.

@lurch
Copy link
Contributor

lurch commented Jun 16, 2025

Committed the required edits for this.

Based on that, I'll mark this as ready for review.

As a note, the macros PICO_DEFAULT_SPI_TX_PIN and PICO_DEFAULT_SPI_RX_PIN seem confusingly named as TX and RX could be the complete opposite depending on the role the SPI peripheral is configured in.

Yup, see section 4.4.3.15 of https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf

@lurch lurch marked this pull request as ready for review June 16, 2025 21:18
@lurch lurch mentioned this pull request Jun 17, 2025
@kilograham kilograham merged commit 7d58f95 into raspberrypi:develop Jun 18, 2025
@kilograham kilograham added this to the 2.1.2 milestone Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants