ARM Technical Support Knowledge Articles

STARTUP CODE CHANGES REQUIRED TO USE ECODE

Applies to: C251 C Compiler

Answer


Information in this article applies to:


QUESTION

What must I modify in my startup code to place parts of my program in ECODE?

ANSWER

Use the assembler command SET(ROMHUGE) when you assemble the 251 startup code in START251.A51. There are conditional assembly statements which, as a result of this directive, declare code segments as ECODE instead of CODE. This lets the linker place your program's functions anywhere in ECODE's 24-bit allowable address range.

Using this directive, you can create functions that are up to 64K and programs that are up to 16M (or the limit of memory available with your device).

Note: Make sure you set your C compiler options to use ROM(HUGE). Failing to do this yields the linker errors shown below:

*** ERROR L101: SEGMENT COMBINATION ERROR
    SEGMENT: ?CO?START251?4
    MODULE:  D:KEIL1C251LIBC2ST.LIB (?C_START)

*** ERROR L127: UNRESOLVED EXTERNAL SYMBOL
    SYMBOL:  MAIN?
    MODULE:  D:KEIL1C251LIBSTART251.OBJ (?C_START?)

*** ERROR L120: CONTENT BELONGS TO ERRONEOUS SEGMENT
    SEGMENT: ?CO?START251?4

*** ERROR L121: IMPROPER FIXUP
    MODULE:  D:KEIL1C251LIBSTART251.OBJ (?C_START?)
    SEGMENT: ?CO?START251?4
    OFFSET:  000001H

*** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL
    SYMBOL:  MAIN?
    MODULE:  D:KEIL1C251LIBSTART251.OBJ (?C_START?)
    ADDRESS: FF0027H

*** ERROR L120: CONTENT BELONGS TO ERRONEOUS SEGMENT
    SEGMENT: ?CO?START251?4

*** ERROR L121: IMPROPER FIXUP
    MODULE:  D:KEIL1C251LIBC2ST.LIB (?C_START)
    SEGMENT: ?CO?START251?4
    OFFSET:  000001H

MORE INFORMATION

For more information on how to set the address range(s) for ECODE, refer to the L251 linker command ECODE() in the 251 Utilities User's Guide.

Article last edited on: 2004-05-17 16:54:52

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential