2025-01-27 01:57 PM
I have a project that uses the nBOOT pin for GPIO output and cannot pull it in any direction during POR. Therefore, the nSWBOOT0 bit needs to be programmed to 0 (its default is 1) before the code will function properly.
What is the recommended practice for programming option bits in a production environment?
I can't rely on, e.g., someone digging through menus in CubeProgrammer for each unit.
I could have my code test for the proper bits at startup and program them if needed (the accepted answer to this similar question), but that does not strike me as an ideal solution because:
Is there perhaps some sort of automation available in CubeProgrammer that would require minimal user interaction?
2025-01-27 02:25 PM
Use a script that runs STM32CubeProgrammer CLI to change the option bytes, program the device, and verify in a single statement.