XMC4500 create offset for code (DAVE4)

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

cross mob
Not applicable
Hello,

I got following problem. I'm new to XMC4500 and Dave4. I'm woriking on a bootloader. The Bootloader resides in sector 0 and 1. The Bootloader will load via a windows program the new hex file into the flash.

What I want to know is how can I define an offset for the hex file which should be loaded into the flash by the bootloader?

I tried editing the linker file

FLASH_1_uncached(RX) : ORIGIN = 0x0C004000, LENGTH = 0xFC000

but this wont compile. How can i make the program to start at location 0x0C004000 ?

thanks for your help.
0 Likes
3 Replies
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Hi,

I did this on my software for both cached and uncached. Please give this a try.



FLASH_1_cached(RX) : ORIGIN = 0x08040000, LENGTH = 0x100000
FLASH_1_uncached(RX) : ORIGIN = 0x0C040000, LENGTH = 0x100000
0 Likes
Not applicable
Travis wrote:
Hi,

I did this on my software for both cached and uncached. Please give this a try.



FLASH_1_cached(RX) : ORIGIN = 0x08040000, LENGTH = 0x100000
FLASH_1_uncached(RX) : ORIGIN = 0x0C040000, LENGTH = 0x100000


Thank you Travis. It worked.
0 Likes
Not applicable
I wanted to add something for other people that maybe searching for something similar.

I chose the address 0x0C004000 because of the erasing which can only be done sectorwise (See reference manual 8-5 under "features" and 8-7 under "PFLASH").
0 Likes