Skip to content
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

Son 2159 support C pins #2

Merged
merged 87 commits into from
May 16, 2024
Merged

Son 2159 support C pins #2

merged 87 commits into from
May 16, 2024

Conversation

endresonair
Copy link

No description provided.

Orange-Murker and others added 30 commits April 7, 2023 19:34
430: fix vscode rust-analazer r=richardeoin a=burrbull



Co-authored-by: Andrey Zgarbul <[email protected]>
Added VOS0 support for stm32h7a3/7b3/7b0
Reorder [[example]] targets alphabetically
Remove some unnessesary required features
Tidy documentation in sai_dma_passthru example
romixlab and others added 25 commits December 1, 2023 12:02
Changes to be committed:
	modified:   Cargo.toml
	new file:   examples/blinky-stm32h747i-disco.rs

by Youndong ([email protected])
check code formatting
Add new blinky example using GPIOs on STM32H747i-Disco
rust/#114447 made `&mut MY_STATIC_MUT` a warning, with the intention of
disallowing it entirely in the 2024 edition. We never used this in the crate
itself, but it is used in many examples.

This commit removes these references from the examples. In general the new
approach is to change `static mut` of type `X` to type `MaybeUninit<X>`. These
can then cleanly be accessed with
[`MY_STATIC_MUT.write()`](https://doc.rust-lang.org/core/mem/union.MaybeUninit.html#method.write)
followed by
[`MY_STATIC_MUT.assume_init_mut()`](https://doc.rust-lang.org/core/mem/union.MaybeUninit.html#method.assume_init_mut).

Where we need to cast a `MaybeUninit<[X; N]>` to a `[MaybeUninit<X>; N]` in
order to initialise it element-by-element, the
`&mut *ptr::addr_of_mut!(MY_STATIC_MUT)` construction is still used. After
initialisation, we can then access it with `MY_STATIC_MUT.assume_init_mut()`.

In a few DMA Examples we were taking a reference `&mut TARGET_BUFFER` without
initialising TARGET_BUFFER. This commit changes this to
`TARGET_BUFFER.assume_init_mut()` *without* initialising `TARGET_BUFFER`. This
was and remains UB.

* USB Examples: `static mut EP_MEMORY` now has type `MaybeUninit<[u32; 1024]>`
* Ethernet Examples: `static mut DES_RING` now has type `MaybeUninit<ethernet::DesRing<4, 4>>`
Also remove extra "proto-ipv6" feature that is not needed by examples
`TryFrom` and `TryInto` part of the prelude [since the 2021
edition](https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html). stm32-rs#236
Copy link

@espenalb espenalb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIce!

I assume the merged STM changes are OK, did not review them.

src/adc.rs Outdated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@@ -64,6 +64,10 @@
use core::marker::PhantomData;

use crate::rcc::ResetEnable;
// EB: Todo: If making PR upstream, this should only be include for some boards (see pwr.rs)
use crate::stm32::SYSCFG;
// EB: Todo: If making PR upstream, check which boards has relevant Pxy_C pins and update

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this involves going through the data sheets for all the supported MCUs (there are at least 13) and the package information for each of those (probably 3-5 for each MCU) to see which have these pins (and then add feature flags in the right places), so it is a rather big undertaking...

@endresonair endresonair force-pushed the SON-2159-Support-C-pins2 branch from 65edd72 to 6f13b8f Compare May 15, 2024 18:27
@endresonair endresonair merged commit 1c9cba1 into sonair May 16, 2024
12 of 22 checks passed
@endresonair endresonair deleted the SON-2159-Support-C-pins2 branch May 16, 2024 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.