assigning a address to a Global Constant in PFlash.-AURIX - TC23x

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

cross mob
User15955
Level 1
Level 1
How to allocate a Global Constant to some fixed Address in PFlash. Using Tasking Compiler(TriCore_v6.2r1) for Aurix TC23x.
Able to assign a fixed address in DSPR like below.

#define TEST_ADDRESS (0x70000000UL)
uint32_t Test_Var __at(TEST_ADDRESS);

Thanks!
0 Likes
1 Solution
User13836
Level 6
Level 6
50 likes received 50 solutions authored 100 sign-ins
Naveen,

you are trying to locate the const value at an address which is occupied by the Boot Mode Header 2 (BMHD2) which starts at address 0xa000ffe0, having a size of 0x20 bytes. The Boot mode header ranges are by default reserved in the TASKING tools. You can also configure them in the Eclipse menu:

Project -> Properties -> Memory

in the tab named 'Boot Mode Headers'. Therefore the linker complains. When you invalidate the BMHD2 then it's possible to locate the const value in that range.

If you do not use the Eclipse environment you can add the required macros in the LSL file yourself as described in chapter 7.9.13. Boot Mode Headers of the TriCore tools user guide.

A linker LSL language appnote for the TASKING tools is available at:

https://resources.tasking.com/tasking-whitepapers/linker-script-language-lsl-tips-tricks-for-tasking...

Success!

BR,
Ulrich

View solution in original post

0 Likes
5 Replies
User13836
Level 6
Level 6
50 likes received 50 solutions authored 100 sign-ins
You can allocate a const value at an absolute address using the TASKING tools as follows:

#define TEST_ADDRESS (0xA0000000UL)
const uint32_t Test_Var __at(TEST_ADDRESS) = 0x12345678;

Best regards,
Ulrich
0 Likes
User15955
Level 1
Level 1
Hi Ulrich,

Thanks. I tried below.

#define TEST_ADDRESS (0xA000FFF8UL)
const uint32_t Test_Var __at(TEST_ADDRESS) = 0x12345678;

below is the linker error.

ltc E112: cannot locate 1 section(s):
ltc I455: requirement: 0x4 bytes of ROM area in space mpe:tc0:linear
ltc I456: section type: absolute restriction - at address 0xa000fff8
ltc I457: .rodata.main.Test_Var (157) (0x4 bytes)
make: *** [apl.elf] Error 1

can you help me with linker script changes or give some reference to update. Thanks.
0 Likes
User13836
Level 6
Level 6
50 likes received 50 solutions authored 100 sign-ins
Naveen,

you are trying to locate the const value at an address which is occupied by the Boot Mode Header 2 (BMHD2) which starts at address 0xa000ffe0, having a size of 0x20 bytes. The Boot mode header ranges are by default reserved in the TASKING tools. You can also configure them in the Eclipse menu:

Project -> Properties -> Memory

in the tab named 'Boot Mode Headers'. Therefore the linker complains. When you invalidate the BMHD2 then it's possible to locate the const value in that range.

If you do not use the Eclipse environment you can add the required macros in the LSL file yourself as described in chapter 7.9.13. Boot Mode Headers of the TriCore tools user guide.

A linker LSL language appnote for the TASKING tools is available at:

https://resources.tasking.com/tasking-whitepapers/linker-script-language-lsl-tips-tricks-for-tasking...

Success!

BR,
Ulrich
0 Likes
User15955
Level 1
Level 1
Thanks Ulrich,
error is resolved.
0 Likes
User18653
Level 1
Level 1
First like received First question asked Welcome!
hello,
I need to resolve this error in tasking compiler !
0 Likes