This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linker script for using USB RAM with msp430-elf-gcc

Other Parts Discussed in Thread: MSP430F5510

I'd like to use the USB ram in an MSP430F5510 with the gcc tools in CCS 6.0.1.00040

The linker script ccs_base/msp430/include_gcc/msp430f5510.ld with gcc (4.9.1 20140707) has a USBRAM memory section defined, but it seems that this is not used by the .data, .bss, .noinit sections which use the "RAM" memory area.

I noticed that msp430-gcc 4.6.3 package that comes with ubuntu 14.04 has 2 "memory.x" linker scripts, one in /usr/msp430/lib/ldscripts/msp430f5510/nousb/.  A short-term workaround for me would be to copy and modify the include_gcc/msp430f5510.ld to either redefine RAM to include the USB RAM range or to add " | USBRAM" where "RAM" is used, but is this an addition that could be made upstream in the gcc that gets installed in CCS6?  If so, where can this be requested?

My link fails now with "region `RAM' overflowed by 406 bytes", so that extra 2k will really help.

Thanks!

  • IIRC, the 5310 is a 5510 without USB module but with otherwise identical pinout and memory layout. So you can look at the linker file for this one and copy over the segment definitions.
    But basically, the thing you need is to remove the USBRAM section and lower the start address and increase the size of the ram section by these 2k, as the USB ram is located exactly below the normal ram, with no gap.
    Keep in mind that even after adding the 2k, this means that you have only 1.5k ram left for stack and heap, including local variables and dynamically allocated memory.

**Attention** This is a public forum