EdwinJ85
Posts: 270
Joined: Wed Feb 01, 2012 4:44 pm
Contact: Website

Re: Baking Pi

Thu Sep 06, 2012 2:23 pm

You need to put the source folder in the same place as the build folder is, and make sure you have unzipped everything.

Have you tried watching my youtube video posted above? I give a rough explanation of what I did on it. I could do a more in depth step by step one if it would help you?
Hello!

User avatar
mister_wavey
Posts: 98
Joined: Sun Sep 02, 2012 8:23 am
Location: Abergavenny, Wales, UK
Contact: Website

Re: Baking Pi

Thu Sep 06, 2012 2:30 pm

can you confirm that your 'source' directory is under the template directory?

Is the main.s inside the source directory?

are you sure everything is lowercase?

jeffhaddow
Posts: 118
Joined: Thu Jun 14, 2012 1:50 pm

Re: Baking Pi

Thu Sep 06, 2012 2:33 pm

When you say "under2 do you mean "in" ?

User avatar
mister_wavey
Posts: 98
Joined: Sun Sep 02, 2012 8:23 am
Location: Abergavenny, Wales, UK
Contact: Website

Re: Baking Pi

Thu Sep 06, 2012 2:38 pm

yes 'in'. We usually view directories/folders in a hierarchy, so we often use the terms 'under' etc.

The folder containing the makefile should have a 'build' folder and 'source' folder inside it.

jeffhaddow
Posts: 118
Joined: Thu Jun 14, 2012 1:50 pm

Re: Baking Pi

Thu Sep 06, 2012 2:43 pm

running make in C:\baremetal\template> with a subdirectorey in this directory called source which contains main.s I get the error
Fatal Error: can't create build/main.o: No such file or directory
Make: *** [build/maon.0] Error 1

Jeff

User avatar
mister_wavey
Posts: 98
Joined: Sun Sep 02, 2012 8:23 am
Location: Abergavenny, Wales, UK
Contact: Website

Re: Baking Pi

Thu Sep 06, 2012 2:47 pm

that error is saying there is no directory called 'build' in your template directory. Can you check? Can you paste here the contents of that directory? type 'dir' to see the contents.

jeffhaddow
Posts: 118
Joined: Thu Jun 14, 2012 1:50 pm

Re: Baking Pi

Thu Sep 06, 2012 2:52 pm

Dir .
Dir ..
file 778 kernel,ld
file 1,077 LICENSE
file 1,756 makefile
Dir source

User avatar
mister_wavey
Posts: 98
Joined: Sun Sep 02, 2012 8:23 am
Location: Abergavenny, Wales, UK
Contact: Website

Re: Baking Pi

Thu Sep 06, 2012 2:54 pm

ok, the build directory has vanished. Just create a new one like you created the source one.

jeffhaddow
Posts: 118
Joined: Thu Jun 14, 2012 1:50 pm

Re: Baking Pi

Thu Sep 06, 2012 3:02 pm

Ok -- that seems to have worked -- I now have to write it onto the SD card the one I have has the old image debian6-19-04-2012
Will I need to update this to Raspian?

Jeff

User avatar
mister_wavey
Posts: 98
Joined: Sun Sep 02, 2012 8:23 am
Location: Abergavenny, Wales, UK
Contact: Website

Re: Baking Pi

Thu Sep 06, 2012 3:04 pm

I don't think so. Just rename the kernel.img on the SD card to kernel_old.img then copy your newly created one onto the SD Card.

jeffhaddow
Posts: 118
Joined: Thu Jun 14, 2012 1:50 pm

Re: Baking Pi

Thu Sep 06, 2012 3:17 pm

Thanks for taking the time to sort this out Mister_wavey

The program works OK now.

All the best
Jeff

martk20
Posts: 36
Joined: Fri Jan 27, 2012 10:42 am

Re: Baking Pi

Thu Sep 06, 2012 3:38 pm

jeffhaddow wrote:No still can't fathom this get error :

arm-none-eabi-ld --no-undefined -Map kernel.map -o build/output.elf -T kernel.ld
arm-none-eabi-ld: no input files
Make: *** [build/output.elf] Error 1

all the best
Jeff
--- fed up with microsoft programming :roll:




I am having very similar problems to jeffhaddow. I have got my path problem and the source directory sorted out. I have even downloaded the answer and tried to compile the main.s from that. Still I get the same errors. I use openSuse linux. My cli output when I try to compile is as follows:-
"[email protected]:~/pitemps/template_csud> make
arm-none-eabi-as -I source/ source/main.s -o build/main.o
make: arm-none-eabi-as: Command not found
make: *** [build/main.o] Error 127
[email protected]:~/pitemps/template_csud>"
I am at a loss as to where to go next

User avatar
mister_wavey
Posts: 98
Joined: Sun Sep 02, 2012 8:23 am
Location: Abergavenny, Wales, UK
Contact: Website

Re: Baking Pi

Thu Sep 06, 2012 3:44 pm

your error: make: arm-none-eabi-as: Command not found

means that make still isn't finding your toolchain in the path.

can you echo $PATH and see if it contains 2 dirs for yagarto tools and bin?

User avatar
Chadderz
Posts: 64
Joined: Thu Aug 30, 2012 12:50 pm
Location: Cambridge, UK

Re: Baking Pi

Thu Sep 06, 2012 3:49 pm

Alternatively this can be caused on a 64 bit linux without 32 bit compatibility libraries. Try:

Code: Select all

sudo apt-get install ia32-libs

martk20
Posts: 36
Joined: Fri Jan 27, 2012 10:42 am

Re: Baking Pi

Thu Sep 06, 2012 5:18 pm

mister_wavey wrote:your error: make: arm-none-eabi-as: Command not found

means that make still isn't finding your toolchain in the path.

can you echo $PATH and see if it contains 2 dirs for yagarto tools and bin?
I am using the linux gnu toolchain so no yagarto. Here is the output from echo $PATH
"[email protected]:~>
echo $PATH
/arm-2008q3:/arm-2008q3:/usr/NX/bin:/home/martin/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib64/jvm/jre/bin
[email protected]:~> "
I don't know why /arm-2008q3 is in twice. You are correct my system is not seeing the toolchain. Everthing seems to be correct.

martk20
Posts: 36
Joined: Fri Jan 27, 2012 10:42 am

Re: Baking Pi

Thu Sep 06, 2012 6:11 pm

Chadderz wrote:Alternatively this can be caused on a 64 bit linux without 32 bit compatibility libraries. Try:

Code: Select all

sudo apt-get install ia32-libs
The ia32 libs do not seem to be available in any of the opensuse repositories. The only ia32-libs I can find anywhere seem to be associated with nvidia graphics drivers. Are these the libs you had in mind?

User avatar
mister_wavey
Posts: 98
Joined: Sun Sep 02, 2012 8:23 am
Location: Abergavenny, Wales, UK
Contact: Website

Re: Baking Pi

Thu Sep 06, 2012 6:22 pm

Did you untar your toolchain as root? Looks like it ended up in /
if so, no one else will be able to read it.

If it didn't end up in / then you need to edit your PATH to say where it really is. Plus it looks like you missed the /bin part of the arm2008q3 path

maybe follow http://www.cl.cam.ac.uk/freshers/raspbe ... l#gnulinux again?

martk20
Posts: 36
Joined: Fri Jan 27, 2012 10:42 am

Re: Baking Pi

Thu Sep 06, 2012 6:55 pm

mister_wavey wrote:Did you untar your toolchain as root? Looks like it ended up in /
if so, no one else will be able to read it.

If it didn't end up in / then you need to edit your PATH to say where it really is. Plus it looks like you missed the /bin part of the arm2008q3 path

maybe follow http://www.cl.cam.ac.uk/freshers/raspbe ... l#gnulinux again?
Yippee it worked. Your last comments did the trick. I corrected the PATH and put /bin on the end.Thanks for your help. I am sure there will be further problems as I progress with the course.

EdwinJ85
Posts: 270
Joined: Wed Feb 01, 2012 4:44 pm
Contact: Website

Re: Baking Pi

Fri Sep 07, 2012 8:30 am

I'm pretty sure we will all have problems as this is assembly after all, the only thing harder is machine code (00011000 etc).

As long as we keep together and provide answers when we ask each other, we stand a far greater chance of success than going it alone!
Hello!

mr_arc
Posts: 5
Joined: Fri Sep 07, 2012 12:50 pm

Re: Baking Pi

Fri Sep 07, 2012 12:53 pm

Chadderz wrote:Alternatively this can be caused on a 64 bit linux without 32 bit compatibility libraries. Try:

Code: Select all

sudo apt-get install ia32-libs
Thank-you for this. I was having the same issue whilst trying this under OSX, frustrated I tried it on my headless Ubuntu 10.04 LTS server and got the same error.

Just installed the ia32 libs on the Ubuntu box and it's compiling now.

I'll have to see if there's something similar for using it on OSX.

Off to light my LED now :D

User avatar
mister_wavey
Posts: 98
Joined: Sun Sep 02, 2012 8:23 am
Location: Abergavenny, Wales, UK
Contact: Website

Re: Baking Pi

Fri Sep 07, 2012 1:10 pm

what error did you get under OSX? I didn't have any trouble on MBP running 10.8.1

mr_arc
Posts: 5
Joined: Fri Sep 07, 2012 12:50 pm

Re: Baking Pi

Fri Sep 07, 2012 1:15 pm

I don't have my MBP with me at the moment, I'll try it later and let you know. Encouraging to hear it *should* work fine on OSX though, as I use that as my primary dev machine.

mr_arc
Posts: 5
Joined: Fri Sep 07, 2012 12:50 pm

Re: Baking Pi

Fri Sep 07, 2012 6:31 pm

Code: Select all

arm-none-eabi-as -I source/ source/main.s -o build/main.o
make: arm-none-eabi-as: Command not found
make: *** [build/main.o] Error 127
and then I tried manually entering that command, just to see what would happen

Code: Select all

arc$ arm-none-eabi-as -I source/ source/main.s -o build/main.o
source/main.s: Assembler messages:
source/main.s:43: Error: bad instruction `arm-none-eabi-ld --no-undefined build/main.o-Map kernel.map-o build/output.elfkernel.ld'
I have an 'output.elf' in /build/

Code: Select all

arc$ arm-none-eabi-gcc --versionarm-none-eabi-gcc (GCC) 4.7.1
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
That suggests to me that the $path is correct and that the compiler is there.

~/.bash_profile looks like this;

Code: Select all

export PATH="$PATH:~/Work/pi/asm/yagarto/yagarto-4.7.1/bin"
export PATH="$PATH:~/Work/pi/asm/yagarto/yagarto-4.7.1/tools"
Any ideas?

User avatar
mister_wavey
Posts: 98
Joined: Sun Sep 02, 2012 8:23 am
Location: Abergavenny, Wales, UK
Contact: Website

Re: Baking Pi

Fri Sep 07, 2012 6:52 pm

hmm. just for completeness, do a
which make
and
which arm-none-eabi-as

mr_arc
Posts: 5
Joined: Fri Sep 07, 2012 12:50 pm

Re: Baking Pi

Fri Sep 07, 2012 9:25 pm

they didn't return any output

Return to “Bare metal, Assembly language”