Hi,
I am very interested in the gcc port for MSP430 and its integration in CCSv6. I am very glad about the effort done by TI (and RedHat) to offer this opensource and free development option.
However, I have some issues with the code placement in ROM
Release notes of the 4.9 (fist production) version states:
- Support for intelligently splitting code and data between low and high memory
But linker scripts provided with CCSv6 (and the ones downloadables at the TI GCC MSP page) are configured only to use the lowest ROM memory region. I have been able to manually place code in the far region by modifying these files, for example like this (and of course using the -mlarge flag when compiling and linking):
/* This is just for crt0.S and interrupt handlers. */
.lowtext :
{
PROVIDE (_start = .);
. = ALIGN(2);
KEEP (*(SORT(.crt_*)))
KEEP (*(.lowtext))
} > ROM
.lower.text :
{
. = ALIGN(2);
*(.lower.text.* .lower.text)
} > ROM
.text :
{
. = ALIGN(2);
*(.text .stub .text.* .gnu.linkonce.t.* .text:*)
KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.interp .hash .dynsym .dynstr .gnu.version*)
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
. = ALIGN(2);
KEEP (*(.init))
KEEP (*(.fini))
KEEP (*(.tm_clone_table))
} > FAR_ROM
However this places almost all code in far ROM region, except for the interrupt subroutines and some other (few) functions. This is not optimal, since a significant amount of Flash is in the low address space and would be wasted.
Of course, I can manually place code in the low rom by using the section attribute, but I would prefer the linker to automatically split the code bewteen the two region, as hinted in the release notes, so I do not have to manually state where each function is placed.
Is this possible? If so, How? I have not been able to figure it out so far.
Regards, and Thank you,
Jose