cancel
Showing results for 
Search instead for 
Did you mean: 

OpenBootloader Middleware application on the STM32C0

microcoder
Associate III

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

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".

View solution in original post

2 REPLIES 2
TDK
Super User

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".
Internal

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