This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Scatter File for Cortex M3 (AT91SAM3S4C Board)

Hi,

I am trying to run the .NET Microframework on an AT91SAM3S4C board. And I am stuck at the very few steps.
I am trying to execute a function which would perform a low level init of the board and execute a few lines of code to toggle the LED.

My scatter file looks like,

LR_FLASH 0x00400000 ABSOLUTE 0x00030000
{
    ER_FLASH 0x00400000 FIXED
    {
        FirstEntry.obj (+RO, +FIRST)
        * (SectionForBootstrapOperations)
        * (+RO-CODE)
        * (+RO-DATA)
    }
    ER_RAM_RO 0x00000000 ABSOLUTE
    {
        VectorsTrampolines.obj (+RO, +FIRST)
        * (SectionForFlashOperations)
    }
    ER_RAM_RW +0 ABSOLUTE
    {
        * (+RW-DATA, +ZI)
    }
    ER_HEAP_BEGIN 0x20009000 ABSOLUTE UNINIT
    {
        * (SectionForHeapBegin)
    }
    ER_HEAP_END 0x2000AFF8 ABSOLUTE UNINIT
    {
        * (SectionForHeapEnd)
    }
    ER_STACK_BOTTOM 0x2000B000 ABSOLUTE UNINIT
    {
        * (SectionForStackBottom)
    }
    ER_STACK_TOP 0x2000BFF8 ABSOLUTE UNINIT
    {
        * (SectionForStackTop)
    }
}
LR_CONFIG 0x00430000 ABSOLUTE 0x00010000
{
    ER_CONFIG 0x00430000 FIXED 0x00010000
    {
        * (SectionForConfig)
    }
}

As my flash base address is 0x00400000 and I am trying to load a ASM file which will call the Boot fucntion from tht location. But for some reason I am not able to get this to run.

Anyone kindly let me know if they have any inputs/suggestions. Someone who has done a port of .NET Microframework.

Parents
  • Hello Kartik Natarajan,

    I am not very experienced in writing scatter files but did you try to place your vectors at the beginning of the Flash?. I think the controller remaps the start of Flash to address 0x000000. At this address it fetches the Stack Pointer and also the Reset Vector.

    ...
        ER_FLASH 0x00400000 FIXED
        {
            VectorsTrampolines.obj (+RO, +FIRST)
            * (SectionForFlashOperations)
            FirstEntry.obj
            * (SectionForBootstrapOperations)
            * (+RO-CODE)
            * (+RO-DATA)
        }
    ;    ER_RAM_RO 0x00000000 ABSOLUTE
    ;    {
    ;        VectorsTrampolines.obj (+RO, +FIRST)
    ;        * (SectionForFlashOperations)
    ;    }
    ...
    

    I am not shure if this is the correct syntax.

    Best Regards,
    Martin Guenther

Reply
  • Hello Kartik Natarajan,

    I am not very experienced in writing scatter files but did you try to place your vectors at the beginning of the Flash?. I think the controller remaps the start of Flash to address 0x000000. At this address it fetches the Stack Pointer and also the Reset Vector.

    ...
        ER_FLASH 0x00400000 FIXED
        {
            VectorsTrampolines.obj (+RO, +FIRST)
            * (SectionForFlashOperations)
            FirstEntry.obj
            * (SectionForBootstrapOperations)
            * (+RO-CODE)
            * (+RO-DATA)
        }
    ;    ER_RAM_RO 0x00000000 ABSOLUTE
    ;    {
    ;        VectorsTrampolines.obj (+RO, +FIRST)
    ;        * (SectionForFlashOperations)
    ;    }
    ...
    

    I am not shure if this is the correct syntax.

    Best Regards,
    Martin Guenther

Children
No data