2025-08-25
6:14 PM
- last edited on
2025-08-26
1:56 AM
by
Maxime_MARCHETT
Hello.
I am currently developing a board using the stm32f411ret6 chipset.
I confirmed that the first firmware download worked properly on one of the boards I am developing.
However, after attempting to download the second firmware, I encountered an issue where the option byte was displayed as 0xFF.
I tried changing the option byte in various ways, but all attempts failed.
Furthermore, I attempted to boot using the system bootloader, but it failed. Could the flash memory itself be damaged?
Below is the link to my initial community inquiry.
Thank you
*This post has been translated from Korean to comply with the ST Community guidelines.
2025-09-08 9:40 AM
Hello @MKIM.3 ,
Is this behavior random or systematic ? reproduced on many devices?
Ensure no resets or power interruptions, or other issues occur during the process of update/programming of options bytes, and make sure to follow the correct programming sequence as described in the Reference Manual RM0383:
3.6.2 Programming user option bytes
Modifying user option bytes
To modify the user option value, follow the sequence below:
1. Check that no flash memory operation is ongoing by checking the BSY bit in the FLASH_SR register
2. Write the desired option value in the FLASH_OPTCR register.
3. Set the option start bit (OPTSTRT) in the FLASH_OPTCR register
4. Wait for the BSY bit to be cleared.
Note: The value of an option is automatically modified by first erasing the user configuration sector and then programming all the option bytes with the values contained in the FLASH_OPTCR register.
2025-09-08 7:06 PM
What did the first firmware do? Did it modify the Option Bytes?
Can you Mass Erase the part?
Check the voltages and capacitors placed on VCAP pins.
2025-09-08 11:04 PM
Hi.
Please refer below answers.
What did the first firmware do?
(A) It simply controls the UART, LED, BUTTONS and FND devices.
Did it modify the Option Bytes?
(A) No. it didn't
Can you Mass Erase the part?
(A) I could not erase the flash area with mass or any options.
Check the voltages and capacitors placed on VCAP pins.
(A) the voltages and VCAP are fine. I think these are not problems
2025-09-09 12:14 AM
Hi,
I executed the below commands with Open On-Chip Debugger.
(1) Check that no flash memory operation (OK)
> mdw 0x40023c0c
0x40023c0c: 00000000
(2) Write Flash CR Key1, Key2 (OK)
> mww 0x40023C08 0x08192A3B (FLASH CR KEY1 : 0x45670123)
> mww 0x40023C08 0x4C5D6E7F (FLASH CR KEY2 : 0xCDEF89AB)
(3) Write the desired option value in the FLASH_OPTCR register. (OK)
> mww 0x40023C14 0x0FFFAAEC
> mdw 0x40023C14
0x40023c14: 0fffaaec
(4) Set the option start bit (OPTSTRT) in the FLASH_OPTCR register and Wait for the BSY bit to be cleared (OK)
> mww 0x40023C14 0x0FFFAAEE
waiting for a minutes ...
> mdw 0x40023c0c
0x40023c0c: 00000000
> mdw 0x40023C14
0x40023c14: 8fffffec
(5) Read FLASH_OPTCR after reset
> reset
Unable to match requested speed 2000 kHz, using 1800 kHz Unable to match requested speed 2000 kHz, using 1800 kHz [stm32f4x.cpu] clearing lockup after double fault [stm32f4x.cpu] halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc [stm32f4x.cpu] Polling failed, trying to reexamine [stm32f4x.cpu] Cortex-M4 r0p1 processor detected [stm32f4x.cpu] target has 6 breakpoints, 4 watchpoints [stm32f4x.cpu] Examination succeed
> mdw 0x40023C14
0x40023c14: 8fffffed
(6) Read FLASH_OPTCR after power off/on
Open On-Chip Debugger
> mdw 0x40023C14
0x40023c14: 8fffefed
After all that, the option byte has still the broken value (0xff)
Regards,
ms