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?
T.K
May 30, 2012, 9:28pm
2
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/mios_c_send_enc_rel.html
Best Regards, Thorsten.
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?
T.K
December 8, 2012, 1:40pm
5
Could you please attach your sources to this thread for further analysis?
Best Regards, Thorsten.
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.org/dokuwiki/doku.php?id=how_to_use_xcode2_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
[Makefile.rtf](< base_url >/applications/core/interface/file/attachment.php?id=10238)
[common.rtf](< base_url >/applications/core/interface/file/attachment.php?id=10239)
T.K
December 8, 2012, 5:50pm
7
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.
Cheers for the link.
How do I go about updating them? Do I just drag and drop the perls into usr/local/bin?
T.K
December 9, 2012, 5:55pm
9
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.
Triffki
December 9, 2012, 10:26pm
10
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!
T.K
December 9, 2012, 10:52pm
11
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
[/code]
Best Regards, Thorsten.
Triffki
December 10, 2012, 11:21am
12
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
T.K
December 10, 2012, 11:09pm
13
Oh!
Which MacOS version are you using? Maybe I’ve to compile the binaries differently.
I’m using 10.8
Best Regards, Thorsten.
Triffki
December 10, 2012, 11:52pm
14
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?
T.K
December 11, 2012, 6:02pm
15
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.
Triffki
December 11, 2012, 6:33pm
16
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!