Topic : Linker Settings

Forum : ST7/STM8

Original Post
Post Information Post
October 23, 2012 - 5:00pm
Guest

Hi,

I have the low density STM8S with 8KB.
Until now I was working with two separate projects(STVD terminology) for boot and application code.
Now that I am running out of code space, I decided to reuse code between bootloader and application.
Hence I cannot anymore have two separate projects.
So using a single project I want to restrict regions for boot and application codes.

I have learnt that I can use relocation directives (CODE) to set the start address for a group of functions something on the following lines:
CODE(%\?PR\?\?.*BOOT_MAIN(08080h))
CODE(%\?PR\?\?.*APPL_MAIN(09200h))

But this way it is possible that boot-code related functions may run into application region.
In the situation I am in,
Can I really restrict the boot and application regions? May be there is some directive that I missed out?
Or
Should I only make manual checks to make sure that boot and appl functions are properly located in their regions?

Thanks and Regards,
Pradeep

PS: Thing is that I want to have IAP possibility for the region 0x9200 to 0x9fff. I understand that with single stvd project I will have only one output hex file. So for IAP, I thought I will extract the hex code in the region 0x9200 to 0x9fff from the generated hex file using a script file.
.
.

Replies
Post Information Post
+1
0
-1
October 24, 2012 - 9:59am
Raisonance Support Team

Hi Pradeep,

You're using the proper directive. You can aggregate all application/boot functions using the CODE directive
CODE(%\?PR\?\?.*BOOT_MAIN(08080h),?PR??FOO?FILE1,?PR??ANY?FILE2)
CODE(%\?PR\?\?.*APPL_MAIN(09200h),?PR??APP?APP1)

But yes, there isn't any "magic" directive, you have to manual check all functions.

Otherwise, you're right, one project means one executable, so you'll have to 'cut' the .hex file.

Stéphane

+1
0
-1
October 25, 2012 - 2:12pm
Guest

thank you Stéphane.

+1
0
-1
October 25, 2012 - 2:21pm
Raisonance Support Team

To cut your hex file into piece, you can use the command-line copyhex.exe utility provided with Ride7.
The help is available when launched without parameter.

Regards,

Stéphane