Jump to content

Linux - Mios8 - Toochain - make - problems


Phatline

Recommended Posts

SOLVED :santa:

 

 

LINUX - UBUNTU 14

 

1. Install some Software:

open "Terminal" type, and enter/install this:

sudo apt-get install gputils

 

Dont do this:

sudo apt-get install sdcc

- it would install the latest version (in my case 3.3.0) - and that may dont work.

 

Do this:

manually download 2.8.0, unzip anyware, reading the Install.txt:

Change to the sdcc directory and copy all files to /usr/local

cd sdcc

cp -r * /usr/local

This will install sdcc binaries into: /usr/local/bin/
header files into:                          /usr/local/share/sdcc/include/
library files into:                            /usr/local/share/sdcc/lib/
and documentation into:              /usr/local/share/sdcc/doc/

You can test the install by entering

/usr/local/bin/sdcc -v

 

should return:

SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.8.0 #5117 (Mar 23 2008) (UNIX)

 

 

2. add some variables in the file "/etc/enviroment"

MIOS_PATH="/mios/"
MIOS_BIN_PATH="/mios/bin"
MIOS_SHELL="/bin/bash" <<< the " " was the problem!!!!!!!
PROCESSOR=18f452

 

you have to write the whole path (crimic is my username):

MIOS_PATH="/home/crimic/mios"

MIOS_BIN_PATH="/home/crimic/mios/bin"

MIOS_SHELL=/bin/bash

PROCESSOR=18f452

click save >>> ooops the file "Enviroment" is "Read only" - no save possible --- so 1.1:

 

 

1.1 have "write rights" to change the "enviroment"

open "terminal" (console, command) tpe "gksudo" > enter > a window with a clear field pop up > type "nautilus" (nautilus is the "explorer"/"filemanagement" of ubuntu) > nautilus now pop up > navigate to /etc/enviroment > add following lines @ the end of the document:

MIOS_PATH="/home/crimic/mios"
MIOS_BIN_PATH="/home/crimic/mios/bin"
MIOS_SHELL=/bin/bash
PROCESSOR=18f452

 This Tutorial say...<Forget this Tutorial it's outdatet!

 

 

1.2 Proove if you do right: open "terminal" type

printenv PROCESSOR

now it prints:

18f452

well done!

 

 

3. Download toolchain

well not very easy to find, in the tutorial for windows i found that mios_base_v1_1.zip

or you do it with:

svn checkout svn://svnmios.midibox.org/mios

but then you have to change the Mios paths in 1.1! (/mios/trunk...)

 

After download, i renamed the "mios_base_v1_1" folder into "mios" and drop the folder in my USER (deutsch Persönlicher Ordner) - so if you now open  "terminal" and you type:

cd mios

cd apps

cd examples

cd lcd7

cd dog

cd c

make

this should build/make an application but i get errors:

rm -rf _output/*
rm -rf _output
rm -rf *.cod *.map *.lst
rm -rf *.hex
mkdir -p _output
/bin/bash /home/crimic/mios/bin/mios-gpasm -c -p p18f452 -I./src -I /home/crimic/mios/include/asm -I /home/crimic/mios/include/share -I /home/crimic/mios/modules/app_lcd/dog -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -I /home/crimic/mios/modules/mios_wrapper /home/crimic/mios/modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o
/bin/bash /home/crimic/mios/bin/mios-gpasm -c -p p18f452 -I./src -I /home/crimic/mios/include/asm -I /home/crimic/mios/include/share -I /home/crimic/mios/modules/app_lcd/dog -DDEBUG_MODE=0   /home/crimic/mios/modules/app_lcd/dog/app_lcd.asm -o _output/app_lcd.o
/bin/bash /home/crimic/mios/bin/mios-sdcc -c -mpic16 -p18f452 --fommit-frame-pointer --optimize-goto --optimize-cmp --disable-warning 85 --obanksel=2  -I./src -I /home/crimic/mios/include/c -I /home/crimic/mios/include/share -DDEBUG_MODE=0  main.c -o _output/main.o
at 1: warning 118: option '--fommit-frame-pointer-�' no longer supported  'use --fomit-frame-pointer instead'
at 1: warning 117: unknown compiler option '--optimize-goto' ignored
In file included from main.c:17:
/usr/bin/../share/sdcc/include/pic16/pic18fregs.h:427:25: error: pic18f452.h: No such file or directory
/home/crimic/mios/include/c/cmios.h:245: syntax error: token -> 'char' ; column 43
make: *** [_output/main.o] Fehler 1

well this path /user/bin is really no such file or directory!!!!!

but this exist:

/usr/share/sdcc/include/pic16

 

of course i would love to simply make a 32bit applicaton, and use the new cores, but i have 10 or more 8bit cores here!!!! I shame to waste them! --- and for my things (triggerbox for techstar ts306) it is really enough.

Edited by Phatline
Link to comment
Share on other sites

Hi!

 

I just install it to try it on my linux computer (Slackware, but it shouldn't be too different from ubuntu).

 

I had the same error as you get.

You can try to fix by editing mios-sdcc (mios/bin/mios-sdcc) and add "--use-non-free" as sdcc parameter

My sdcc-mios looks like that now :

# $Id: mios-sdcc 444 2008-08-14 21:26:28Z tk $
#
# MIOS specific wrapper for sdcc
#
# Executes sdcc
# Uses "mios-gpasm -fixasm" wrapper to assemble the generated code
#
# Thorsten Klose (2008-02-03)
#
# SYNTAX: mios-sdcc <sdcc-arguments>
#

if [ -z "${MIOS_BIN_PATH:-}" ]; then
  echo "ERROR $0: MIOS_BIN_PATH variable not set!"
  exit 1
fi

sdcc --use-non-free --asm="${MIOS_SHELL} ${MIOS_BIN_PATH}/mios-gpasm -fixasm" $@

I still have another error (according to your log you don't have it)

pilo@linux-pilo:~/src/mios/mios/trunk/apps/examples/lcd7/dog/c$ make                                                                                                                
rm -rf _output/*
rm -rf _output
rm -rf *.cod *.map *.lst
rm -rf *.hex
mkdir -p _output
/bin/bash /home/pilo/src/mios/mios/trunk/bin/mios-gpasm -c -p p18f452 -I./src -I /home/pilo/src/mios/mios/trunk/include/asm -I /home/pilo/src/mios/mios/trunk/include/share -I /home/pilo/src/mios/mios/trunk/modules/app_lcd/dog -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -I /home/pilo/src/mios/mios/trunk/modules/mios_wrapper /home/pilo/src/mios/mios/trunk/modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o
/bin/bash /home/pilo/src/mios/mios/trunk/bin/mios-gpasm -c -p p18f452 -I./src -I /home/pilo/src/mios/mios/trunk/include/asm -I /home/pilo/src/mios/mios/trunk/include/share -I /home/pilo/src/mios/mios/trunk/modules/app_lcd/dog -DDEBUG_MODE=0   /home/pilo/src/mios/mios/trunk/modules/app_lcd/dog/app_lcd.asm -o _output/app_lcd.o
/bin/bash /home/pilo/src/mios/mios/trunk/bin/mios-sdcc -c -mpic16 -p18f452 --fommit-frame-pointer --optimize-goto --optimize-cmp --disable-warning 85 --obanksel=2  -I./src -I /home/pilo/src/mios/mios/trunk/include/c -I /home/pilo/src/mios/mios/trunk/include/share -DDEBUG_MODE=0  main.c -o _output/main.o
at 1: warning 118: option '--fommit-frame-pointer-ÿ' no longer supported  'use --fomit-frame-pointer instead' 
at 1: warning 117: unknown compiler option '--optimize-goto' ignored
/home/pilo/src/mios/mios/trunk/include/c/cmios.h:250: syntax error: token -> 'char' ; column 43
make: *** [_output/main.o] Error 1

(might be a compile flag I didn't set when I compile sdcc from source)

 

To answer you question:

1. Yes it seems it's correct

2. You can also grab the latest code from the svn (svn checkout svn://svnmios.midibox.org/mios if you have svn installed). Then you'll find everything in mios/trunk/)

 

I'll try to fix my setup, and I hope you'll manage to make yours working!

Link to comment
Share on other sites

thx for the try.... i tried "use non free", i got:

crimic@diesmalnet:~/mios/apps/examples/lcd7/dog/c$ make
rm -rf _output/*
rm -rf _output
rm -rf *.cod *.map *.lst
rm -rf *.hex
mkdir -p _output
/bin/share/sdcc /home/crimic/mios/bin/mios-gpasm -c -p p18f452 -I./src -I /home/crimic/mios/include/asm -I /home/crimic/mios/include/share -I /home/crimic/mios/modules/app_lcd/dog -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -I /home/crimic/mios/modules/mios_wrapper /home/crimic/mios/modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o

make: /bin/share/sdcc: Kommando nicht gefunden (English: command not found)
make: *** [_output/mios_wrapper.o] Fehler 127 (English: Error 127)

in /bin are Files only - so no Folder.... but "/usr/share/sdcc" exist --- I dont know what to do with that information!

Edited by Phatline
Link to comment
Share on other sites

asm works, sdcc not:

crimic@sichanet:~/mios/apps/templates/sdcc_skeleton$ make
rm -rf _output/*
rm -rf _output
rm -rf *.cod *.map *.lst
rm -rf *.hex
mkdir -p _output
/bin/share/sdcc /home/crimic/mios/bin/mios-gpasm -c -p p18f452 -I./src -I /home/crimic/mios/include/asm -I /home/crimic/mios/include/share -I /home/crimic/mios/modules/debug_msg -I /home/crimic/mios/modules/app_lcd/dummy -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -I /home/crimic/mios/modules/mios_wrapper /home/crimic/mios/modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o
make: /bin/share/sdcc: Kommando nicht gefunden
make: *** [_output/mios_wrapper.o] Fehler 127

 

crimic@nasicha:~/mios/apps/templates/asm_skeleton$ make
rm -rf *.cod *.lst *.err
rm -rf *.hex
gpasm  -p p18f452  -I./src -I /home/crimic/mios/include/asm -I /home/crimic/mios/include/share -I /home/crimic/mios/modules/app_lcd/dummy  main.asm

 

sdcc version:

sdcc 3.3.0+dfsg-1ubuntu1


 

Edited by Phatline
Link to comment
Share on other sites

You've to use sdcc 2.8.0, please don't try any other version because only this release has been qualified.

A linux version can be downloaded from: http://sourceforge.net/projects/sdcc/files/sdcc-linux-x86/2.8.0/

The package contains a INSTALL.txt file, just follow the instructions.

 

Once SDCC has been installed (e.g. under /usr/local/bin), the "sdcc --version" command should return

SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.8.0 #5117 (Mar 23 2008) (Mac OS X i386)

 

If it returns another string, your PATH variable doesn't reference the correct binary, in this case try to uninstall the other versions that you've installed so far.

 

Once this has been done, the original mios8 makefiles will work without modifications (no need to set special flags etc.)

 

Best Regards, Thorsten.

Link to comment
Share on other sites

hi,

I tried 3.3.0 - dont worked

I also tried 2.9.0 - dont worked

I also tried 2.8.0 - dont worked - proved:

SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.8.0 #5117 (Mar 23 2008) (UNIX)


After that i erased all Flags, after then - a other try: (nope)

crimic@anonymus:~/mios/apps/templates/sdcc_skeleton$ make
rm -rf _output/*
rm -rf _output
rm -rf *.cod *.map *.lst
rm -rf *.hex
mkdir -p _output
/bin/share/sdcc /home/crimic/mios/bin/mios-gpasm -c -p p18f452 -I./src -I /home/crimic/mios/include/asm -I /home/crimic/mios/include/share -I /home/crimic/mios/modules/debug_msg -I /home/crimic/mios/modules/app_lcd/dummy -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -I /home/crimic/mios/modules/mios_wrapper /home/crimic/mios/modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o
make: /bin/share/sdcc: Kommando nicht gefunden
make: *** [_output/mios_wrapper.o] Fehler 127

 

hm

Link to comment
Share on other sites

As mentioned above: you've to use SDCC 2.8.0, no other version will work properly.

 

This message:

make: /bin/share/sdcc: Kommando nicht gefunden

tells you, that the sdcc command hasn't been found under /bin/share/sdcc

This isn't a problem with 2.8.0, but with your unix shell setup.

 

The big question is: why is it searched under /bin/share, and not under /usr/local/bin or wherever you installed sdcc

 

What surprises me:

you are able to retrieve the version - how exactly did you do that?

 

Best Regards, Thorsten.

Link to comment
Share on other sites

well I dont know why it searches under /bin and not in /usr - no clue really

 

how i did that? - i did what you said, i opened the terminal and typed sdcc --version:

crimic@nixgibts:~$ sdcc --version
SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.8.0 #5117 (Mar 23 2008) (UNIX)

 

 

this http://www.midibox.org/dokuwiki/doku.php?id=installing_gputils_and_sdcc_on_ubuntu_8.04

sould be changed --- because if you do so like described

sudo apt-get install sdcc

- it install always the latest version (in my case 3.3.0) - and that may dont work.

 

manually download 2.8.0, unzip anyware, reading the Install.txt, > should do the job

Install.txt says: Change to the sdcc directory and copy all files to /usr/local

cd sdcc
cp -r * /usr/local

This will install sdcc binaries into: /usr/local/bin/
header files into:                          /usr/local/share/sdcc/include/
library files into:                            /usr/local/share/sdcc/lib/
and documentation into:              /usr/local/share/sdcc/doc/

You can test the install by entering:

    /usr/local/bin/sdcc -v

should print:

SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.8.0 #5117 (Mar 23 2008) (UNIX)
Edited by Phatline
Link to comment
Share on other sites

Seems that this wiki page is outdated. It has been written 2009, at this point of time SDCC 2.8.0 was the "latest and greatest" version.

Meanwhile a newer SDCC version is provided by default, but it isn't compatible with MIOS8 anymore.


Hopefully a Linux user who was able to install the tools successfully will update this page, otherwise many people will come across this inconsistent information in future and they will be stucked (like you).

 

However, I'm unsure how I can help you.

 

For me it looks like you did some changes in the original files which come with the MIOS8 repository.

Unfortunately my crystal ball shows only white smoke there ;-)

 

If you enter:

cat $MIOS_BIN_PATH/mios-sdcc

what do you see at the last line?

 

It should be:

sdcc --asm="${MIOS_SHELL} ${MIOS_BIN_PATH}/mios-gpasm -fixasm" $@

If you see something else (e.g. a direct path reference to sdcc), then we found out that you've modified this file... ;)

 

Best Regards, Thorsten.

Link to comment
Share on other sites

the mios is untouched and blank from: http://www.ucapps.de/mios/mios_base_v1_1.zip, i dont changed any app or so, i just typed "make" by some sdcc apps, to try it out

 

@

cat $MIOS_BIN_PATH/mios-sdcc

give:

crimic@nixhak:~$ cat $MIOS_BIN_PATH/mios-sdcc
# $Id: mios-sdcc 444 2008-08-14 21:26:28Z tk $
#
# MIOS specific wrapper for sdcc
#
# Executes sdcc
# Uses "mios-gpasm -fixasm" wrapper to assemble the generated code
#
# Thorsten Klose (2008-02-03)
#
# SYNTAX: mios-sdcc <sdcc-arguments>
#

if [ -z "${MIOS_BIN_PATH:-}" ]; then
  echo "ERROR $0: MIOS_BIN_PATH variable not set!"
  exit 1
fi

sdcc --asm="${MIOS_SHELL} ${MIOS_BIN_PATH}/mios-gpasm -fixasm" $@
Edited by Phatline
Link to comment
Share on other sites

This is not a problem with sdcc install, because here what the makefile is trying to execute :

/bin/share/sdcc /home/crimic/mios/bin/mios-gpasm -c -p p18f452 -I./src -I /home/crimic/mios/include/asm -I /home/crimic/mios/include/share -I /home/crimic/mios/modules/debug_msg -I /home/crimic/mios/modules/app_lcd/dummy -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -I /home/crimic/mios/modules/mios_wrapper /home/crimic/mios/modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o

I don't know why sdcc and mios-gpasm are mixed here, but it should be only :

/home/crimic/mios/bin/mios-gpasm -c -p p18f452 -I./src -I /home/crimic/mios/include/asm -I /home/crimic/mios/include/share -I /home/crimic/mios/modules/debug_msg -I /home/crimic/mios/modules/app_lcd/dummy -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -I /home/crimic/mios/modules/mios_wrapper /home/crimic/mios/modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o

 

edit:

Maybe it's the path to bin that is not correct?

echo $MIOS_BIN_PATH should tell you "/home/crimic/mios/bin"

 

and it seems it's set on "/bin/share/sdcc /home/crimic/mios/bin"

Edited by pilo
Link to comment
Share on other sites

This output would happen if Phatline has set the MIOS_SHELL variable by accident, e.g. to /bin/share/sdcc

 

Actually this variable shouldn't be set at all -. I added this due to a special user request some time ago, but it's more or less a hidden feature and should only be used when you know what you are doing ;-)

 

So Phatline: please enter

unset MIOS_SHELL

and try it again

 

Best Regards, Thorsten.

Link to comment
Share on other sites

crimic@sowiso:~$ which sdcc

/usr/local/bin/sdcc

 

crimic@nixgibts:~$ echo $MIOS_BIN_PATH

/home/crimic/mios/bin

 

unset MIOS_SHELL

 

removed lastest sdcc version and installed sdcc from the link provided by TK

I did the same, i had to manually delete the files, because of manually installing but, hey... it didnt help:

 

after all above I got this:

crimic@naherst:~/mios/apps/templates/sdcc_skeleton$ make

rm -rf _output/*

rm -rf _output

rm -rf *.cod *.map *.lst

rm -rf *.hex

mkdir -p _output

sh /home/crimic/mios/bin/mios-gpasm -c -p p18f452 -I./src -I /home/crimic/mios/include/asm -I /home/crimic/mios/include/share -I /home/crimic/mios/modules/debug_msg -I /home/crimic/mios/modules/app_lcd/dummy -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -I /home/crimic/mios/modules/mios_wrapper /home/crimic/mios/modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o

/home/crimic/mios/bin/mios-gpasm: 24: /home/crimic/mios/bin/mios-gpasm: declare: not found

/home/crimic/mios/bin/mios-gpasm: 27: /home/crimic/mios/bin/mios-gpasm: declare: not found

/home/crimic/mios/bin/mios-gpasm: 37: /home/crimic/mios/bin/mios-gpasm: Syntax error: "(" unexpected (expecting "fi")

make: *** [_output/mios_wrapper.o] Fehler 2

Edited by Phatline
Link to comment
Share on other sites

It helps!

As you can see, the code execution continues and you get a new error.

 

The messages indicate an issue with the shell.

Seems that adding MIOS_SHELL is indeed no expert option, but may be required for your Linux distribution.

 

Could you please try:

export MIOS_SHELL=/bin/bash

Best Regards, Thorsten.

Link to comment
Share on other sites

export MIOS_SHELL=/bin/bash

had done the job!!!!!!!!!!

+ SDCC 2.8.0

 

crimic@JAWOI:~/mios/apps/templates/sdcc_skeleton$ make

rm -rf _output/*

rm -rf _output

rm -rf *.cod *.map *.lst

rm -rf *.hex

mkdir -p _output

/bin/bash /home/crimic/mios/bin/mios-gpasm -c -p p18f452 -I./src -I /home/crimic/mios/include/asm -I /home/crimic/mios/include/share -I /home/crimic/mios/modules/debug_msg -I /home/crimic/mios/modules/app_lcd/dummy -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -I /home/crimic/mios/modules/mios_wrapper /home/crimic/mios/modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o

/bin/bash /home/crimic/mios/bin/mios-gpasm -c -p p18f452 -I./src -I /home/crimic/mios/include/asm -I /home/crimic/mios/include/share -I /home/crimic/mios/modules/debug_msg -I /home/crimic/mios/modules/app_lcd/dummy -DDEBUG_MODE=0   /home/crimic/mios/modules/app_lcd/dummy/app_lcd.asm -o _output/app_lcd.o

/bin/bash /home/crimic/mios/bin/mios-sdcc -c -mpic16 -p18f452 --fommit-frame-pointer --optimize-goto --optimize-cmp --disable-warning 85 --obanksel=2  -I./src -I /home/crimic/mios/include/c -I /home/crimic/mios/include/share -I /home/crimic/mios/modules/debug_msg -DDEBUG_MODE=0  main.c -o _output/main.o

/home/crimic/mios/bin/mios-gpasm modifies _output/main.asm, result in _output/main__mios-gpasm-tmp.asm

/bin/bash /home/crimic/mios/bin/mios-gpasm -c -p p18f452 -I./src -I /home/crimic/mios/include/asm -I /home/crimic/mios/include/share -I /home/crimic/mios/modules/debug_msg -I /home/crimic/mios/modules/app_lcd/dummy -DDEBUG_MODE=0   /home/crimic/mios/modules/debug_msg/debug_msg.asm -o _output/debug_msg.o

gplink -s /home/crimic/mios/etc/lkr/p18f452.lkr -m -o project.hex  /home/crimic/mios/lib/libsdcc.lib /home/crimic/mios/lib/pic18f452.lib _output/mios_wrapper.o _output/app_lcd.o _output/main.o _output/debug_msg.o

 

THHHHHHANX und Danke ---

 

ps: had edit the first Post of this topic - of course only for my own I in the future, when have to do that again....

 

ps2: tama techstar 306 - fired with Mios8 - c - is bouncing its first beats > thx 2 us!

Edited by Phatline
Link to comment
Share on other sites

I'm still struggling to setup my dev env. under Unbuntu 14 (lts)

and, i'm facing this problem : when i $ svn checkout svn://svnmios.midibox.org/mios

 

i have no message at all, its just stuck forever, and there's no error, no timeout, nothing.

I assumed that the problem was temporary, so i tried everyday since a few days, but no change ...

Any idea ? Is there another way to retrieve the svn data ?

 

Also, it would be great to update the wiki application development page, because  "Installing GPUTILS and SDCC on Ubuntu 8.04" is a bit obsolete by now :)

(but i have no idea about how to do it)

Link to comment
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.

Loading...
×
×
  • Create New...