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

Re: Baking Pi

Sat Sep 08, 2012 5:55 am

That's very odd.

Mine shows:

Code: Select all

oscar:os stuart$ which make
/Users/stuart/yagarto-4.7.1/tools/make
oscar:os stuart$ which arm-none-eabi-as
/Users/stuart/yagarto-4.7.1/bin/arm-none-eabi-as
oscar:os stuart$ 

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

Re: Baking Pi

Sat Sep 08, 2012 12:50 pm

I have a question regarding Lesson 5.

I did the code myself, and got bootup flickering, then a solid LED light, rather than the morse code effect. I pored over my code again and again. Then I compared it to the model answer, and it looked very similar.

Still puzzled, I built and ran the model answer and it behaved the same way: bootup flickering, then solid LED. Is this just my rPi or is the model answer wrong?

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: Baking Pi

Sat Sep 08, 2012 5:02 pm

Did you put this:

kernel_old=1

In your config.txt file ?.
Batteries not included, Some assembly required.

iwengier
Posts: 1
Joined: Sun Sep 09, 2012 3:43 am

Re: Baking Pi

Sun Sep 09, 2012 3:50 am

Hi. I could compile Lesson 1: OK01 in ubuntu 12.04. Now I am trying to compile the same lesson directly in the raspi. However, when I try I get

arm-none-eabi-as -I source/ source/main.s -o build/main.o
/home/pi/arm-2008q3/bin/arm-none-eabi-as: 1: /home/pi/arm-2008q3/bin/arm-none-eabi-as: Syntax error: "(" unexpected
make: *** [build/main.o] Error 2

Appreciate any answer. Thanks in advance

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

Re: Baking Pi

Sun Sep 09, 2012 12:15 pm

DexOS wrote:Did you put this:

kernel_old=1

In your config.txt file ?.
no, config.txt doesn't have that line. I haven't had cause to touch my config.txt.

I can replace the kernel.img with stock and it boots fine. I can run Lessons 1 to 4 fine. But if I make clean and make on the model answer for Lesson 5 I still get the same output: solid OK LED

Can someone please confirm their Lesson 5 or the model answer for Lesson 5 works on their pi?

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

Re: Baking Pi

Sun Sep 09, 2012 12:57 pm

iwengier wrote:Hi. I could compile Lesson 1: OK01 in ubuntu 12.04. Now I am trying to compile the same lesson directly in the raspi. However, when I try I get

arm-none-eabi-as -I source/ source/main.s -o build/main.o
/home/pi/arm-2008q3/bin/arm-none-eabi-as: 1: /home/pi/arm-2008q3/bin/arm-none-eabi-as: Syntax error: "(" unexpected
make: *** [build/main.o] Error 2

Appreciate any answer. Thanks in advance
you've installed the x86 gnu arm toolchain on the pi needlessly. It is only for cross compiling from another architecture.

edit the makefile and delete anything after the = on the

Code: Select all

ARMGNU ?=
line and it *should* use the as and ld etc from /usr/bin

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

Re: Baking Pi

Sun Sep 09, 2012 2:12 pm

mister_wavey wrote: Can someone please confirm their Lesson 5 or the model answer for Lesson 5 works on their pi?
(as in the previous post) I also tried building on the pi itself, and got the same behaviour (solid LED - the makefile on the pi works perfectly when you remove the yagarto prefix). To me that probably rules out anything funky on my mac yagarto toolchain. I've successfully compiled and booted to a linux kernel built on the pi, which should rule out anything funky on my pi toolchain...

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: Baking Pi

Sun Sep 09, 2012 4:54 pm

mister_wavey wrote:
DexOS wrote:Did you put this:

kernel_old=1

In your config.txt file ?.
no, config.txt doesn't have that line. I haven't had cause to touch my config.txt.

I can replace the kernel.img with stock and it boots fine. I can run Lessons 1 to 4 fine. But if I make clean and make on the model answer for Lesson 5 I still get the same output: solid OK LED

Can someone please confirm their Lesson 5 or the model answer for Lesson 5 works on their pi?
You must add that to your config.txt file or it will not work, unless you have old bootloader files.
They change the way it boots, 1 to 4 works OK, but 5 will not work.
That's because the offset is wrong, 1 to 4 are ok, but 5 reads the morse code.
Just add the above to your config.txt and see or make a config.txt with that in it.
Batteries not included, Some assembly required.

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

Re: Baking Pi

Sun Sep 09, 2012 5:38 pm

yay! thanks SO much!

can you explain a little more about what changed and why the code was affected?

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: Baking Pi

Sun Sep 09, 2012 5:59 pm

mister_wavey wrote:yay! thanks SO much!

can you explain a little more about what changed and why the code was affected?
Theres info here:
https://github.com/raspberrypi/linux/issues/16
https://github.com/raspberrypi/firmware/issues/36
But the basic is the kernel.img used to be loaded at offset 0x0 and there was a jump in the code to 0x8000, but now its loaded to 0x8000.
So saving 32k in img size.
So that demo code is set to load at zero, but it is loaded to 0x8000, this is OK for some of the demos, but not for 5 and above.
You could just change the start offset to 0x8000 etc and it will run fine.
By add the above to config.txt you make it load to the old address.

See:
relative jumps V absolute jmps
Last edited by DexOS on Sun Sep 09, 2012 6:09 pm, edited 1 time in total.
Batteries not included, Some assembly required.

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

Re: Baking Pi

Sun Sep 09, 2012 6:05 pm

aha crystal clear explanation, thx again.

Graig99
Posts: 12
Joined: Mon Sep 10, 2012 5:59 pm

Re: Baking Pi

Mon Sep 10, 2012 7:16 pm

Hi guys,

I've been looking for something like the Baking Pi tutorials, and I've found them incredibly interesting so far!

However, being a bit of a noob I'm having a bit of trouble installing Yagarto on my MacBook Pro (running OSX Lion 10.7.4) . I've tried installing it many times, following the instructions exactly, and when I execute the command "arm-none-eabi-gcc --version" as per the instructions, I get the following error:
-bash: arm-none-eabi-gcc: command not found
And when I try to compile the example OS, I get the following error:
***s-MacBook-Pro:~ ***$ cd documents/RasPiOS/example01/
***s-MacBook-Pro:example01 ***$ make
arm-none-eabi-ld --no-undefined build/drawing.o build/frameBuffer.o build/gpio.o build/keyboard.o build/mailbox.o build/main.o build/maths.o build/random.o build/systemTimer.o build/tags.o build/terminal.o build/text.o -L. -l csud -Map kernel.map -o build/output.elf -T kernel.ld
make: arm-none-eabi-ld: No such file or directory
make: *** [build/output.elf] Error 1
According to the instructions "If there is no answer, probably the GNU ARM toolchain of YAGARTO was not installed or is not in your PATH", but as I said I followed the instructions and unpacked the Yagarto installer file into home/yagarto/yagarto-4.7.1/ folder, and the bash_profile appears as follows:
export PATH="$PATH:$HOME/yagarto/yagarto-4.7.1/bin"
export PATH="$PATH:$HOME/yagarto/yagarto-4.7.1/tools"
So my questions is, does anyone know what the issue could be? Any help would be GREATLY appreciated, as I really want to get stuck into these tutorials and I have been trying to figure this out for a while (searching forums, trying different things etc.).

Again, sorry for the noob question and I hope I haven't just been really dumb and missed something obvious.

Thanks guys!

Z3r0
Posts: 23
Joined: Wed Sep 05, 2012 7:42 pm

Re: Baking Pi

Mon Sep 10, 2012 8:01 pm

Most likely from error your are on 64bit linux and missing 32 bit libraries, package ia32-libs if i am not mistaking.

uu sorry mac, didn't catch that, still the problem can be same, just don't know what to install on mac :)

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

Re: Baking Pi

Mon Sep 10, 2012 8:07 pm

Type

Code: Select all

echo $PATH
and share the results here

Graig99
Posts: 12
Joined: Mon Sep 10, 2012 5:59 pm

Re: Baking Pi

Mon Sep 10, 2012 8:13 pm

Wow, thanks for the quick responses guys!

When I type "echo $PATH" i get this:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/yagarto/yagarto-4.7.1:/yagarto/yagarto-4.7.1/tools

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

Re: Baking Pi

Mon Sep 10, 2012 8:16 pm

Your yagarto path entries are missing /User/username/ at the start.

Graig99
Posts: 12
Joined: Mon Sep 10, 2012 5:59 pm

Re: Baking Pi

Mon Sep 10, 2012 8:24 pm

My apologies Mister_Wavey, I actually get this when I type "echo $PATH" (I was missing user/username because I was messing around with the bash file in my vain attempts to get it to work! :D ):
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/cwilde99/yagart:/Users/cwilde99/yagarto/yagarto-4.7.1/tools

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

Re: Baking Pi

Mon Sep 10, 2012 8:28 pm

That still looks wrong.. The first yagarto entry is cut off...

Graig99
Posts: 12
Joined: Mon Sep 10, 2012 5:59 pm

Re: Baking Pi

Mon Sep 10, 2012 9:00 pm

I deleted all of the yagarto files (even though they all had their "o" on the end of them) and reinstalled again, and now I don't have any cut off yagartos, but i still get the error. Here is my echo $PATH now:
:/Users/cwilde99/yagarto/yagarto-4.7.1/tools:/usr/X11/bin:/Users/cwilde99/yagarto/yagarto-4.7.1/bin
Can you see anything else wrong?

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

Re: Baking Pi

Mon Sep 10, 2012 9:04 pm

you definitely installed them in your home directory? prove it with

Code: Select all

ls -ld ~/yagarto
and if you get no such file or directory, you installed them somewhere else, and your PATH needs to match that.

Graig99
Posts: 12
Joined: Mon Sep 10, 2012 5:59 pm

Re: Baking Pi

Mon Sep 10, 2012 9:07 pm

I get this as a reply:
drwxr-xr-x 5 cwilde99 staff 170 10 Sep 21:53 /Users/cwilde99/yagarto

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

Re: Baking Pi

Mon Sep 10, 2012 9:11 pm

ok, installation looks good. path looks good. try typing

Code: Select all

arm-none-eabi-as 
or run the makefile again.

Graig99
Posts: 12
Joined: Mon Sep 10, 2012 5:59 pm

Re: Baking Pi

Mon Sep 10, 2012 9:16 pm

When I type "arm-none-eabi-gcc" I get:
-bash: arm-none-eabi-gcc: command not found
And when I run the makerfile I get:
Craig-Wildes-MacBook-Pro:~ cwilde99$ cd documents/RasPiOS/example01/
Craig-Wildes-MacBook-Pro:example01 cwilde99$ make
arm-none-eabi-ld --no-undefined build/drawing.o build/frameBuffer.o build/gpio.o build/keyboard.o build/mailbox.o build/main.o build/maths.o build/random.o build/systemTimer.o build/tags.o build/terminal.o build/text.o -L. -l csud -Map kernel.map -o build/output.elf -T kernel.ld
make: arm-none-eabi-ld: No such file or directory
make: *** [build/output.elf] Error 1

Graig99
Posts: 12
Joined: Mon Sep 10, 2012 5:59 pm

Re: Baking Pi

Mon Sep 10, 2012 9:18 pm

Sorry I meant "when I run "arm-none-eabi-as"".

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

Re: Baking Pi

Mon Sep 10, 2012 9:24 pm

what does

Code: Select all

which make
show? does

Code: Select all

make clean && make
fix anything?

Plus, are you using the correct makefile template for the lesson? The initial lessons don't use the csud one, but I can see you're not on an early lesson from the source files involved...

Return to “Bare metal”

Who is online

Users browsing this forum: No registered users and 1 guest