How to Save On-Chip Memory by Placing RTS Off-Chip
4-9
Linking Issues
/*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/
/* RTS code – placed off chip */
/*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/
.rtstext { –lrts6200.lib(.text) } > EXT0
/*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/
/* RTS data – undefined sections – placed off chip */
/*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/
.rtsbss { –lrts6200.lib(.bss)
–lrts6200.lib(.far) } > EXT0
/*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/
/* RTS data – defined sections – placed off chip */
/*–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/
.rtsdata { –lrts6200.lib(.const)
–lrts6200.lib(.switch) } > EXT0
}
User sections (.text, .bss, .const, .data, .switch, .far) are built and allocated
normally.
The .cinit section is built normally as well. It is important to not allocate the RTS
.cinit sections separately as is done with the other RTS sections. All of the .cinit
sections must be combined together into one section for auto-initialization of
global variables to work properly.
The .stack, .sysmem, and .cio sections are entirely created from within the
RTS. So, you don’t need any special syntax to build and allocate these sec-
tions separately from user sections. Typically, you place the .stack (system
stack) and .sysmem (heap of memory used by malloc, etc.) sections in on-chip
memory for performance reasons. The .cio section is a buffer used by printf
and related functions. You can typically afford slower performance of such I/O
functions, so it is placed in off-chip memory.
The .rtstext section collects all the .text, or code, sections from RTS and allo-
cates them to external memory name EXT0. If needed, replace the library
name rts6200.lib with the library you normally use, perhaps rts6700.lib. The
–l is required, and no space is allowed between the –l and the name of the libra-
ry. The choice of EXT0 is arbitrary. Use the memory range which makes the
most sense in your application.
The .rtsbss section combines all of the undefined data sections together. Un-
defined sections reserve memory without any initialization of the contents of
that memory. You use .bss and .usect assembler directives to create unde-
fined data sections.