Skip to content

Rust support for stm32u5 #744

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

Merged
merged 6 commits into from
Jan 28, 2023
Merged

Rust support for stm32u5 #744

merged 6 commits into from
Jan 28, 2023

Conversation

Urhengulas
Copy link
Contributor

@Urhengulas Urhengulas commented Jun 28, 2022

This PR follows the steps in the README, section "adding-new-devices" in order to add support for the STM32U575 (and STM32U585).

First step of #504.

@github-actions
Copy link

Memory map comparison

@Urhengulas
Copy link
Contributor Author

Urhengulas commented Jun 28, 2022

Although I specified a stm32u575 and a stm32u585 feature in makecrates.py, the generated crate only has a stm32u5 features.

makecrates.py:

CRATE_DOC_FEATURES = {
    # ...
    "stm32u5": ["rt", "stm32u575", "stm32u585"],
}

stm32u5/Cargo.toml

[features]
default = ["rt"]
rt = ["cortex-m-rt/device"]
stm32u5 = []

Is this correct / okay? Or should I change something about it?
cc @adamgreig

@github-actions
Copy link

Memory map comparison

@Urhengulas
Copy link
Contributor Author

I got it to generate the two device features stm32u575 and stm32u585 by duplicating the YAML patch file. I am not sure if this is correct, but hopefully someone knowledgeable can take a look. As far as I can see the PR is ready for review now 😄

@Urhengulas Urhengulas marked this pull request as ready for review August 26, 2022 15:11
@Urhengulas
Copy link
Contributor Author

I am still unsure how I can test if the generated PAC actually works. I do have the board at home. Is there some basic example I can run to test this PR?

@newAM
Copy link
Member

newAM commented Aug 28, 2022

I am still unsure how I can test if the generated PAC actually works. I do have the board at home. Is there some basic example I can run to test this PR?

Typically I do make form -j 32 then try to compile the PAC in a binary, using stm32u5.path = "/home/me/stm32-rs/stm32u5" in Cargo.toml.

For a basic example try enabling the GPIO clock in RCC, setting a GPIO as an output, then blinking it.

@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

@burrbull
Copy link
Member

Please, don't break history. Rebase. No merge in PR.

@Urhengulas
Copy link
Contributor Author

Urhengulas commented Nov 28, 2022

@burrbull said:

Please, don't break history. Rebase. No merge in PR.

Okay. I just used the "resolve conflict" button from GitHub.

@potentialdiffer
Copy link

Hello together,
what is the status of this? @Urhengulas can you rebase your branch?
Kind regards!

@github-actions
Copy link

Memory map comparison

@Urhengulas
Copy link
Contributor Author

Urhengulas commented Jan 27, 2023

Hello together, what is the status of this? @Urhengulas can you rebase your branch? Kind regards!

Just did

Copy link
Member

@newAM newAM left a comment

Choose a reason for hiding this comment

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

Everything builds, sha256 for the SVD matches with the latest from ST (07a14ac0257ab7304f282186b4db346e853f14c96e5ae9f653d557e353ac63e7 for the 2023-01-19 release), looks good to me, thanks!

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 28, 2023

Build succeeded:

@bors bors bot merged commit 0199391 into stm32-rs:master Jan 28, 2023
@Urhengulas Urhengulas deleted the stm32u5 branch January 29, 2023 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants