2026-03-12 12:19 PM
Greetings,
I am in the process of integrating the OpenBootloader Middleware application onto a STM32C011 device.
I got the code from the STM32Cube/Repository/STM32Cube_FW_C0_V1.4.0/Middlewares directory
I have the code in an STM32CubeIDE project, and it is not compiling?
For example:
The C file, Interfaces/Patterns/OPTION BYTES/optionbytes_interface.c, has code to write to a
FLASH control register.
WRITE_REG(FLASH->PCROP2ASR, (*(Data + 56) | (*(Data + 57) << 8)));
Yes, the STM32C0 has not such field name PCROP2ASR in the FLASH_TypeDef structure?
../OpenBootloader/Interfaces/Patterns/OPTION BYTES/optionbytes_interface.c: In function 'OPENBL_OB_Write':
../OpenBootloader/Interfaces/Patterns/OPTION BYTES/optionbytes_interface.c:162:22: error: 'FLASH_TypeDef' has no member named 'PCROP2ASR'; did you mean 'PCROP1ASR'?
162 | WRITE_REG(FLASH->PCROP2ASR, (*(Data + 56) | (*(Data + 57) << 8)));
| ^~~~~~~~~
How can this be?
Thanks
Ken
Solved! Go to Solution.
2026-03-12 1:00 PM - edited 2026-03-12 1:01 PM
I suggest using the Example Selector within STM32CubeMX to choose the OpenBooloader example for the C0 series. It compiles without errors.
No doubt you are missing some configuration #defines somewhere.
2026-03-12 1:00 PM - edited 2026-03-12 1:01 PM
I suggest using the Example Selector within STM32CubeMX to choose the OpenBooloader example for the C0 series. It compiles without errors.
No doubt you are missing some configuration #defines somewhere.
2026-03-12 1:30 PM