Jump to content


Photo
- - - - -

linker memory error


  • Please log in to reply
15 replies to this topic

#1 avockley

avockley

    MIDIbox Newbie

  • Members
  • Pip
  • 34 posts

Posted 30 May 2012 - 05:16

I'm having an issue when trying to compile my program. The full make log is included below. I think it is some kind of memory conflict, but I have no idea what it means, or how to solve it.

aarons-macbook-pro:Software aaron$ make
rm -rf _output/*
rm -rf _output
rm -rf *.cod *.map *.lst
rm -rf *.hex
mkdir -p _output
sh ~/svn/mios/trunk/bin/mios-gpasm -c -p p18f4685 -I./src -I ~/svn/mios/trunk/include/asm -I ~/svn/mios/trunk/include/share -I ~/svn/mios/trunk/modules/debug_msg -I ~/svn/mios/trunk/modules/app_lcd/dummy -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -I ~/svn/mios/trunk/modules/mios_wrapper /Users/aaron/svn/mios/trunk/modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o
sh ~/svn/mios/trunk/bin/mios-gpasm -c -p p18f4685 -I./src -I ~/svn/mios/trunk/include/asm -I ~/svn/mios/trunk/include/share -I ~/svn/mios/trunk/modules/debug_msg -I ~/svn/mios/trunk/modules/app_lcd/dummy -DDEBUG_MODE=0   /Users/aaron/svn/mios/trunk/modules/app_lcd/dummy/app_lcd.asm -o _output/app_lcd.o
sh ~/svn/mios/trunk/bin/mios-sdcc -c -mpic16 -p18f4685 --fommit-frame-pointer --optimize-goto --optimize-cmp --disable-warning 85 --obanksel=2  -I./src -I ~/svn/mios/trunk/include/c -I ~/svn/mios/trunk/include/share -I ~/svn/mios/trunk/modules/debug_msg -DDEBUG_MODE=0  main.c -o _output/main.o
/Users/aaron/svn/mios/trunk/bin/mios-gpasm modifies _output/main.asm, result in _output/main__mios-gpasm-tmp.asm
sh ~/svn/mios/trunk/bin/mios-gpasm -c -p p18f4685 -I./src -I ~/svn/mios/trunk/include/asm -I ~/svn/mios/trunk/include/share -I ~/svn/mios/trunk/modules/debug_msg -I ~/svn/mios/trunk/modules/app_lcd/dummy -DDEBUG_MODE=0   /Users/aaron/svn/mios/trunk/modules/debug_msg/debug_msg.asm -o _output/debug_msg.o
gplink -s ~/svn/mios/trunk/etc/lkr/p18f4685.lkr -m -o project.hex  ~/svn/mios/trunk/lib/libsdcc.lib ~/svn/mios/trunk/lib/pic18f4685.lib _output/mios_wrapper.o _output/app_lcd.o _output/main.o _output/debug_msg.o
error: multiple sections using address 0x3280
make: *** [project.hex] Error 1
aarons-macbook-pro:Software aaron$

Any suggestions?

#2 TK.

TK.

    MIDIbox Guru

  • Administrators
  • 12,501 posts
  • LocationGermany

Posted 30 May 2012 - 22:28

I guess that you added an encoder table, because 0x3280 is the location where this table is expected.

Probably you forgot to add -DDONT_INCLUDE_MIOS_ENC_TABLE to the MIOS_WRAPPER_DEFINES variable (located in Makefile) as explained at the bottom of this page:
http://www.ucapps.de...nd_enc_rel.html

Best Regards, Thorsten.
Posted Image Buy TK a Beer Disclaimer: buying TK a beer gets you absolutely nothing in return likesuchas firmware enhancements, technical advices and MIDIbox troubleshooting assistance.

#3 avockley

avockley

    MIDIbox Newbie

  • Members
  • Pip
  • 34 posts

Posted 31 May 2012 - 00:24

That did it. Thanks.

#4 Triffki

Triffki

    MIDIbox Newbie

  • Members
  • Pip
  • 26 posts

Posted 08 December 2012 - 14:33

I get a similar error to this but at address 0:

rm -rf _output/*
rm -rf _output
rm -rf *.cod *.map *.lst
rm -rf *.hex
mkdir -p _output
/usr/local/bin/gpasm -c -p p18f452 -I./src -I /Users/user/Desktop/MIOS/include/asm -I /Users/user/Desktop/MIOS/include/share -I /Users/user/Desktop/MIOS/modules/debug_msg -I /Users/user/Desktop/MIOS/modules/app_lcd/dummy -DDEBUG_MODE=0 -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -DDONT_INCLUDE_MIOS_ENC_TABLE -I /Users/user/Desktop/MIOS/modules/mios_wrapper /Users/user/Desktop/MIOS/modules/mios_wrapper/mios_wrapper.asm -o _output/mios_wrapper.o
/usr/local/bin/gpasm -c -p p18f452 -I./src -I /Users/user/Desktop/MIOS/include/asm -I /Users/user/Desktop/MIOS/include/share -I /Users/user/Desktop/MIOS/modules/debug_msg -I /Users/user/Desktop/MIOS/modules/app_lcd/dummy -DDEBUG_MODE=0 /Users/user/Desktop/MIOS/modules/app_lcd/dummy/app_lcd.asm -o _output/app_lcd.o
/usr/local/bin/sdcc -c -mpic16 -p18f452 --fommit-frame-pointer --optimize-goto --optimize-cmp --disable-warning 85 --obanksel=2 -I./src -I /Users/user/Desktop/MIOS/include/c -I /Users/user/Desktop/MIOS/include/share -I /Users/user/Desktop/MIOS/modules/debug_msg -DDEBUG_MODE=0 main.c -o _output/main.o
/usr/local/bin/gpasm -c -p p18f452 -I./src -I /Users/user/Desktop/MIOS/include/asm -I /Users/user/Desktop/MIOS/include/share -I /Users/user/Desktop/MIOS/modules/debug_msg -I /Users/user/Desktop/MIOS/modules/app_lcd/dummy -DDEBUG_MODE=0 /Users/user/Desktop/MIOS/modules/debug_msg/debug_msg.asm -o _output/debug_msg.o
gplink -s /Users/user/Desktop/MIOS/etc/lkr/p18f452.lkr -m -o project.hex /Users/user/Desktop/MIOS/lib/libsdcc.lib /Users/user/Desktop/MIOS/lib/pic18f452.lib _output/mios_wrapper.o _output/app_lcd.o _output/main.o _output/debug_msg.o
error: multiple sections using address 0
make: *** [project.hex] Error 1



Any thoughts, suggestions?

#5 TK.

TK.

    MIDIbox Guru

  • Administrators
  • 12,501 posts
  • LocationGermany

Posted 08 December 2012 - 14:40

Could you please attach your sources to this thread for further analysis?

Best Regards, Thorsten.
Posted Image Buy TK a Beer Disclaimer: buying TK a beer gets you absolutely nothing in return likesuchas firmware enhancements, technical advices and MIDIbox troubleshooting assistance.

#6 Triffki

Triffki

    MIDIbox Newbie

  • Members
  • Pip
  • 26 posts

Posted 08 December 2012 - 17:54

Hi,

I'm using the base package from the bottom of the MIOS8 download page on ucApps. I've added all of these files to a new Xcode project as described here:

http://www.midibox.o...as_ide_on_a_mac

I get a bit confused when it mentions the MAKEFILE.SPEC file as this isn't in the package. Nevertheless, I skipped over this part and went on to set up the application target, and also installed SDCC (version 2.6.0) and GPASM (version 0.13.4 beta) on usr/local/bin. I had to add paths to Makefile and common.mk to get them to compile, and these edited files are attached. Here is the shell script I used to initiate the build in Xcode:

export MIOS_PATH=~/Desktop/MIOS

PATH=/usr/local/bin:$PATH

chmod +x /usr/local/bin

cd $SRCROOT
make

exit 0

Attached File  Makefile.rtf   1.61K   2 downloads
Attached File  common.rtf   5.21K   1 downloads

#7 TK.

TK.

    MIDIbox Guru

  • Administrators
  • 12,501 posts
  • LocationGermany

Posted 08 December 2012 - 18:50

Hi,

this is the wrong SDCC and GPUTILS version.

I think that it really makes sense that I'm hosting the right versions at midibox.org
Here we are: http://www.midibox.org/mios8_toolchain

Please let me know if this works, then I will update the Wiki accordingly.

Best Regards, Thorsten.
Posted Image Buy TK a Beer Disclaimer: buying TK a beer gets you absolutely nothing in return likesuchas firmware enhancements, technical advices and MIDIbox troubleshooting assistance.

#8 Triffki

Triffki

    MIDIbox Newbie

  • Members
  • Pip
  • 26 posts

Posted 09 December 2012 - 02:39

Cheers for the link.

How do I go about updating them? Do I just drag and drop the perls into usr/local/bin?

#9 TK.

TK.

    MIDIbox Guru

  • Administrators
  • 12,501 posts
  • LocationGermany

Posted 09 December 2012 - 18:55

It doesn't matter where the directories are located.
/usr/local/bin is the traditional location, today we prefer /opt
It's important, that your PATH variable points to the appr. bin directories of the packages.

Best Regards, Thorsten.
Posted Image Buy TK a Beer Disclaimer: buying TK a beer gets you absolutely nothing in return likesuchas firmware enhancements, technical advices and MIDIbox troubleshooting assistance.

#10 Triffki

Triffki

    MIDIbox Newbie

  • Members
  • Pip
  • 26 posts

Posted 09 December 2012 - 23:26

ok, so supposing I put those directories in a folder on my desktop called 'blob', would I have to edit the common.mk file like this:

# if MIOS_SHELL environment variable hasn't been set by the user, set it here
# Ubuntu users should set it to /bin/bash from external (-> "export MIOS_SHELL /bin/bash")
MIOS_SHELL ?= sh
export MIOS_SHELL=Users/user/Desktop/blob

# output directory
OUTDIR = _output

# add default libraries
LIBS += $(MIOS_PATH)/lib/libsdcc.lib $(MIOS_PATH)/lib/pic$(PROCESSOR).lib

# GPASM execution via wrapper
GPASM = $(MIOS_SHELL)/gputils-0.14.3/bin/gpasm -c

# SDCC execution via wrapper
SDCC = $(MIOS_SHELL)/sdcc-2.8.0/bin/sdcc -c

?

Do I then have to edit the shell script to this:

# shell script goes here

export MIOS_PATH=~/Desktop/MIOS

PATH=/Desktop/blob:$PATH

chmod +x /usr/local/bin

cd $SRCROOT
make

exit 0

?

As you may have guessed I'm a bit lost with all this at the moment, but thanks very much for your advice!

#11 TK.

TK.

    MIDIbox Guru

  • Administrators
  • 12,501 posts
  • LocationGermany

Posted 09 December 2012 - 23:52

There are some obsolete settings in your script...

Actually it should work this way:
# shell script goes here

# path to MIOS base directory
export MIOS_PATH=~/Desktop/MIOS

# path to MIOS bin directory
export MIOS_BIN_PATH=${MIOS_PATH}/bin

# path to SDCC and GPUTILS bin directories
export PATH=~/Desktop/blob/sdcc/bin:~/Desktop/blob/gputils/bin:$PATH

# change to SRCROOT (which is passed by Xcode?)
cd $SRCROOT

# execute the makefile
make

Best Regards, Thorsten.
Posted Image Buy TK a Beer Disclaimer: buying TK a beer gets you absolutely nothing in return likesuchas firmware enhancements, technical advices and MIDIbox troubleshooting assistance.

#12 Triffki

Triffki

    MIDIbox Newbie

  • Members
  • Pip
  • 26 posts

Posted 10 December 2012 - 12:21

Now I get a segmentation fault:

rm -rf _output/*
rm -rf _output
rm -rf *.cod *.map *.lst
rm -rf *.hex
mkdir -p _output
sh /Users/user/Desktop/MIOS/bin/mios-gpasm -c -p p18f452 -I./src -I /Users/user/Desktop/MIOS/include/asm -I /Users/user/Desktop/MIOS/include/share -I /Users/user/Desktop/MIOS/modules/debug_msg -I /Users/user/Desktop/MIOS/modules/app_lcd/dummy -DDEBUG_MODE=0 -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -DDONT_INCLUDE_MIOS_ENC_TABLE -I /Users/user/Desktop/MIOS/modules/mios_wrapper /Users/user/Desktop/MIOS/modules/mios_wrapper/mios_wrapper.asm -o _output/mios_wrapper.o
/Users/user/Desktop/MIOS/bin/mios-gpasm: line 141: 274 Segmentation fault gpasm $ARGS
make: *** [_output/mios_wrapper.o] Error 139

#13 TK.

TK.

    MIDIbox Guru

  • Administrators
  • 12,501 posts
  • LocationGermany

Posted 11 December 2012 - 00:09

Oh! :-(

Which MacOS version are you using? Maybe I've to compile the binaries differently.
I'm using 10.8

Best Regards, Thorsten.
Posted Image Buy TK a Beer Disclaimer: buying TK a beer gets you absolutely nothing in return likesuchas firmware enhancements, technical advices and MIDIbox troubleshooting assistance.

#14 Triffki

Triffki

    MIDIbox Newbie

  • Members
  • Pip
  • 26 posts

Posted 11 December 2012 - 00:52

I'm running 10.6.8. Could it be anything to do with the fact I have older versions of SDCC and GPUTILS lying around?

#15 TK.

TK.

    MIDIbox Guru

  • Administrators
  • 12,501 posts
  • LocationGermany

Posted 11 December 2012 - 19:02

No, because the right versions are selected with highest priority in the PATH variable.

It could be, that this is related to a 32bit/64bit issue; Leopard is running in 32bit mode, right?
I need some time to find out how to compile for 32bit with the existing Xcode toolchain, because it seems that this isn't properly documented. :-/

Best Regards, Thorsten.
Posted Image Buy TK a Beer Disclaimer: buying TK a beer gets you absolutely nothing in return likesuchas firmware enhancements, technical advices and MIDIbox troubleshooting assistance.

#16 Triffki

Triffki

    MIDIbox Newbie

  • Members
  • Pip
  • 26 posts

Posted 11 December 2012 - 19:33

Ah ok then. Yeah I believe its 32bit.

No worries, I've got a PC so I'll try to compile on that instead

Thanks again, and good luck!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users