Keil Logo

C251: STARTUP CODE CHANGES REQUIRED TO USE ECODE


Information in this article applies to:

  • C251 Version 2.14

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:\KEIL1\C251\LIB\C2ST.LIB (?C_START)

*** ERROR L127: UNRESOLVED EXTERNAL SYMBOL
    SYMBOL:  MAIN?
    MODULE:  D:\KEIL1\C251\LIB\START251.OBJ (?C_START?)

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

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

*** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL
    SYMBOL:  MAIN?
    MODULE:  D:\KEIL1\C251\LIB\START251.OBJ (?C_START?)
    ADDRESS: FF0027H

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

*** ERROR L121: IMPROPER FIXUP
    MODULE:  D:\KEIL1\C251\LIB\C2ST.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.

Last Reviewed: Friday, May 4, 2018


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.