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.

MSP430FR5969: Using FRAM above 0x10000 with MSPGCC 4.6.3

Part Number: MSP430FR5969
Other Parts Discussed in Thread: ENERGIA, MSP430FR5994,

I am not able to use upper FRAM above 0x0001000 on MSP430 in Energia for an existing project,   I am using latest Energia release E20 which uses latest version of gcc compiler 4.6.6.

My goal is to 1) get the linker to locate two initialized data arrays in upper FRAM on MSP430FR5994 or MSP430FR5969 and 2) read that data as a lookup table using the Energia program.   I have used the following attribute to map the arrays to upper FRAM:

const unsigned char __attribute__((section(".fartext")))  Program_Data_IC_1[5120]= {
0xFF, 0xF2, 0x00, 0x20, 0x01, 
0x00, 0x00, 0x00, 0xE2, 0x01, 
...

However, any code access to the array gives the build error 

relocation truncated to fit: R_MSP430_16_BYTE against `no symbol'

which I believe is due to trying to access upper FRAM with a 16-bit pointer.

So I tried modifying Energia's platform.txt to use large memory model:

compiler.mlarge_flag=-mlarge

but building in Energia E20 gave the error:

cc1plus.exe: error: unrecognized command line option '-mlarge'

exit status 1
Error compiling for board MSP-EXP430FR5994LP.

I also tried using TI's GNU 7.3.1 (Mitto Systems) compiler in CCS 8.1 but I got errors building the Energia core library that is needed.

Is there any suggestion as to how to accomplish using upper FRAM in this way?

Thanks in advance,

John

  • While I have never tried using them, the GCC User's Guide (slau646) lists several intrinsic functions that might help:

    • unsigned char __data20_read_char(unsigned long addr);
    • unsigned long __data20_read_long(unsigned long addr);
    • unsigned short __data20_read_short(unsigned long addr);
    • void __data20_write_char(unsigned long addr, unsigned char src);
    • void __data20_write_long(unsigned long addr, unsigned long src);
    • void __data20_write_short(unsigned long addr, unsigned short src);

  • Thanks for your reply.  I would like to use those intrinsics, however my Energia-based project uses an older GCC 4.6.3 compiler.   My current understanding is that Energia does not support the GCC compiler described in SLAU646 (Mitto Systems).   I have tried to import my Energia project into CCS 8.1 and build it with that compiler but failed.  

    Have you had success using that compiler with Energia projects?

  • Sorry, I am a command line sort of guy so I can't help with Energia.

    My personal Wayback Machine is a bit fuzzy on just how much support for 20 bit addresses that version had. But assuming the assembler supports the CPUX extensions, you can always write your own versions of those intrinsics.

    (Hint; use popx.a to get the 32 bit address into a register.)

  • Yes, agree that some inline assembly with 20-bit addresses will take care of accessing upper FRAM since I don't need to reference those locations symbolically. One of the other problems though is how to coerce the Energia (GCC 4.6.3) to not remove the unreferenced data arrays from the output file. I tried using the KEEP keyword in the linker control file but didn't work--the arrays were removed because they were not referenced.
  • It sounds like the IDE is telling the linker to perform garbage collection with --gc-sections. See if you can turn that off or at least slip a --no-gc-sections in after it.
  • Hi John,

    check this and escape from Energia if possible.
  • Thanks for this tip, works well. However in the process I ran into other Energia build errors.
    As a workaround, I am going to split my project into one that builds in CCS with GCC 7.1 compiler to access upper fram, and a separate Energia project. Then my loader can load 2 hex files. Would lovw to move away from Energia but it's client's code.
  • Hi,

    Thanks for your post. Is your question answered? If so, please click verify answer button.

    B.R
    Winter
  • I received some helpful replies, but my question was not answered, probably because it's an Energia and GCC 4.6.3 question.  

  • Hi,

    Energia is a third party tool. TI does not support the use of Energia. There is a forum of Energia: https://43oh.com/ . Because it's an Energia and GCC 4.6.3 question, I think this forum may help you. If you have a technical question relating to the hardware, you can still ask for help on E2E forum.

    B.R
    Winter

**Attention** This is a public forum