-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
boards: sparkfun: Fix sparkfun_pro_micro_rp2040 gpiomap #69994
Conversation
Hello @ulmanyar, and thank you very much for your first pull request to the Zephyr project! |
87b26c2
to
d2bf895
Compare
Hi, @ulmanyar The pro-micro connector is defined here, zephyr/dts/bindings/gpio/sparkfun-pro-micro-header.yaml Lines 17 to 30 in ad7086a
but from this definition the settings before the change are correct. |
The more I look at this, the more it seems like a game of telephone where inconsistencies propagate and multiply. I would argue that the pro-micro connector definition you linked is incorrect, as I think it should reflect the pins of the original Pro Micro. I will add that to this PR. I also looked at what boards are using this, and it seems it's only the SparkFun Pro Mirco RP2040 that I originally addressed, but also the Adafruit KB2040 so I can add that as well. As a side note: in the naming of the KB2040 pins, they have labeled D0 and D1 as "CircuitPython Name", whereas Sparkfun Pro Micro label them as "Arduino", and I don't know if they are supposed to be 1:1 or not. I have never worked with CircuitPython, but in practice they do not seem to be 1:1 based on: |
d2bf895
to
f363c66
Compare
Any additional feedback on this? This was merged downstream in ZMK but it would be great to be able to use the board from Zephyr directly. |
0 TX0 RAW - | ||
1 RX1 GND - | ||
1 TX0 RAW - | ||
0 RX1 GND - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there's two versions of the number it may be a good idea to make the description here reflect that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment below. I think this is the only variant in Zephyr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, then maybe add a comment after the table here describing that the first two pins are swapped on some boards and that this binding is used for both variants?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realised I could be clearer: This documentation describes the (original) SparkFun Pro Micro header and its corresponding pin numbers. In that original header, the order is 1, 0, GND, ...
Each Pro Micro-compatible board--such as SparkFun Pro Micro RP2040 which n.B. is a different board, or any board that wants to be Pro Micro-compatible--then defines a gpio_map
that maps that board's pinout to the header described here so that shields can be defined using the &pro_micro
pins and seamlessly be used with any Pro Micro-compatible board.
So in my opinion, it does not make sense to add every compatible board in this header description, as they are really not variants, but unique boards with compatible pinouts. I hope this clarifies the confusion I made!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I see what you are saying now, sorry https://cdn.sparkfun.com/assets/e/2/7/6/b/ProMicroRP2040_Graphical_Datasheet.pdf got me really confused about the whole story.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, could you add a link to https://cdn.sparkfun.com/assets/f/d/8/0/d/ProMicro16MHzv2.pdf in this file maybe? Just for convenience, doubt that url will go anywhere anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There, fixed a few minor things (inconsistent use of both Dx/Ay and only Dx, as well as a typo where TX0 became TX0, and RXI became RX1), and added the link. This should be ready for merge now?
I checked some external connector definitions, and this modification seems to work fine. As @fabiobaltieri pointed out, please update the documentation. |
f363c66
to
60ca1b3
Compare
The SparkFun Pro Micro header pins are numbered D1, D0, GND, ... from top left whereas the SparkFun Pro Micro RP2040 and the Adafruit KB2040 boards are using gpio 0, 1, GND, ... , so the pro_micro: connector gpio-map of these boards should reflect that. Graphical Datasheet for SparkFun Pro Micro RP2040: https://cdn.sparkfun.com/assets/e/2/7/6/b/ProMicroRP2040_Graphical_Datasheet.pdf Graphical Datasheet for SparkFun Pro Micro: https://cdn.sparkfun.com/assets/f/d/8/0/d/ProMicro16MHzv2.pdf Pinout of the Adafruit KB2040: https://learn.adafruit.com/assets/106984 Please note that the KB2040 uses CircuitPython pin labels D0, D1 which does not seemt correspond to the Arduino labels D0 and D1 used by the Pro Micro. Signed-off-by: Daniel Irekvist <[email protected]>
60ca1b3
to
68b9b80
Compare
Hi @ulmanyar! To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge. Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁 |
The SparkFun Pro Micro pins are numbered 1, 0, GND, ... from top left whereas the SparkFun Pro Micro RP2040 and the RP2040 Community Edition boards are numbered 0, 1, GND, ... , so the pro_micro: connector gpio-map should reflect that.
Graphical Datasheet for SparkFun Pro Micro RP2040: https://cdn.sparkfun.com/assets/e/2/7/6/b/ProMicroRP2040_Graphical_Datasheet.pdf
Graphical Datasheet for SparkFun Pro Micro:
https://cdn.sparkfun.com/assets/f/d/8/0/d/ProMicro16MHzv2.pdf