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

AURIX™ Forum Discussions

panda
Level 1
5 sign-ins 5 replies posted Welcome!
Level 1
Hi everyone

I try to make a bootloader for my TC387 Board. I can flash an example .hex file into a specific PFLASH memory range through can communication. After this is happen i reset and disable all interrupts and system sets.
But now i need to reallocate my vector table at master core so that, after the a .hex file is flashed the program must start from the application program section. I don t know how to do this in aurix tricore.



Can someone help me further, who has an idea for this topic?

my .hex file is flashed into 0xA0058000 section.

Thx
0 Likes
7 Replies
NeMa_4793301
Level 6
10 solutions authored 5 solutions authored First solution authored
Level 6
If you're using the iLLD, initializing the BTV is in Ifx_Ssw_Tc0.c:
    Ifx_Ssw_MTCR(CPU_BTV, (unsigned int)__TRAPTAB(0));
LijoDan
Level 2
10 replies posted First question asked 10 likes given
Level 2

I understand this part, However i have a further query,

the application vector table and the bootlaoder vector tables are in different location.

So before i set to jump from bootloader to applciation.

How do i map the vector tables to the adress i need,,,

can u give an example..

Application vector tables are in 0xA0000100

 

0 Likes
µC_Wrangler
Employee
25 solutions authored First like given 100 replies posted
Employee

Hi @LijoDan .  Generally, the application and bootloader are built as two completely separate projects.  Each one has its own initialization, and its own vector table (typically handled by the compiler's cstart).  When the bootloader jumps to the application, the application's cstart changes BIV and BTV to point to the application's vector tables.

LijoDan
Level 2
10 replies posted First question asked 10 likes given
Level 2

okay, but how does the cstart know where the BTV and BIV point locations are?

In my case, these locations are specified from linker files.

0 Likes
µC_Wrangler
Employee
25 solutions authored First like given 100 replies posted
Employee

As an example: in AURIX Development Studio, the linker file (Lcf_Tasking_Tricore_Tc.lsl) contains the directives below.  Then this line in Ifx_Ssw_Tc0.c picks up that __INTTAB_CPU0 definition and sets BTV to that address.

 Ifx_Ssw_MTCR(CPU_BTV, (unsigned int)__TRAPTAB(0));

 

/*Fixed memory Allocations for Interrupt Vector Table*/
group (ordered)
{
group int_tab_tc0 (ordered)
{
# include "inttab0.lsl"
}
group int_tab_tc1 (ordered)
{
# include "inttab1.lsl"
}
group int_tab_tc2 (ordered)
{
# include "inttab2.lsl"
}
"_lc_u_int_tab" = (LCF_INTVEC0_START);
"__INTTAB_CPU0" = (LCF_INTVEC0_START);
"__INTTAB_CPU1" = (LCF_INTVEC1_START);
"__INTTAB_CPU2" = (LCF_INTVEC2_START);
}

 

0 Likes
panda
Level 1
5 sign-ins 5 replies posted Welcome!
Level 1
it does not helped me further. can you give more information how to reallocate the vector table?
0 Likes
NeMa_4793301
Level 6
10 solutions authored 5 solutions authored First solution authored
Level 6
I'm not clear what your question is. Let me describe the general case, and please fill in the details where your setup is different.

In most bootloader / application architectures, the bootloader and application are linked as separate projects:
- The bootloader occupies, say, the first 256K of program flash, with its own system initialization (RAM, PLL, BTV, BIV, etc.)
- The application occupies the rest of program flash, with its own system initialization (RAM, PLL, BTV, BIV, etc.)

The bootloader and application are typically both iLLD-based or MCAL-based. But either way, the low-level parts of the system initialization are invoked again. That means the bootloader has its own vector tables, and the application has a separate set of vector tables.

Can you explain the specific problem you're having in more detail?
0 Likes