Jump to content
43oh

Where to place modified linker scripts


Recommended Posts

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

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...