Skip to main content
Associate II
March 12, 2026
Solved

OpenBootloader Middleware application on the STM32C0

  • March 12, 2026
  • 1 reply
  • 175 views

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

 

 

Best answer by TDK

I suggest using the Example Selector within STM32CubeMX to choose the OpenBooloader example for the C0 series. It compiles without errors.

Screenshot 2026-03-12 160002.png

 

No doubt you are missing some configuration #defines somewhere.

1 reply

TDK
TDKBest answer
Super User
March 12, 2026

I suggest using the Example Selector within STM32CubeMX to choose the OpenBooloader example for the C0 series. It compiles without errors.

Screenshot 2026-03-12 160002.png

 

No doubt you are missing some configuration #defines somewhere.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate II
March 12, 2026
Internal

Thanks TDK!
Compiled without errors as you said, the code is much smaller, and definitely STM32C0 aware!
Ken