Specify option bits in source code file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-21 10:22 AM
I am about to release firmware to production and would like to include the proper options bits in the firmware so that production can simply program the .elf file at the same time as updating the option bits. I realize that there are several option bits that have to changed on a new MCU before my firmware will work. But maybe the option bits would automatically get programmed first.
What is recommended way to handle initial programming of an MCU?
Solved! Go to Solution.
- Labels:
-
STM32G4 series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-21 12:52 PM
You can set option bytes and program the ELF in one go using the stm32cubeprogrammer CLI.
There's no way to tie them into your ELF directly, as far as I know.
You can check/set them within your program at startup, which has the same effect as long as the program gets run. Depends which option bytes you need, in particular.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-21 12:52 PM
You can set option bytes and program the ELF in one go using the stm32cubeprogrammer CLI.
There's no way to tie them into your ELF directly, as far as I know.
You can check/set them within your program at startup, which has the same effect as long as the program gets run. Depends which option bytes you need, in particular.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-21 01:37 PM
My code requires use of the entire flash and the default option bits only allow 1/2 to be used, so I need to program the fuses before programming the code. Is that possible from the stm32cubeprogrammer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-21 01:42 PM
What chip are you using and what option byte needs set in order to use all of the flash? Only thing I can think of is STM32WB but there's good reason you can't use all of the flash there.
> Is that possible from the stm32cubeprogrammer?
Yes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-21 01:51 PM - edited ‎2023-11-21 01:56 PM
I am using the STM32G474RBT3. It has 128kB of flash. To allow my firmware to run, the DBANK and DFB2 option bits must be unchecked.
