LCF_TRAPVEC0_START and LCF_STARTPTR_CPU0 values in Lcf_Gnuc_Tricore_Tc.lsl

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

cross mob
E-John
Level 3
Level 3
10 replies posted First like given 25 sign-ins

Dear all,

refer linker file "Lcf_Gnuc_Tricore_Tc.lsl" under dirctory, (part of it see below) Aurix2G_Workspace_V1_0_1_13_0\BaseFramework_TC39B\1_ToolEnv\0_Build\1_Config\Config_Tricore_Gnuc

1. INTVEC0_START is from 0x802F E000 = (0x802F FFFF - 256 x 32 + 1) =  (0x802F FFFF - 0x2000 + 1), 256 interrupt and 32bytes for each one, total size is 0x2000 bytes, and it is from 0x802E 0000 to 0x802FFF, it is OK. The INTVEC1_START to INTVEC5_START can be got by the similar  way.

2. There are 8 traps of each CPUx, x from 0 to 5, the TRAPVEC size is 8 x 32 = 0x100

3. LCF_TRAPVEC1_START to LCF_TRAPVEC5_START are set to 0x8030 0000 to 0x80F0 0000, adjacent CPU is with a difference value 0x30 0000,

    LCF_STARTPTR_CPU1 to LCF_STARTPTR_CPU5 are set to 0x8030 0100 to 0x80F0 0100, adjacent CPU is with a difference value 0x30 0000.

4. For CPU0, LCF_TRAPVEC0_START is set to 0x80000100, the TRAP vector address is from 0x8000 0100 to 0x8000 0200? Why? Is there any special purpose to set this value?

and LCF_STARTPTR_CPU0 is set to 0x80000000, what are the address from 0x8000 0000 to 0x8000 00ff for?

 

 

 

 

LCF_INTVEC0_START = 0x802FE000;
LCF_INTVEC1_START = 0x805FE000;
LCF_INTVEC2_START = 0x808FE000;
LCF_INTVEC3_START = 0x80BFE000;
LCF_INTVEC4_START = 0x80EFE000;
LCF_INTVEC5_START = 0x80FFE000;

__INTTAB_CPU0 = LCF_INTVEC0_START;
__INTTAB_CPU1 = LCF_INTVEC1_START;
__INTTAB_CPU2 = LCF_INTVEC2_START;
__INTTAB_CPU3 = LCF_INTVEC3_START;
__INTTAB_CPU4 = LCF_INTVEC4_START;
__INTTAB_CPU5 = LCF_INTVEC5_START;

LCF_TRAPVEC0_START = 0x80000100;
LCF_TRAPVEC1_START = 0x80300000;
LCF_TRAPVEC2_START = 0x80600000;
LCF_TRAPVEC3_START = 0x80900000;
LCF_TRAPVEC4_START = 0x80C00000;
LCF_TRAPVEC5_START = 0x80F00000;

LCF_STARTPTR_CPU0 = 0x80000000;
LCF_STARTPTR_CPU1 = 0x80300100;
LCF_STARTPTR_CPU2 = 0x80600100;
LCF_STARTPTR_CPU3 = 0x80900100;
LCF_STARTPTR_CPU4 = 0x80C00100;
LCF_STARTPTR_CPU5 = 0x80F00100;

LCF_STARTPTR_NC_CPU0 = 0xA0000000;
LCF_STARTPTR_NC_CPU1 = 0xA0300100;
LCF_STARTPTR_NC_CPU2 = 0xA0600100;
LCF_STARTPTR_NC_CPU3 = 0xA0900100;
LCF_STARTPTR_NC_CPU4 = 0xA0C00100;
LCF_STARTPTR_NC_CPU5 = 0xA0F00100;

RESET = LCF_STARTPTR_NC_CPU0;

 

 

 

 

0 Likes
1 Solution
KB
Moderator
Moderator
Moderator
10 solutions authored 50 sign-ins 25 replies posted

Hello E-John,

The below address is used to store the first application start-up instruction "__START"
LCF_STARTPTR_CPU0 = 0x80000000; //for Cached region
LCF_STARTPTR_NC_CPU0 = 0xA0000000; // for non-cached region

The boot software pass the control to Application Startup(based on bmhd_0_orig.stad configuration) placed at location "__START". The application start-up "__START" uses 32bytes
(cached: 0x80000000 - 0x80000020 & non-cached: 0xA0000000 - 0xA0000020).
That's why the Trap table is moved to address LCF_TRAPVEC0_START = 0x80000100(nearest 256 bit aligned location).

As for cores other than core 0, for example, the core 0 sets PC(Program Counter) of core 1 to __START1(refer core 0's __StartUpSoftware_Phase6)instead of boot software.
The __START1 is at LCF_STARTPTR_NC_CPU1 = 0xA0300100 (for cached LCF_STARTPTR_CPU1 = 0x80300100), hence the trap table can be safely be placed at 0x80300000 (256 bit aligned).

 

Regards,

KB

View solution in original post

0 Likes
4 Replies
KB
Moderator
Moderator
Moderator
10 solutions authored 50 sign-ins 25 replies posted

Hello E-John,

The below address is used to store the first application start-up instruction "__START"
LCF_STARTPTR_CPU0 = 0x80000000; //for Cached region
LCF_STARTPTR_NC_CPU0 = 0xA0000000; // for non-cached region

The boot software pass the control to Application Startup(based on bmhd_0_orig.stad configuration) placed at location "__START". The application start-up "__START" uses 32bytes
(cached: 0x80000000 - 0x80000020 & non-cached: 0xA0000000 - 0xA0000020).
That's why the Trap table is moved to address LCF_TRAPVEC0_START = 0x80000100(nearest 256 bit aligned location).

As for cores other than core 0, for example, the core 0 sets PC(Program Counter) of core 1 to __START1(refer core 0's __StartUpSoftware_Phase6)instead of boot software.
The __START1 is at LCF_STARTPTR_NC_CPU1 = 0xA0300100 (for cached LCF_STARTPTR_CPU1 = 0x80300100), hence the trap table can be safely be placed at 0x80300000 (256 bit aligned).

 

Regards,

KB

0 Likes
E-John
Level 3
Level 3
10 replies posted First like given 25 sign-ins

Hi KB,

It is clear.

Thanks for your explanations and helps.

 

0 Likes
E-John
Level 3
Level 3
10 replies posted First like given 25 sign-ins

Hi KB,

The boot software pass the control to Application Startup(based on bmhd_0_orig.stad configuration) placed at location "__START". The application start-up "__START" uses 32bytes
(cached: 0x80000000 - 0x80000020 & non-cached: 0xA0000000 - 0xA0000020).
That's why the Trap table is moved to address LCF_TRAPVEC0_START = 0x80000100(nearest 256 bit aligned location).

Is there any documentation or code for reference about "The application start-up "__START" uses 32bytes"? thanks.

0 Likes
KB
Moderator
Moderator
Moderator
10 solutions authored 50 sign-ins 25 replies posted

Hello E-John,

Since _START is application start-up which is user-specific, its upto the user to decide the size of _START.

However in iLLD example codes, the user-specific start-up function "_START" is placed in the section "reset". If you refer the .lsl file this section is allocated with 0x20 bytes.

KB_0-1650271278979.png

You can also refer map file to get the space allocation related information.

Regards,

KB

0 Likes