cancel
Showing results for 
Search instead for 
Did you mean: 

how to create one project and create bootloader and application respectively using compile option

joseph05
Associate III

There are a bootloader project and an application project to operate the device.
I am using it by compiling the bootloader project and creating a bootloader file.
I am using it by compiling the application project and creating an application file.


Currently, these two projects are using the same .ioc file.

The main.c file is used differently in the bootloader project and the application project.

 

I would like to know how to create one project and create bootloader and application respectively according to compilation options.

Below is the address area used by the bootloader and application software.

1. Bootloader software
1) FLASH Start address: 0x0800 0000, End address: 0x081f ffff
2) RAM Start address: 0x2000 0000, End address: 0x2002 ffff


2.Application software
1) FLASH Start address: 0x0802 0000, End address: 0x081f ffff
2) RAM Start address: 0x2000 0000, End address: 0x2002 ffff

6 REPLIES 6
Radosław
Senior II

I'm strongly advise against creating one project for bootlader and aplication. I same reason one *ioc. isn't recomended.

Only nested project can bond them together.

 

 

 

 

 

 

In Keil there's a Multi Project Workspace, can select different subset of files, options, include paths, defines, etc.

 

Whilst I can see some appeal, loaders usually iterate at much slower rates than applications

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
joseph05
Associate III

I would like to know if there is a way to separately configure the bootloader function and application function code in the main.c file in one project in STM32CubeIDE and build it according to the purpose using compilation options.

Explain why You wanna do this?

I have to do a static analysis of the software used in the project, but if there are two project as it is now, I have to do static analysis of both. These two projects have a lot of common software, so things overlap, so if make them into one project, I can do a static analysis only for one project.

You can #ifdef anythink = your choice. Try ask specific problem. This multi config project is normal think in many IDE (KEIL multitarget, IDE buil configs ...)