-
Notifications
You must be signed in to change notification settings - Fork 121
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
Support using the built-in UART peripherials of a Raspberry Pi #234
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Together with #238 I was able to read the serial output of my board, so this PR technically works. I've decided to allow USB serial adapters while overwriting RTS/DTR, because why not 😅 |
Example setup:
|
4b088f4
to
5699190
Compare
@jessebraham barring CI failures, I think this PR is ready for review. I've been using this to flash and monitor a device and I'm happy with its stability. |
Awesome, thank you for implementing this! I don't have a Pi handy right now but I have asked @JurajSadel to test this out on some hardware. I will review the code shortly! |
Hello @bugadani! |
|
Also note that I believe the linked circuit is named using low-active RTS/DTR signals. This means that active-high signals need to be connected "backwards", i.e. the |
3af1236
to
2931133
Compare
GitHub really should notify authors if their patches no longer merge.... I've squashed and rebased the PR. |
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.
Thank you for your patience, finally got chance to look through this code today. Overall I think it looks really good, don't have anything noteworthy to say about it. So thanks for making my job easy 😁
I have not tested this on hardware yet, but you've been around these parts long enough that I trust you when you say its working. I'm going to try and wrangle up a Pi this weekend to verify it myself, but if I'm unable to then I will merge this on Monday regardless and we can deal with any issues if they arise.
I ultimately was not able to find my Raspberry Pi this weekend (moved awhile back, it's gotta be in a box somewhere...), so let's just get this merged. I don't plan on releasing for awhile so there will be time to fix issues if they pop up. Unfortunately just need one more rebase (sorry!) and it should be good to go. |
Done - again, github really should ping me when my PR needs a rebase... :( |
Thanks for doing that. I agree, it's kind of annoying having to constantly keep an eye on your PRs like that 😅 |
This PR is heavily in the draft state, especially because
it requires a nightly compiler at its current state andit's currently untested.Raspberry Pis don't have hardware support for DTR, so their internal UART peripherials can't direcly be used in espflash. This PR adds
rppal
to manage two user-configurable GPIOs as RTS/DTR. This requires some platform-specific code, for which I have introduced theInterface
struct (name pending), and a cargo feature calledraspberry
.Some follow up work:
Unknown
serial ports (assuming internal peripherial is covered here)Implementation depends onSee 5a25044 for my solutiontrait_upcasting
because of https://github.com/esp-rs/espflash/pull/234/files#diff-9b8216d416248667f4612fb114829cb89c5754ca818d5784b3b0d879ec0d4ee6R266-R267 but the feature has been proposed to be stabilized in rust-lang/rust#101718 I'm open to suggestions if there is a way to avoid this feature requirement.