-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers: flash: stm32g0: Implement APIs for option bytes and RDP #93159
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
drivers: flash: stm32g0: Implement APIs for option bytes and RDP #93159
Conversation
Implementation based on STM32G4 series. This is a preparation to enable reading and writing the RDP bits. Signed-off-by: Martin Jäger <[email protected]>
Allows to set readout protection bits for this series at runtime. Signed-off-by: Martin Jäger <[email protected]>
|
| } | ||
|
|
||
| /* Force the option byte loading */ | ||
| regs->CR |= FLASH_CR_OBL_LAUNCH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may need to be adjusted based on the outcome of #91945.
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for this late review
| FLASH_TypeDef *regs = FLASH_STM32_REGS(dev); | ||
| int rc; | ||
|
|
||
| if (regs->CR & FLASH_CR_OPTLOCK) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be if (regs->CR & FLASH_CR_OPTLOCK != 0) (despite other STM32 drivers don't do this).
Non-blocking comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0U if we wanted to be pedantic 😉 (And I'd add parentheses to ensure no ambiguity about order of evaluation)



Tested with STM32G030 microcontroller.