Special case: partial down, Load to ram, C program setup – Zilog ZUSBOPTS User Manual
Page 345: Assembly program setup

UM017105-0511
Program Configurations
Zilog Developer Studio II – ZNEO™
User Manual
317
ZNEO devices, so the Download to RAM Program Configuration could be limited to
small applications or portions of applications during development.
C Program Setup
The C program setup for Download to RAM Program Configuration is similar to the
Default Program Configuration with some additional steps, as described in this section.
The C-Compiler by default generates the executable program code under one unified seg-
ment named CODE. The CODE segment belongs to EROM address space. To set up this
configuration, you must move the CODE segment from EROM to the RAM address
space. Do this by adding the following linker command in the
Additional Linker Direc-
tives
dialog box (see
change code=RAM /* The linker will then allocate code segment in
RAM */
To go back to the Default Program Configuration for production code, remove this direc-
tive from the
Additional Linker Directives
dialog box.
Special Case: Partial Download to RAM
A special case of this configuration is when you want to download program code from just
one C source file into RAM, while retaining the rest of the code in EROM. This allows
you to experiment with different partitions of your code, for example, if you are consider-
ing the Partial Copy to RAM Program Configuration discussed in the
section on page 325. Perform the following steps:
1. Select the
Distinct Code Segment for Each Module
checkbox in the
Advanced
page in the
Project Settings
This option directs the C-Compiler to generate different code segment names for each
file.
2. Use the linker CHANGE directive to move the particular segment to RAM. For exam-
ple:
To download the code for
main.c
to RAM, add the following linker command in the
Additional Linker Directives
dialog box (see
change main_TEXT = RAM
To go back to the Default Program Configuration for production code, remove this
directive from the
Additional Linker Directives
dialog box.
Assembly Program Setup
The Assembly program setup for the Download to RAM Program Configuration is similar
to the Default Program Configuration with some additional guidelines, as described in this
section.