cancel
Showing results for 
Search instead for 
Did you mean: 

Project does not start at specified address

shank
Associate III

Hello.

I am using STM32C031.
I have set up two projects to be one .bin file based on the attached document.
This time I want to output a .bin file for the boot program (addresses: 0x08000000~0x08003FFF) and the application program (addresses: 0x08004000~0x0800FFFFF), but I cannot. As soon as the boot program is finished, the application program data is included without waiting for 0x08004000. (The boot program ends at 0x080027F0 and the application program starts at 0x080027F4).

What settings should I add to make it write correctly?

Best Regards,

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

Sorry, not quite sure why this does not work for you. Try to ask IAR support or on Stack Overflow.

The way of combining bootloader and "main application" in one image isn't quite clear. I prefer to build both images separately and combine with a script. If you build both programs together, for example,  how can you separate the vector arrays? C library modules?

View solution in original post

4 REPLIES 4
Pavel A.
Evangelist III

the application program data is included without waiting for 0x08004000

I'm afraid I haven't understood the PDF fully ))

Does your problem occur without debugger?

In IAR the debugger by default after target restart moves to the start of the "main" app (or what it thinks is the main app). So if you want to always execute the bootloader, you need to specify the start address in settings.

 

 

Pavel.A Thank you for your response.

The problem occurs even without the debugger.

I was thinking that writing “place at address mem:0x08000000 { section .bootloader };” in the .icf on page 4 of the PDF is setting the starting address, but is this wrong?

Also, when I checked the program in the zip file that can be downloaded from the PDF, I confirmed that the boot program is properly placed at the beginning of the two programs in the file LCD.map.

 

*******************************************************************************
*** PLACEMENT SUMMARY
***

"A0":  place at address 0x800'0000 { section .bootloader };
"A1":  place at address 0x800'1000 { ro section .intvec };
"P1":  place in [from 0x800'1000 to 0x80f'ffff] { ro };
define block CSTACK with size = 1K, alignment = 8 { };
define block HEAP with size = 512, alignment = 8 { };
"P2":  place in [from 0x2000'0000 to 0x2002'0000] {
          rw, block CSTACK, block HEAP };
initialize by copy { rw };

 

 

↑As you can see, “A0” 0x08000000~ is the boot loader and “A1” 0x08001000~ is the application program.
In addition, the application program is set to 0x08001000~ in “P1”.

 

However, we confirmed that A0 and A1 are not separated in the program we created and cannot be operated as desired.

 

*******************************************************************************
*** PLACEMENT SUMMARY
***

"A0":  place at address 0x800'0000 { ro section .intvec };
"P1":  place in [from 0x800'0000 to 0x800'7fff] { ro };
define block CSTACK with size = 1K, alignment = 8 { };
define block PROC_STACK with size = 0, alignment = 8 { };
define block HEAP with size = 2K, alignment = 8 { };
"P2":  place in [from 0x2000'0000 to 0x2000'2fff] {
          rw, block CSTACK, block PROC_STACK, block HEAP };
initialize by copy { rw };

 

↑up “A0”0x08000000~ is not set as a boot loader.
Also, “P1” is 0x08000000~ and is not set. However, 0x08007fff is what I set.

Do you know how to set it up like this LCD.map?

Pavel A.
Evangelist III

Sorry, not quite sure why this does not work for you. Try to ask IAR support or on Stack Overflow.

The way of combining bootloader and "main application" in one image isn't quite clear. I prefer to build both images separately and combine with a script. If you build both programs together, for example,  how can you separate the vector arrays? C library modules?

I asked IAR support as you suggested and they resolved the issue.
It seems that I had made a mistake in one linker file setting.
Thank you for your help in resolving this issue.