Arduino IDE compiled program flash location


hi all,

the subject might bit confusing didn't know call it.

i have been working on getting bootloader onto arduino due can wireless uploads of firmware.

the bootloader atmel example have provided have been converting atmel studio written iar.

the bootloader sits on both of flash locations (flash0 0x80000, flash1 0xc0000).

i want continue using arduino ide time being made different board type points new flash.ld file shown below.

code: [select]
output_format("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
output_arch(arm)
search_dir(.)

/* memory spaces definitions */
memory
{
rom (rx)    : origin = 0x00089000, length = 0x00040000 /* flash, 512k */
sram0 (rwx) : origin = 0x20000000, length = 0x00010000 /* sram0, 64k */
sram1 (rwx) : origin = 0x20080000, length = 0x00008000 /* sram1, 32k */
ram (rwx)   : origin = 0x20070000, length = 0x00018000 /* sram, 96k */
}

/* section definitions */
sections
{
    .text :
    {
        . = align(4);
        _sfixed = .;
        keep(*(.vectors .vectors.*))
        *(.text .text.* .gnu.linkonce.t.*)
        *(.glue_7t) *(.glue_7)
        *(.rodata .rodata* .gnu.linkonce.r.*)
        *(.arm.extab* .gnu.linkonce.armextab.*)

        /* support c constructors, , c destructors in both user code
           and c library. provides support c++ code. */
        . = align(4);
        keep(*(.init))
        . = align(4);
        __preinit_array_start = .;
        keep (*(.preinit_array))
        __preinit_array_end = .;

        . = align(4);
        __init_array_start = .;
        keep (*(sort(.init_array.*)))
        keep (*(.init_array))
        __init_array_end = .;

        . = align(0x4);
        keep (*crtbegin.o(.ctors))
        keep (*(exclude_file (*crtend.o) .ctors))
        keep (*(sort(.ctors.*)))
        keep (*crtend.o(.ctors))

        . = align(4);
        keep(*(.fini))

        . = align(4);
        __fini_array_start = .;
        keep (*(.fini_array))
        keep (*(sort(.fini_array.*)))
        __fini_array_end = .;

        keep (*crtbegin.o(.dtors))
        keep (*(exclude_file (*crtend.o) .dtors))
        keep (*(sort(.dtors.*)))
        keep (*crtend.o(.dtors))

        . = align(4);
        _efixed = .;            /* end of text section */
    } > rom

    /* .arm.exidx sorted, has go in own output section.  */
    provide_hidden (__exidx_start = .);
    .arm.exidx :
    {
      *(.arm.exidx* .gnu.linkonce.armexidx.*)
    } > rom
    provide_hidden (__exidx_end = .);

    . = align(4);
    _etext = .;

    .relocate : @ (_etext)
    {
        . = align(4);
        _srelocate = .;
        *(.ramfunc .ramfunc.*);
        *(.data .data.*);
        . = align(4);
        _erelocate = .;
    } > ram

    /* .bss section used uninitialized data */
    .bss align(4) (noload) :
    {
        . = align(4);
        _sbss = . ;
        _szero = .;
        *(.bss .bss.*)
        *(common)
        . = align(4);
        _ebss = . ;
        _ezero = .;
    } > ram

    . = align(4);
    _end = . ;

    /* .stack_dummy section doesn't contains symbols. only
       used linker calculate size of stack sections, , assign
       values stack symbols later */
    .stack_dummy :
    {
        *(.stack*)
    } > ram

    /* set stack top end of ram, , stack limit move down by
     * size of stack_dummy section */
    __stacktop = origin(ram) + length(ram);
    __stacklimit = __stacktop - sizeof(.stack_dummy);
    provide(_sstack = __stacklimit);
    provide(_estack = __stacktop);
}


i changed "rom (rx)    : origin = 0x00089000, length = 0x00040000 /* flash, 512k */" of code point 0x89000 program gets loaded.

the problem fine when placed in flash0 not if gets loaded flash1 location 0xc9000.

the problem wont know flash bank loaded can't change value second flash bank.

is there way have auto change depending location in.



Arduino Forum > Using Arduino > Programming Questions > Arduino IDE compiled program flash location


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code