Skip to content

Add ACR, KEYR, OPTKEYR, and CR definitions for STM32F401 FLASH #374

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 2 commits into from
May 2, 2020

Conversation

yusefkarim
Copy link
Contributor

Hi, I have added several FLASH register definitions, which I have tested on my STM32F401. This is my first time trying to add something to a PAC, please let me know if I have done anything incorrectly. I am also not sure if the peripheral .yaml file I created applies to all F4 boards, the name may need to be changed if not.

If this is accepted and there is value in adding all the registers definitions for FLASH, please let me know and I wouldn't mind reading the datasheet and adding them for everyone.

Thanks.

@adamgreig
Copy link
Member

Hi, thanks for the PR!

I think most of these registers are already documented by flash_v1.yaml which is included in STM32F405 and F407 but apparently not in F401. Sorry that this wasn't easier to find! Maybe you could see if there's any difference between your new flash_f4 and the existing flash_v1 and then include flash_v1 on the F401?

@yusefkarim
Copy link
Contributor Author

Yikes, the file I made is almost identical to flash_v1. Thank you for taking the time to point that out. I will make sure to check similar devices when updating mine in the future!

I have pushed an update removing the flash_f4 file and including flash_v1 instead.

Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

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

Thanks, and sorry you spent the time making your version!

bors r+

@bors
Copy link
Contributor

bors bot commented May 2, 2020

Build succeeded:

@bors bors bot merged commit e52e688 into stm32-rs:master May 2, 2020
@yusefkarim yusefkarim deleted the stm32f4-flash branch May 2, 2020 13:33
bors bot added a commit that referenced this pull request Apr 8, 2021
533: STM32F446: FLASH description, RCC.PLLCFGR.PLLR r=adamgreig a=cyberillithid

So I almost made the same mistake as #374, but actually managed to notice that before starting a pull request, so here I just included the [flash_v1.yaml](https://github.com/stm32-rs/stm32-rs/blob/master/peripherals/flash/flash_v1.yaml) to the f446 device file.
(Apparently, the decision was made not to fiddle with `_read/_write` for 'write 1 to reset' in the library, so I abstained from including that for the FLASH.SR bits)
Moreover, SVD apparently missed PLLR field for some reason, so I based that fix on the similar solution from the f412 patch.

Co-authored-by: Cyber Illithid <cyberillithid@gmail.com>
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.

2 participants