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.

MSP4305659 Legacy COFF vs EABI(ELF)

Hi,

I am developing with large data memory requirement, ~=50KB of RAM.

IDE: CCS V6.1, Full License.

- Silicon version: mspx

- code memory model: large

- data memory model: large

- near_data: global.

- runtime model options (Advanced Options): checked large data memory model.

the rest, default.

 

Here are the observations

--------------------------------------------------------------------------------

when total variables size <10kB

In EABI(ELF) mode, compiles successfully, and run.

In Legacy COFF mode, it complains about ""#10204-D could not resolve index library "libmath.a" to a compatible library".

 

Therefore EABI(ELF) may be the preferred choice for small memory model.

---------------------------------------------------------------------------------

When total variables > ~10kB (i.e. 24kB)

In EABI(ELF) mode, compile warnings

#10015-D output file "msp430f665x_uscia0_spi_09(Large DMA).out" cannot be loaded and run on a target system

#17003-D relocation from function "DMA_ISR" to symbol "bNewData" overflowed; the 20-bit relocated address 0xf47bb is too large to encode in the 16-bit field (type = 'R_MSP430X_ABS16' (15), file = "./LargeDMA.obj", offset = 0x00000022, section = ".text:_isr:DMA_ISR") LargeDMA.c /msp430f665x_uscia0_spi_09(Large DMA) line 238

#17003 relocation from function "imageSPThread" to symbol "bNewData" overflowed; the 20-bit relocated address 0xf47bb is too large to encode in the 16-bit field (type = 'R_MSP430X_ABS16' (15), file = "./LargeDMA.obj", offset = 0x00000012, section = ".text:imageSPThread") LargeDMA.c /msp430f665x_uscia0_spi_09(Large DMA)

 

The program is able to load, but refuse to launch.

MSP430: Loading complete. There were 1966 (code) and 16 (data) bytes written to FLASH/FRAM. The expected RAM usage is 23906 (uninitialized data + stack) bytes.

 

In Legacy COFF mode, Compile warnings. In addition to the #10015-D and #17003-D warnings, the libmath.a warning appears.

#10204-D could not resolve index library "libmath.a" to a compatible library msp430f665x_uscia0_spi_09(Large DMA)

 

However the program load and seems able to execute.

There were 1648 (code) and 114 (data) bytes written to FLASH/FRAM. The expected RAM usage is 0 (uninitialized data + stack) bytes.

===========================================================================

Which model shall I use?

Is there any settings that I need to change? How to remove the #17003-D warnings. Looks dangerous and may results in unknown behaviour.

I think it may be better to use EABI(ELF) model, as the libmath.a is not supported in Legacy COFF. At least, I can't remove/justify this warning.

Appreciate your advice.

Thanks and regards,

Shanguo

  • Btw, I was developing with Legacy COFF in CCS V5 and the libmath.a warning did not exist; and the expected RAM usage was correct as well.
  • Your program is not using ‘libmath.a’ otherwise you will get (fatal) error’s. Just delete the ‘libmath.a’ entry in the Linker Options.
  • Thanks for the advice.

    To turn off #17003-D Overflow warning, it requires to change -near_data options to none. I don't know why. I thought the near_data options affect 64K and above data and code memory, but msp430 have less than 64kB RAM and my code is less than 64KB.
  • The ‘near data’ option doesn’t specify the size of the memory but the location of the memory, in this case the lower 64K.

    But your memory is split up into sectors and has only 18KB in the low-64K region, all other in the upper 20-bit address space.

  • Got it.
    But another issue is that, the variables are located in the 48KB of RAM2 when the variables grow large, and the lower 16KB is nearly empty (except for the 160B reserved for some purpose. However, even if my variables grow > 48KB slightly, it complains of insufficient memory.

    Any idea on how to make use of both RAM and RAM2 space?

    Thanks in advance
  • Sector 0 is mirrored above sector 3, which means you can use all of your RAM as one continuous memory segment.
    But a small part of the RAM must be in the 16-bit address space, see the Linker Command file which Section must be expressly in the ‘RAM’ segment, the size of the Sections can been seen in the .map file.

    In the Linker Command file decrease the RAM length to for example 1000h then the location to 5400h (2400+3000h). The RAM2 length can now be increased to F000h (C000+3000h).
  • It works. Thanks

**Attention** This is a public forum