Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 20 Dec 2005 01:57 PM by  Anonymous
IAR compiler: burning images into flash
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages
dcostant
New Member
New Member
Posts:


--
13 Dec 2005 07:49 AM
    I've compiled a small program with the IAR Embedded Workbench compiler. I can build and load it into RAM using LogicLoader.

    The problem occurs when I try to build and load it into flash. The environment came with a linker file named lh79520_lnk_flash.xcl

    I attempt to load the generated srec file and I get the following:

    losh> load srec
    loading from stdin:
    download of 'F08_1' complete:
    bytes: 535979179 records: 5711 start: 201f0000
    extent: 0x201f0000-0x1ff264ab
    ignoring rest of file... 2 bytes. done
    running md5sum on the _loaded_ portion of the file:

    As you can see, the "bytes" value is quite large. Clearly I am doing something wrong. The following is the lh79520_lnk_flash.xcl file:

    //************************************************
    // Inform the linker about the CPU family used.
    //************************************************

    -carm

    //*************************************************************************
    // Segment placement - General information
    //
    // All numbers in the segment placement command lines below are interpreted
    // as hexadecimal unless they are immediately preceded by a '.', which
    // denotes decimal notation.
    //
    // When specifying the segment placement using the -P instead of the -Z
    // option, the linker is free to split each segment into its segment parts
    // and randomly place these parts within the given ranges in order to
    // achieve a more efficient memory usage. One disadvantage, however, is
    // that it is not possible to find the start or end address (using
    // the assembler operators .sfb./.sfe.) of a segment which has been split
    // and reformed.
    //
    // When generating an output file which is to be used for programming
    // external ROM/Flash devices, the -M linker option is very useful
    // (see xlink.pdf for details).
    //*************************************************************************


    //*************************************************************************
    // Read-only segments mapped to ROM.
    //*************************************************************************

    // Use these addresses for the LH79520
    -DROMSTART=40100000
    -DROMEND=401FFFFF


    //************************************************
    // Address range for reset and exception
    // vectors (INTVEC).
    // The vector area is 32 bytes,
    // an additional 32 bytes is allocated for the
    // constant table used by ldr PC in cstartup.s79.
    //************************************************

    -Z(CODE)INTVEC=201F0000-201F003F

    //************************************************
    // Startup code and exception routines (ICODE).
    //************************************************

    -Z(CODE)ICODE,DIFUNCT,NEARFUNC_A=ROMSTART-ROMEND
    -Z(CODE)SWITAB=ROMSTART-ROMEND

    //************************************************
    // Code segments may be placed anywhere.
    //************************************************

    -Z(CODE)CODE=ROMSTART-ROMEND

    //************************************************
    // Original ROM location for __ramfunc code copied
    // to and executed from RAM.
    //************************************************

    -Z(CONST)CODE_ID=ROMSTART-ROMEND

    //************************************************
    // Various constants and initializers.
    //************************************************

    -Z(CONST)INITTAB,DATA_ID,DATA_C=ROMSTART-ROMEND
    -Z(CONST)CHECKSUM=ROMSTART-ROMEND

    //*************************************************************************
    // Read/write segments mapped to RAM.
    //*************************************************************************

    // Use these addresses for the LH79520
    -DRAMSTART=20200000
    -DRAMEND=206FFFFF

    //************************************************
    // Data segments.
    //************************************************

    -Z(DATA)DATA_I,DATA_Z,DATA_N=RAMSTART-RAMEND

    //************************************************
    // __ramfunc code copied to and executed from RAM.
    //************************************************

    -Z(DATA)CODE_I=RAMSTART-RAMEND

    //************************************************
    // ICCARM produces code for __ramfunc functions in
    // CODE_I segments. The -Q XLINK command line
    // option redirects XLINK to emit the code in the
    // CODE_ID segment instead, but to keep symbol and
    // debug information associated with the CODE_I
    // segment, where the code will execute.
    //************************************************

    -QCODE_I=CODE_ID

    //*************************************************************************
    // Stack and heap segments.
    //*************************************************************************

    -D_CSTACK_SIZE=2000
    // -D_SVC_STACK_SIZE=10
    -D_IRQ_STACK_SIZE=1000
    -D_HEAP_SIZE=80000

    -Z(DATA)CSTACK+_CSTACK_SIZE=RAMSTART-RAMEND
    // -Z(DATA)SVC_STACK+_SVC_STACK_SIZE=RAMSTART-RAMEND
    -Z(DATA)IRQ_STACK+_IRQ_STACK_SIZE,HEAP+_HEAP_SIZE=RAMSTART-RAMEND

    //*************************************************************************
    // ELF/DWARF support.
    //
    // Uncomment the line "-Felf" below to generate ELF/DWARF output.
    // Available format specifiers are:
    //
    // "-yn": Suppress DWARF debug output
    // "-yp": Multiple ELF program sections
    // "-yas": Format suitable for debuggers from ARM Ltd (also sets -p flag)
    //
    // "-Felf" and the format specifiers can also be supplied directly as
    // command line options, or selected from the Xlink Output tab in the
    // IAR Embedded Workbench.
    //*************************************************************************

    // -Felf

    Anyone have any hints or suggestions? I am new to this environment.
    Dave
    Anonymous
    Posts:


    --
    20 Dec 2005 01:57 PM
    Hi Dave,

    I would recommend contacting IAR's support group with this information. They have been quite helpful in the past with customers using their tools on our kits.

    Thanks,
    You are not authorized to post a reply.