AnsweredAssumed Answered

MPC5604B - Mapping Constant Data in a Specific Flash Section

Question asked by Florian D on Feb 16, 2016

Hi Everyone,

 

I'm working on a MPC5604B and I'm trying to customize the default Flash linker file in order to map my Interrupts Table appart from the default code section.

I shortened the default internal_flash section from 0x0007C000 to 0x0007B000 in order to reserve space for my ISR table. So now my .lcf file defines these two areas:

internal_flash:           org = 0x00003000,   len = 0x0007B000     (default area for flash code)
flash_isr_handler:        org = 0x0007E000,   len = 0x00001000     (my specific area for ISR table)

 

Then in the "Sections" part of the linker file, I set-up the relocation of my interrupt vector table into my dedicated area:

GROUP : {

     .mydatainflash (CONST) ALIGN(2048) : {

          *(.__initialized_flash_isr_handle)

          *(.__uninitialized_flash_isr_handle)

       }

    } > flash_isr_handler*/

 

However, when my program starts, It gets stucks in the IVOR2 Exception: "Data Storage Interrupt Handler", as if it would be trying to perform a kind of initialization of my table without the relevant permissions / access.

 

What is the solution to put Constant data in a specific Flash area appart from the rest of the code ?

 

 

Other information that might interrest you:

I get no problem when I locate my interrupt vector table in the internal_flash area like this - but it does not suit my needs:

    GROUP : {

      .text : {}

      .text_vle (VLECODE) ALIGN(0x08): {

         *(.text)

         *(.text_vle)

       }

       .rodata (CONST) : {

         *(.rdata)

         *(.rodata)

       }

       /** This works fine: */

       .__initialized_flash_isr_handle   ALIGN(2048) : {}

       .__uninitialized_flash_isr_handle ALIGN(2048) : {}

       .ctors : {}

       .dtors : {}

       extab : {}

       extabindex : {}

    } > internal_flash

 

 

My Interrupt Vectors Table is defined like that:

#pragma push /* Save the current state */
#pragma section data_type ".__initialized_flash_isr_handle" ".__uninitialized_flash_isr_handle"

 

const INTSInterruptFn INTSSwInterruptsTable[INTS_U8_NUMBER_OF_ISR] =

{

   interrupt_handler,    /* Vector - 0    software interrupt 0 */

    [...]

   interrupt_handler    /* Vector - 216  Reserved  */

};

#pragma pop

 

You wan find attached my whole linker file that make the problem occur.

Original Attachment has been moved to: FLASH.lcf.zip

Outcomes