.icf Linker script for Example Application XMC1000-SW Update using ASC

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
I have tried the example Dave4 applicaiton example for updating an XMC1000 using ASC ( https://www.infineon.com/dgdl/Infineon-AP32337-XMC1000-software-update-XMC1000-using-ASC-example-cod... )
It works quite well, using all applications in Dave.
The Blinky2 Application from this example starts from Flash Address 0x10008000 ( Default: 0x10001000 )
I tried now to implement the Blinky2 Applicaiton in IAR Workbench. I can debug it from IAR and i also receive interrupts and so on.
But as soon i call the application via the Bootstrap application via
	__asm
(
"LDR r0, =0x10008001\n"
"BLX r0"
);

then the program will go into the default handler.
I am not sure, if i have to change something else in the .icf linker script file, or just have to call the application from a different start point ?
Or maybe the startup_XMC1x00.S file has to be changed from the default one?
My .icf file is the same as the standard icf file for XMC1200, just with different start and end addresses:
define symbol __ICFEDIT_intvec_start__ = 0x10008000;
define symbol __ICFEDIT_region_ROM_start__ = 0x10008000;
define symbol __ICFEDIT_region_ROM_end__ = 0x1002AFFF;

the startup_XMC1200.S file i did not modify from the standard one.

The binaries of the Blinky2 application from DAVE4 and from IAR are quite different. But i guess this is normal.

The .map file of my IAR Blinky2 application looks like this:

"A1": place at 0x10008000 { ro section .intvec };
"A2": place at 0x2000000c { section .vect_table };
"P1": place in [from 0x10008000 to 0x1002afff] { ro };
"P2": place in [from 0x20000000 to 0x20003fff] { rw, block HEAP };
"A3": place at end of [0x20000000-0x20003fff] { block CSTACK };

Section Kind Address Size Object
------- ---- ------- ---- ------
"A1": 0x18
.intvec ro code 0x10008000 0x18 startup_XMC1200.o [1]
- 0x10008018 0x18

"P1": 0xec3
.text ro code 0x10008018 0x2c4 Blinky.o [1]
.text ro code 0x100082dc 0x44 system_XMC1200.o [1]
.text ro code 0x10008320 0xae I32DivModFast.o [4]
..

"A2": 0x130
section .vect_table-1 0x2000000c 0x130
.vect_table inited 0x2000000c 0x130 startup_XMC1200.o [1]
- 0x2000013c 0x130

"P2", part 1 of 3: 0x19
P2-1 0x2000013c 0x19
.data inited 0x2000013c 0xc uart_conf.o [1]
.data inited 0x20000148 0xc xmc1_scu.o [1]
.data inited 0x20000154 0x1 Blinky.o [1]
- 0x20000155 0x19

"P2", part 2 of 3: 0x4
.noinit uninit 0x20000158 0x4 system_XMC1200.o [1]
- 0x2000015c 0x4

"P2", part 3 of 3: 0xa0
.bss zero 0x2000015c 0x80 xmc1_scu.o [1]
.bss zero 0x200001dc 0x1c uart_conf.o [1]
.bss zero 0x200001f8 0x4 Blinky.o [1]
- 0x200001fc 0xa0

"A3": 0x800
CSTACK 0x20003800 0x800
CSTACK uninit 0x20003800 0x800
- 0x20004000 0x800

0 Likes
1 Reply
Not applicable
Ok, i got the solution:
In the Bootloader define the following:

volatile const uint32_t *app_start_func = (volatile const uint32_t*) 0x10008004; void (*start_func)(void);

Then in the main function, call this function to load the another application:

int main(void)
{
// ...
start_func = (void (*)()) *app_start_func;
start_func();
}
0 Likes