-
Notifications
You must be signed in to change notification settings - Fork 71
fix: compilation on nightly #207
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
Conversation
In RM0385 for example (F74x, F75x) in 32.5.9 it says (emphasis mine):
All data to be written is written into the DR register, and it then goes through a small FIFO inside the SPI peripheral before it gets transmitted. For efficiency, when the SPI peripheral is configured to do 8-bit words, you can write 16 bits to the FIFO and it's treated as two sequential words to transmit. What that means is that performing a |
Thanks! But casting it to *const u32 is also invalid as well, the only way would be to first cast as its own type as *mut T, which...feels a bit annoying It'd be something like |
Ugh, yea, that is a pain. It looks like you could do something like |
that works for me, but that's not great-looking I'll agree, a special note for the relevant spots can be added explaining why that was done |
Is there any open issue for that on stm32-rs? |
Hi @maximeborges, I do not see an open issue for it on stm32-rs but it is true that warnings/errors do pop up when trying to build this project. For example, if I check out the current version and build "cargo build -F stm32f722" I see 3 warnings. Sometimes these warnings are seen as errors, which is confusing. I suppose this merge request is targeting all of those cases. |
The fix in probe-rs/hs-probe-firmware#45 looks rather simple. I wonder if it just hides the compiler error? 🤔 But wouldn't e.g. - &(*USART::ptr()).tdr as *mut stm32f7::Reg<stm32f7::stm32f7x9::usart1::tdr> as *mut u32
+ core::ptr::addr_of_mut!((*USART::ptr()).tdr) as *mut u32 |
Hey, sorry about the delay - I was planning to use core::ptr::addr_of, just rebased as well for the USART changes @adamgreig |
You should probably change that invocation as well: Line 439 in 08e313a
|
Thanks! |
thanks, sorry for the delay :) |
This fixes a bug when casting a *const _ to *mut _ on nightly, it's being phased out as acceptable and is now a hard error 😬
I could be completely wrong in my fix, but the compiler is happy - also, I noticed in spi.rs that the comment about writing 8 bits vs 16 bits mattered - I couldn't find anything about that in any manual for the f769 (board I have) but I could have easily missed something there.
Any feedback is appreciated!