• Announcements

    • bluehash

      Forum Upgrade   03/11/2017

      Hello Everyone, Thanks for being patient while the forums were being fixed and upgraded. Please see details and report issues in this thread. Thanks!
EStoneham

Where to place modified linker scripts

1 post in this topic

msp430.xmsp430.xI have modified the scripts in a memory.x file and an msp430.x file, and I want the linker to use these scripts instead of the default linker scripts. I have used the modified msp430.x to replace the msp430.x file in C:\energia-0101E0016\hardware\tools\msp430\msp430\lib\ldscripts, and I have used the modified memory.x file to replace the memory.x file in C:\energia-0101E0016\hardware\tools\msp430\msp430\lib\ldscripts\msp430f5529. I know the latter file is being used, because its absence causes a "can't find file" error during compilation. The absence of an msp430.x file, on the other hand, does not cause such an error. Symbols I have defined in the msp430.x file give me "undefined reference to..." errors when I try to use them in my source code. How can I be sure that my modified msp430.x file is being used by the linker?

I'm using an MSP-EXP430F5529LP LaunchPad with an MSP430F5529 processor and with Energia v. 16. Attached are the simple test file I am trying to compile and the modified script files with changes to allow creation of an exclusive flash_data section in nonvolatile memory.

The verbose compiler output is as follows.

C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-g++ -c -Os -Wall -ffunction-sections -fdata-sections -mmcu=msp430f5529 -DF_CPU=25000000L -MMD -DARDUINO=101 -DENERGIA=16 -g -IC:\energia-0101E0016\hardware\msp430\cores\msp430 -IC:\energia-0101E0016\hardware\msp430\variants\launchpad_f5529 -IC:\energia-0101E0016\hardware\msp430\libraries\MspFlash C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\sketch_mar16a.cpp -o C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\sketch_mar16a.cpp.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-g++, -c, -Os, -Wall, -ffunction-sections, -fdata-sections, -mmcu=msp430f5529, -DF_CPU=25000000L, -MMD, -DARDUINO=101, -DENERGIA=16, -g, -IC:\energia-0101E0016\hardware\msp430\cores\msp430, -IC:\energia-0101E0016\hardware\msp430\variants\launchpad_f5529, -IC:\energia-0101E0016\hardware\msp430\libraries\MspFlash, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\sketch_mar16a.cpp, -o, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\sketch_mar16a.cpp.o]
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\MspFlash\MspFlash.cpp.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\atof.c.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\dtostrf.c.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\itoa.c.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\random.c.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\twi.c.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\usci_isr_handler.c.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\WInterrupts.c.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\wiring.c.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\wiring_analog.c.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\wiring_digital.c.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\wiring_pulse.c.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\wiring_shift.c.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\HardwareSerial.cpp.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\IPAddress.cpp.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\MACAddress.cpp.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\main.cpp.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\new.cpp.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\Print.cpp.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\Stream.cpp.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\TimerSerial.cpp.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\Tone.cpp.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\Wire.cpp.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\WMath.cpp.o
  Using previously compiled: C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\WString.cpp.o
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\atof.c.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\atof.c.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\dtostrf.c.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\dtostrf.c.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\itoa.c.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\itoa.c.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\random.c.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\random.c.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\twi.c.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\twi.c.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\usci_isr_handler.c.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\usci_isr_handler.c.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\WInterrupts.c.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\WInterrupts.c.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\wiring.c.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\wiring.c.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\wiring_analog.c.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\wiring_analog.c.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\wiring_digital.c.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\wiring_digital.c.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\wiring_pulse.c.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\wiring_pulse.c.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\wiring_shift.c.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\wiring_shift.c.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\HardwareSerial.cpp.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\HardwareSerial.cpp.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\IPAddress.cpp.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\IPAddress.cpp.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\MACAddress.cpp.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\MACAddress.cpp.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\main.cpp.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\main.cpp.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\new.cpp.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\new.cpp.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\Print.cpp.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\Print.cpp.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\Stream.cpp.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\Stream.cpp.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\TimerSerial.cpp.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\TimerSerial.cpp.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\Tone.cpp.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\Tone.cpp.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\Wire.cpp.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\Wire.cpp.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\WMath.cpp.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\WMath.cpp.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar rcs C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\WString.cpp.o 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-ar, rcs, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\WString.cpp.o]
C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-gcc -Os -Wl,-gc-sections,-u,main -mmcu=msp430f5529 -o C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\sketch_mar16a.cpp.elf C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\sketch_mar16a.cpp.o C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\MspFlash\MspFlash.cpp.o C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a -LC:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp -lm 
[C:\energia-0101E0016\hardware\tools\msp430\bin\msp430-gcc, -Os, -Wl,-gc-sections,-u,main, -mmcu=msp430f5529, -o, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\sketch_mar16a.cpp.elf, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\sketch_mar16a.cpp.o, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\MspFlash\MspFlash.cpp.o, C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp\core.a, -LC:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp, -lm]
sketch_mar16a.cpp.o: In function `setup':
C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp/sketch_mar16a.cpp:10: undefined reference to `__flash_data_start'
C:\Users\Ed\AppData\Local\Temp\build7178218172900134903.tmp/sketch_mar16a.cpp:12: undefined reference to `__flash_data_size'
collect2: ld returned 1 exit status

Any enlightenment will be appreciated.

-XtremeEd

sketch_mar16a.ino

memory.x

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now