User function();

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

cross mob
User5327
Level 4
Level 4
Hi all,

I have my program in XMC4500... Is it possible to create second new project with only one "user" function();
This user function should be in special place in Flash memory (which is denied for first main program)

Calling the user function from main program could be done by pointer to function from special place in Flash memory.

My target: Upload the first main program to the XMC4500. Then user can create second program and add it to the flash memory (throught Memtool).

Is it possible????

BR
Koumak
0 Likes
6 Replies
Not applicable
Hi Koumak,

It is possible to download the codes to the selected addresses using Memtool.
The address used for 2nd time flashing should not be the same as the one for first time flashing. Hence, you need to manually change the code addresses in the linker script files.
Furthermore, the 2nd project should not contain startup.s and system.c files.

Best regards,
Sophia
0 Likes
User5327
Level 4
Level 4
Thanks,

can you please provide a simple example?
(it is best way to understanding)

BR,
Koumak
0 Likes
Not applicable
Hi Koumak,

After trying, we found that this couldn't be done by using "DAVE + Memtool". You may need try to use other compiler for code generation.

Best regards,
Sophia
0 Likes
User5327
Level 4
Level 4
Hi sophia,

I'm surprised that it's not possible. (I assumed it would be possible.)
Can you describe some details of why this is not possible please?

Best regards,
Koumak
0 Likes
lock attach
Attachments are accessible only for community members.
Not applicable
Hi Koumak,

Sorry, I just found a mistake in my 2nd project results in shared resources with 1st project which will be overwritten during 2nd time programming.
Attached is a simple example which consists of 2 separated projects can be programmed separately via Memtool.




However, I do recommend you to locate the codes in different flash sections in one project instead of two separated projects which have more risks for debugging.
Do you have particular reason for two separated projects?

Best regards,
Sophia
0 Likes
User5327
Level 4
Level 4
Hi Sophia,

Great.
Thank you very much.

Best regards,
Koumak
0 Likes