Placing an initialized array into internal flash sector

Comments

4 comments

  • Avatar
    Jon Elliott

    What you've done looks fine.

    I've just tried doing what you described here and it works OK - looking at the symbol browser, a section named .jptable is created at 0x0007d000, it is 64 bytes in length and it contains JumpTable.

    The only thing I did differently to you was to add the following before the JumpTable definition so that it would build:

    typedef unsigned int DWORD;
    #define CalcComplement 0
    #define InitBootLd 1

    How are you determining the array is at 0x0000000?

    0
    Comment actions Permalink
  • Avatar
    Henry

    To determine that the array is at 0x00000000 I loaded the file and displayed the array using a watch window.

    Looking at the symbol browser there is no .jptable section at all when the configuration ARM FLASH Debug is used.

    Using the configuration ARM RAM Debug, section and array are placed in the expected SDRAM segment. It looks as if some settings in the FLASH configuration might be responsible!?

    0
    Comment actions Permalink
  • Avatar
    Henry

    Thank you Jon for your trouble!

    The reason for not creating that section and array was the property ENABLE UNUSED SYMBOL REMOVAL. It had to set to NO.

    After swapping the ProgramSection lines like this
        <MemorySegment name="BOOTLD">
              <ProgramSection alignment="4" load="Yes" inputsections="*(.jptable .jptable.*)" name=".jptable"/>
              <ProgramSection alignment="4" load="Yes" inputsections="*(.textbl .textbl.*)" name=".textbl"/>
          </MemorySegment>
    JumpTable[] has been placed to the desired address 0x7D000.

    Now the resulting question is whether there still is a way to benefit from the features that  ENABLE UNUSED SYMBOL REMOVAL normally would provide. I mean the reduced storage can be quite remarkable.


    

    0
    Comment actions Permalink
  • Avatar
    Jon Elliott

    Use the Linker Options > Keep Symbols project property to list the symbols you want to keep.

    0
    Comment actions Permalink

Please sign in to leave a comment.