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.
We are using the MSP430FR5969 in a sensor product, and we now need to utilize upper block of FRAM at 0x10000 because our program size has increased beyond the 48k in lower FRAM.
One solution is to locate 2 large intialized data arrays at 0x10000. I have modifed the linker command file (from Energia) to do this:
.upper.rodata : { . = ALIGN(2); KEEP(*(.upper.rodata)) . = ALIGN(2); KEEP(*(.upper.rodata.*)) } > far_rom
The far_rom section is located at 0x01000 in the command file, and I have declared the initialized arrays as follows:
const unsigned char __attribute__((section(".upper.rodata"))) Program_Data_IC_1[4096} = { <byte values here> }
I have removed all references to this array in the code (hence the KEEP keyword), as I will be using a pointer initialized to 0x010000 to read the values. I am building this project in CCS 6.1.3 by importing this Energia 17 project (and then modifying the linker command file). However, the project fails to build with the following error:
makefile:164: recipe for target 'Auto_optimize_R16_expt.out' failed ./sigma_SPI.o:(.debug_info+0x90c): relocation truncated to fit: R_MSP430_16_BYTE against symbol `Program_Data_IC_1' defined in .upperFram section in ./sigma_SPI.o
All I really need is to produce a loadable file with the array mapped to upper FRAM. I've tried a few things such as introducing the -mlarge build option, and the "far" keyword, but these produce build errors because they are not supported in MSPGCC 4.6.3. So it appears that the Energia 17 build tools will not allow for any location of data above the 64k boundary?
Is it feasible to build an object module using other build tools that allow location above 64k and linking that with the Energia-built main program, object modules and libraries? (All I really need is a loadable hex file that has the initialized array in upper FRAM) Is there any solution or workaround to this, short of switching to new build tools?
Thanks in advance,
John
Upper memory is not accessible with the version of mspgcc that is shipped with Energia. I think there was a release just before it was obsoleted that did support upper memory but I decided not to risk pulling that in. There will be a msp430-core release that will feature the new compiler towards the end of the year.
Thanks very much for the answer from the Energia expert, as it is critical info for our project roadmap. I did see a fair amount of conversation around GitHub at the end of 2016 discussing the possibility of a new release with the new tools.
So as another approach to our problem, is it feasible to take our Energia 17 project and use a linker from another GCC tool set (Ithink there are 2 other toolchains, RedHat and Somnium, correct?) to link it with our separately-built initialized data arrays? I don't need to access the arrays symbolically at all from Energia, I just need to know where they are located in FRAM.
Thanks,
John
"Unfortunately" I am not a linker/compiler expert so not sure if this would work. It's worth a shot though.
Regarding the experimental msp430-gcc 4.7.0 compiler that does support MSP430x, you could try and build that compiler for your operating system. Then change platform.txt to accommodate the placing in upper memory. There are some great instructions here: https://github.com/contiki-os/contiki/wiki/MSP430X. I just gave this script a try on Linux and it seems to build OK. Not sure if it will build with this script on Windows / macOS. We do have a script that has been used to build the msp430 toolchain we include in Energia. It is posted here: github.com/.../build-mspgcc
**Attention** This is a public forum