-
Notifications
You must be signed in to change notification settings - Fork 8.1k
drivers: STM32 async flash erase and write #93173
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
base: main
Are you sure you want to change the base?
Conversation
|
Hello @jpowen898, and thank you very much for your first pull request to the Zephyr project! |
c34e153 to
ae67109
Compare
|
@nordicjm Thanks for the feedback. I made all the requested changes, let me know if there is anything else. |
030ad53 to
df9a4f8
Compare
9129568 to
b5d3812
Compare
|
I just did some testing with this on the stm32h743 and it is failing to erase the correct sectors because of this issue #93714 where the flash size is being calculated incorrectly (4MB when it should be 2MB) and caused the |
caed1f4 to
7157818
Compare
2fcb9cc to
5f8a446
Compare
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.
Check also the few comments posted by CI compliance checks bot.
3a8c216 to
d018bc6
Compare
Added optional use of the stm32 hal async flash write and erase capabilities on the l4, f4, and h7 soc families. It is implemented using semaphores to allow for other threads to take action during the erase/write actions. This feature is disabled by default and can be optionally enabled using the FLASH_STM32_ASYNC config option. Signed-off-by: Parker Owen <[email protected]>
|
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.
Minor issues, otherwise LGTM.
| #else /* CONFIG_FLASH_STM32_ASYNC */ | ||
|
|
||
| int rc; | ||
| uint32_t tmp; |
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.
tmp is already defined at function entry.
| #endif /* CONTROL_DCACHE */ | ||
|
|
||
| return rc; | ||
| #endif /* !CONFIG_FLASH_STM32_ASYNC */ |
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.
Prefer:
| #endif /* !CONFIG_FLASH_STM32_ASYNC */ | |
| #endif /* CONFIG_FLASH_STM32_ASYNC */ |
Ditto at a few other places.



HAL_FLASHEx_Erase_IT()andHAL_FLASH_Program_IT()functions with their associated interrupt handler.FLASH_STM32_ASYNCconfig option.