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


Write option bytes

Hello.

I have been doing some tests and have come to the conclusion that I need to modify the option bytes.

For now I did it on st-link, but it is not feasible to use this method in future.

How do you write to the option bytes?

I did not want to have to do this in the firmware (using the core to write in the flash the values of the option bytes).

I’ve already searched in all files (in the PIC I was all “fuses” in a header file) but I have not found where this is to be done.

Can you help me?

Thank you!

No one writes in the option bytes?

Can no one give more information about how you do this?

Where are the option bytes configured in the project?


Hi.
Did you find an answer to your question? Because I have the exact same and can’t find any solution...

Thank you.

Hello

Unfortunately I did not get any response, and the problem continues...

Maybe there’s more assistance for TruStudio ...


Hello,

Did you solved the problem? I am using stlink and I think it sets the Flash protection on so i have problems afterwards with my bootloader.

How can I set the configuration bytes or fuses in system workbench???

I know that the ST-LINK Utility from ST is capable of editing the Option Bytes.
Option Bytes

In my experience System Workbench is not capable of doing so. Plus System Workbench is not the tool I planned to use in production. Two good reasons to find an other way to flash the Option Bytes: embed them into the binary file.

Here is an extract of my source code:

// 0x 1FFF F800 -> Option Byte 1 (nUSER, USER, nRDP, RDP)
const uint32_t optionbytes1 attribute(( section(“.optionbytes1”) )) = 0x20DF55AA;
// 0x 1FFF F804 -> Option Byte 2 (nData1, Data1, nData0, Data0)
const uint32_t optionbytes2 attribute(( section(“.optionbytes2”) )) = 0x00FF00FF;
// 0x 1FFF F808 -> Option Byte 3 (nWRP1, WRP1, nWRP0, WRP0)
const uint32_t optionbytes3 attribute(( section(“.optionbytes3”) )) = 0x00FF00FF;
// 0x 1FFF F80C -> Option Byte 4 (nWRP3, WRP3, nWRP2, WRP2)
const uint32_t optionbytes4 attribute(( section(“.optionbytes4”) )) = 0x00FF00FF;


Here is an extract of my Linker script:

MEMORY
{
...
FUSES (r) : ORIGIN = 0x1FFFF800, LENGTH = 16 /* Option Bytes (configuration fuses) */
...
}

SECTIONS
{
...
.fuses :
{
. = ALIGN(4);
KEEP(*(.optionbytes1))
KEEP(*(.optionbytes2))
KEEP(*(.optionbytes3))
KEEP(*(.optionbytes4))
. = ALIGN(4);
} >FUSES
...
}


In the end I obtain a binary file that embeds a section relative to the Option Bytes.
Here is an extract of my *.hex file:

:020000041FFFDC
:10F80000AA55DF20FF00FF0000FF00FFFF00FF0000


Doing like that allows you to flash your Option Bytes from System Workbench!


 

Newest Forum Posts

  1. reservation car service Seattle by Jamesprede, 2025-05-01 10:06
  2. Last day: drone bonus by Danielrug, 2025-04-19 16:55
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Insightful Perspectives on This Subject by davidsycle, 2025-03-04 05:45
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  10. Build a project in "release" mode by tang, 2025-02-20 10:36

Last-Modified Blogs