Copy to ram program configuration – Zilog ZUSBOPTS User Manual
Page 350

Program Configurations
UM017105-0511
322
Zilog Developer Studio II – ZNEO™
User Manual
Write all of the executable program code (non-start-up code) under the CODE segment.
This segment belongs to EROM address space. To set up this configuration, you must
copy the CODE segment from EROM to the ERAM address space. Perform steps 2 and 3
from the C Program Setup for this configuration, as described in the
tion on page 319. In step 3, add the code to your assembly start-up code instead of the
standard C startup.
Special Case: Partial Copy to ERAM
A special case of this configuration is when you want to copy program code from just one
assembly segment into ERAM, while retaining the rest of the code in EROM. This allows
you to gain the potential speed advantages of external RAM over external Flash for a spe-
cific module. Perform the following steps:
1. Use a distinct segment name for the particular segment. For example:
Define main_TEXT, space=EROM
segment main_TEXT
; code goes here
2. To copy the
main_TEXT
segment from EROM to the ERAM address space, perform
steps 2 and 3 from the C Program Setup, Special Case, for this configuration as
described in the
section on page 319. In step 3, add the code to your
assembly start-up code instead of the standard C startup.
Copy to RAM Program Configuration
The Copy to RAM Program Configuration, shown in Figure 136, can be used for produc-
tion as well as development code. It is somewhat similar to the Default Program Configu-
ration, the only difference being that the executable program code is downloaded in
EROM, copied from EROM to RAM by the start-up code, and then executed from RAM.
The reason for choosing this configuration is that while internal Flash on ZNEO-CPU-
based devices can be accessed quickly enough to keep up with the CPU, that might not be
true of external Flash. If you have external Flash (as part of the EROM address space) and
if the internal RAM is faster than the external Flash, the user program might execute faster
from RAM.