Skip to main content
msemegen
Associate III
January 25, 2023
Solved

STM32WB + option bytes setting

Hi,

For stm32wb flash operations we have to implement diagram described in AN5289, page 36. How about option bytes access? Do we have apply the same approach, with semaphores etc? Or we just can use regular HAL functions?

Best,

Mateusz

This topic has been closed for replies.
Remi QUINTIN
Remi QUINTINBest answer
ST Technical Moderator
January 25, 2023

Please have a look at chapter 3.4.2 Option bytes programming of the register manual.

4 replies

Remi QUINTIN
Remi QUINTINBest answer
ST Technical Moderator
January 25, 2023

Please have a look at chapter 3.4.2 Option bytes programming of the register manual.

msemegen
msemegenAuthor
Associate III
January 25, 2023

"In a multi-CPU system it is good practice to use semaphores to manage option programming, and prevent simultaneous option programming by the CPUs."

Which semaphore can be used? Sem2 ("FLASH - All registers")?

Best,

Mateusz

Remi QUINTIN
ST Technical Moderator
January 25, 2023

Indeed, you can use the semaphore protecting the flash access as any writing to an option byte shall be considered as a flash access. Now please be careful to release this semaphore as soon as the flash access is done. This is key as CPU2 is also requesting this semaphore each time it needs to save values in the flash memory.

msemegen
msemegenAuthor
Associate III
January 25, 2023

Great,

​

Thank you for answer!

​

Best,

Mateusz ​