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
Msp432: DMA-support #2066
Msp432: DMA-support #2066
Conversation
The changes in these files look pretty separate from the DMA stuff. In general, we try to keep PRs focused to make them easier to review. To the extent reasonable, more, smaller PRs are better than big ones. These changes also look like stuff that can/should sail through quickly as they're general platform bugfixes, while the DMA will probably take some time to review. Can you pull these out? |
Yep! |
782180b
to
064029d
Compare
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.
Ack.
I didn't check with the datasheet, but overall this looks good.
I also implemented already an An do you have any recommendations how to test the UART abort-functions? I actually don't really know how to trigger them. |
It should probably be a separate PR. I have no idea how to test it though |
Am I supposed to change something or add any missing features here? Or is it just necessary to wait for some more feedback? (: |
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 is a lot of unsafe
code in this driver. I think that all traces back to the static mut DMA_CONFIG
region. I think it would be more appropriate to model this using the InMemoryRegister
abstraction (see chips/sam4l/src/usbc/mod.rs for an example).
This comes with several advantages:
- It should encapsulate
unsafe
to the single instantiation of the 'register-like' memory, rather than every access. - It will treat the memory accesses as volatile, which in the case of status registers is important since I believe the DMA engine itself can write to the memory addresses
- It will remove all of the manually-authored bit manipulation code in favor of the register abstraction
(sorry for the slow-ish review; summer distractions :) ) |
Ok, thanks for the info! I was actually searching for something like that but I didn't know what I had to look for (: |
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 haven't looked at the datasheet, but I reviewed the unsafe uses and skimmed most of the code and feel reasonably comfortable with it.
Making DMA_CHANNELS
a struct with a handle_interrupt()
method, rather than relying on a global function, might be a little more in line with what we do elsewhere (GPIO_PORT
, etc.), but I am not sure we need to block on that.
dcc10c2
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.
Thanks for iterating on this a few times with us! Really exciting to have DMA on a new platform 👍
Of course, no problem! I'm also very excited to see new features being accepted in the main-tree (: |
bors r+ |
Pull Request Overview
This PR adds DMA-support, which will be used with UART TX and RX and later with SPI, ADC, etc.
This is just a first version where only UART TX is supported.
Testing Strategy
Testing with UART on eval-board
Help Wanted
DMA_CONFIG
struct, I just wanted to make a standard array and no struct, but I didn't find anything to align arrays in rust.TODO
transfer_mem_to_peripheral()
for UART TXtransfer_peripheral_to_mem()
for UART RXtransfer_mem_to_mem()
Documentation Updated
n/a
Formatting
Ran
make ci-nosetup