Set firmware offset

Sysprogs forums Forums VisualGDB Set firmware offset

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #25702
    ExtSol
    Participant

    Dear support,

    How can i set the offset of my firmware?

    here is what i tried:

    on properties page->MSBuild settings->Linker script->Copy to project directory

    then i opened it

    here is the flash module organization: https://imgur.com/a/z8LJBZY

    the default firmware address is started at 0x0800 0000

    i want to use the first sector to store user settings and offset the firmware start address to Sector 1 (0x0800 4000)

    then i edit the linker script from:

    MEMORY
    {
    FLASH (RX) : ORIGIN = 0x08000000, LENGTH = 1M
    SRAM (RWX) : ORIGIN = 0x20000000, LENGTH = 128K
    CCMRAM (RWX) : ORIGIN = 0x10000000, LENGTH = 64K
    }

    to:

    MEMORY
    {
    FLASH (RX) : ORIGIN = 0x08004000, LENGTH = 1008K
    SRAM (RWX) : ORIGIN = 0x20000000, LENGTH = 128K
    CCMRAM (RWX) : ORIGIN = 0x10000000, LENGTH = 64K
    }

    then set the VECT_TAB_OFFSET to 0x4000 in system_stm43f4xx.c file.

    after download, i see the firmware is started at address: https://imgur.com/a/elSZ31h

    but not started.

    when i try to pause, i get frame not in module message, then i view the disassembly, i see this:

    https://imgur.com/a/ydFM9gB

    but the firmware is at the correct offset:

    https://imgur.com/a/EAyG1Tf

    and here is the build Output window:

    https://imgur.com/a/7Ioy9Z3

    at line: Used FLASH: 11KB out of 1024KB (1%) -> why 1024? I set this value in linker script to 1008

     

    Why not start the microcontroller at the setted address?

     

    Best Regards:

    ExtSol

     

     

    #25703
    ExtSol
    Participant

    The embedded memory explorer window is showing wrong values:

    https://imgur.com/a/3N7Dq5t

    When i add new section, not showed:

    https://imgur.com/a/Af7ZUMy

    #25709
    support
    Keymaster

    Hi,

    This is by design. Most microcontrollers expect the interrupt vector table pointing to the entry point to be at a specific address (typically, beginning of FLASH) and placing arbitrary data there will prevent the program from starting.

    The Embedded Memory Explorer shows the memory layout as defined in the BSP and ignores any manual changes to the linker script. Normally, we advise using the Additional Memories page of VisualGDB Project Properties (Custom edition and higher) to add extra memories to your project and have VisualGDB automatically update the linker script, generate macros for placing variables into those memories and also update the Embedded Memory Explorer.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.