2024-10-15 03:22 AM
Hello,
We are using CubeProgrammer to program firmware code and option bytes using one single HEX file. This sometimes works and sometimes does not. Example:
HEX file Option Bytes programming on STM32G491 works with CubeProgrammer 2.16, but is broken in 2.17 (the updated database file Data_Base/STM32_Prog_DB_0x479.xml broke option bytes support in v2.17).
According to this forum (and my own tests), option bytes programming is not supported on C030 MCUs, but I suspect that it might be solved with an updated Data_Base/STM32_Prog_DB_0x453.xml file(?)
So is there a document that specifies the option bytes HEX file support for the different MCUs, or is option bytes programming working "just by accident" on some MCUs?
I suspect it could work on most MCUs because the integrated boot loader officially supports option bytes flashing.
Regards,
Norbert
2024-10-22 06:46 AM
Hello @unterberg_rtb
Could you please provide the hex file you're using as well as the full PN for STM32G491.
Could you also send the hex for STM32C030, you need to make sure you're programming the actual option bytes address (@0x1FFF7800) and not the flash registry address (@040022000).
Aziz
2024-10-24 10:30 PM
Hi Aziz,
I can not send you the original HEX files due to disclosure reasons, but I will prepare two demo files to demonstrate the issue.
Norbert
2024-11-06 05:33 AM
Sorry, I was not able to duplicate the option bytes flashing issue on version 2.17. However, I came across a new issue with option bytes and the IWDG.
The attached HEX file contains two features: It sets the user option byte IWDG_SW=0 (activates hardware watchdog), and enables the IWDG in software with a quite small periode (Prescaler=IWDG_PRESCALER_4; Reload=99).
After you flash the attached ob-fail.hex file on an STM32G491RET6, CubeProgrammer GUI can no longer erase the chip or update option bytes. The error is "Error: Mass erase operation failed.Please verify flash protection". Tried with 2.16 and 2.17. However, you are still able to erase and update the CPU using the command line interface:
STM32_Programmer_CLI.exe --connect port=SWD index=0 -ob IWDG_SW=1 --erase all
After that, CubeProgrammer GUI becomes functional again.
Norbert
2024-11-11 11:38 PM
Hello Aziz,
Option Bytes Programming still fails on the STM32C011.
Attached you find The HEX file I used. This file contains just the option bytes FLASH segment. When we flash this on out board, the Cube Programmer reports success, but the option bytes did not change. A verify fails.
MCU: STM32C011F6U6
Programmer: STM32CubeProgrammer 2.17.0 (Windows GUI).
Option Bytes set by the HEX: RAM_PARITY_CHECK=0 BOR_EN=1 BORR_LEV=2 BORF_LEV=2
Regards, Norbert