Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


Preferred way to set Option Bytes?

I’m pretty new to SW4STM32 / openocd in general.

I need to configure the option bytes of my STM32F042C6, but I’m wondering about what the best way is.

It’s flash memory, so I see two options:
1. Use the flash HAL and change them in firmware.
2. Add another section to the linker script and try to flash it with the rest of the code.

Is there something built into SW4STM32 that I could use instead?

Ultimately I’m trying to disable the built-in bootloader, but being able to change the option bytes seems important too.

Thanks in advance for any advice.

Hi,

Have you managed to solve your problem ?
Is there a way to declare the option byte value in C code, in order that it will be flashed along with the program ?

Thanks for your reply

Thomas


Unfortunately not directly. I’ve used the ST-Link Utility to set it on my development boards.Then I’ve switched to a completely IDE-free workflow, since it didn’t really help with development.

To define the option bytes in C code, you can use a section attribute to place it in a special section, then put that section at the address of option in the linker script. I think I’ve had some problems with openocd when trying this, but I can’t remenber exactly.