MPC5748G copy vector table from ROM to RAM

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MPC5748G copy vector table from ROM to RAM

ソリューションへジャンプ
1,826件の閲覧回数
pcandiag
Contributor I

I would like to get confirmation if I'm doing this correctly.  I'm trying to Integrate FNET into my S32 Design Studio project.  For FNET to work it needs  to install vectors.  For this to happen the vector table needs to be in RAM.  To move the vector table from ROM to RAM  I think you need to do the following,  

1) Modify file MPC5748G_ram.ld  (I've identified the change I want to make) See cod SNIPET below

CODE SNIPET FROM FILE- MPC5748G_ram.ld 

COD SNIPET 

.intc_vector_table   : ALIGN(4096)
    {
        /* For FreeRTOS C55 v9.0.0 OSInterruptsHandlerTable must be placed at the same location as __VECTOR_RAM */
     OSInterruptsHandlerTable = .;
      /*  __VECTOR_TABLE = .;*/  <---------------------------------------------------------- I WANT TO COMMENT OUT THIS LINE
        __VECTOR_RAM = .;               /* No copy */
        . = ALIGN(4);
        KEEP(*(.intc_vector_table))     /* Startup code */
    } > SRAM
    __RAM_VECTOR_TABLE_SIZE = 0x0;

2) In startup.c, function init_data_bss(void) - See code snippet below,  this code should do the copying of the vector table in FLASH to RAM - Is my understanding correct, will this happen as I think?   Also who calls function init_data_bss(void) I can't seem to find out where this function is called?

Thanks,

Paul C

CODE SNIPET FROM FILE: startup.c,  FUNCTION:Startup.c

if (__VECTOR_RAM != __VECTOR_TABLE)
    {
        /* Copy the vector table from ROM to RAM */
        for (n = 0; n < (((uint32_t)__RAM_VECTOR_TABLE_SIZE)/sizeof(uint32_t)); n++)
        {
            __VECTOR_RAM[n] = __VECTOR_TABLE[n];
        }
        /* Point the VTOR to the position of vector table */
        *vectors[coreId] = (uint32_t)__VECTOR_RAM;
    }

0 件の賞賛
返信
1 解決策
1,614件の閲覧回数
raresvasile
NXP Employee
NXP Employee

Hi Paul,

The interrupt table is copied by default in RAM in init_data_bss, which is called in startup_MPC5748G.s before main function entry.

You can check if the vector is placed in ram by looking into INTC->IACKRn register. (n is the active core number).

Hope that this helps,

Rares

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,614件の閲覧回数
candiapa
Contributor I

Rares,

Thanks for the feedback.  Checked the reference manual for the MPC5748G and what you wrote makes sense.

Thanks,

Paul Candiago

0 件の賞賛
返信
1,615件の閲覧回数
raresvasile
NXP Employee
NXP Employee

Hi Paul,

The interrupt table is copied by default in RAM in init_data_bss, which is called in startup_MPC5748G.s before main function entry.

You can check if the vector is placed in ram by looking into INTC->IACKRn register. (n is the active core number).

Hope that this helps,

Rares

0 件の賞賛
返信