Implement coprocessor access instructions#531
Implement coprocessor access instructions#531spcan wants to merge 9 commits intorust-embedded:masterfrom
Conversation
|
CI tests:
|
adamgreig
left a comment
There was a problem hiding this comment.
Thanks for the RP! What's the longer term plan, since these methods are all pub(crate)? Do you imagine adding further coprocessor-related functionality in cortex-m? Should the methods be publicly available?
|
The aim of these is to expose a common method to interact through the ARM coprocessor interface. Separate libs can then implement the coprocessor driver's using these functions. For example, I'm using it currently to interact with the LPC55S69 math coprocessor |
|
If you want separate libs to later use these functions, don't they need to be |
|
Yeah, good catch, that was there on the test library, forgot to remove it |
|
Ok, it's now failing to compile because const ASM operands are unstable, needing This is getting stabilized soon as per #93332 |
Likely in rust 1.82.0. |
|
Hello With the stabilization of Rust 1.82 Additionally, with the release of the new RP2350 chip, there is now another mainstream processor with coprocessors, which adds some necessity to the access to coprocessor instructions. I would like some input from somebody in the team of how to proceed at this point, if I should close this PR and open a new one, keep this PR or maybe spin this functionality into a different crate. Many thanks |
The rp2350-hal uses inline assembler to make use of the instructions. Nicer APIs would be better though. |
|
I don't think we can raise the MSRV up to 1.82 - this crate is very widely used. |
|
Why all the function docs start with: |
|
I think we should put these behind a feature flag, and note that enabling the feature will raise the MSRV. I also wonder if the functions should be unsafe - can UB be introduced by calling these functions? I suspect so. |
|
Updated all docs on the functions, added information on the meaning of the constants for the functions. @jonathanpallant This is a low level function for coprocessors, they can introduce UB in the coprocessors, but it's on the libraries / drivers for those coprocessors who should check that. On @thalesfragoso Updated all documentation. |
|
We talked about this one in the meeting. We think the API should be I'm also going to raise the MSRV on the cortex-m library, but I haven't yet decided if I'm going to raise it as high as 1.82. If we don't, the functions will need to go behind a feature flag. |
Implements coprocessor basic access instructions (MCR, MRC, MCRR, MRRC) that compile to a single instruction under
--releaseprofiles