romell
Posts: 25
Joined: Mon Jul 23, 2012 6:57 pm

Re: Baking Pi

Tue Sep 04, 2012 9:37 pm

tufty wrote:The downside, obviously, is that you lose 32k, and have to write a little loop to shove your vector table into place.
Well, you don't have to move it. It can be placed anyware. Just set the base address with:

Code: Select all

.global set_vector_base
set_vector_base:
	MCR p15, 0, r0, c12, c0, 0
	bx lr

blavery
Posts: 95
Joined: Sun Jul 01, 2012 2:57 am
Location: QLD. Australia

Re: Baking Pi

Wed Sep 05, 2012 11:26 am

Chadderz wrote:Alternatively, add kernel_old=1 to the config.txt, and if that fails hdmi_safe=1.
Just got back to this tonight.
kernel_old=1 makes it work. Yay.

Also (ought to be obvious, really), I found I needed to do all screen0x & input0x lessons with HDMI screen. For me the RCA/AV screen blocks at "pointerWait$" in InitialiseFrameBuffer. Maybe could use a note in your lesson to warn against trying with AV screen.
(Commonly I use a tiny AV screen on the pi "just cos", and otherwise treat the pi as headless. Setting on the family TV for HDMI mode is only for when really needed. Caught me out here!)

As said earlier, this series is really great. Thanks.

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

Re: Baking Pi

Wed Sep 05, 2012 11:29 am

Actually, it should work fine with AV (does for me). Does my solution to Screen01 not work with your setup?

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

Re: Baking Pi

Wed Sep 05, 2012 3:01 pm

I agree with Chadderz, it should make no difference, i have not tested Chadderz tut with AV, but have my own code and it should work with both, some time you can get problems with it only working with av, and not with HDMI.
Just in case, have you tried setting the screen res to 640x480 in the code ?, to see if that helps.
Batteries not included, Some assembly required.

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

Re: Baking Pi

Thu Sep 06, 2012 9:49 am

I've got to say I love these tutorials so far. I've never touched assembly before but even I managed to get the first two tutorials working:

http://www.youtube.com/watch?v=OzfA0IgtrPE&feature=plcp

Thanks very much to alex for this, I do wonder how far I can go with this. As a primarily c# / managed coder it's quite refreshing to work with native code and to a) understand it and b) make it do what I wanted it to do.

I'm probably far too old to be the target of this course, but I appreciate the sentiment/goals all the same. :)
Hello!

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: Baking Pi

Thu Sep 06, 2012 9:56 am

EdwinJ85 wrote: I'm probably far too old to be the target of this course, but I appreciate the sentiment/goals all the same. :)
We welcome learners, hackers and tinkerers of any age :)

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 9:58 am

I'm loving it too. Seeing the LED flash at the end of lesson 2 (and understanding why) was a real rush :)

Thanks so much for these.

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

Re: Baking Pi

Thu Sep 06, 2012 10:18 am

I have been having a go at the course. As always happens when I try to compile anything. I get lots of errors. I have typed the main.s file exactly as per course. When I type make I get the following:-"
arm-none-eabi-ld --no-undefined -L. -l csud -Map kernel.map -o build/output.elf -T kernel.ld
make: arm-none-eabi-ld: Command not found
make: *** [build/output.elf] Error 127"
I was in the directory in which the main.s file exists. What am I doing wrong?

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 10:24 am

lesson 1 says to install the gnu toolchain, which your error suggests, you are missing.

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

Re: Baking Pi

Thu Sep 06, 2012 10:28 am

I think I have installed the gnu toolchain as instructed.

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 10:30 am

OK, looks like it just isn't in your path then. What platform are you on? Windows/mac/linux?

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

Re: Baking Pi

Thu Sep 06, 2012 10:40 am

mister_wavey wrote:OK, looks like it just isn't in your path then. What platform are you on? Windows/mac/linux?
I am on linux opensuse 12.1. I am confused about which directory is the source directory. I have put my main.s file in the template_csud directory. Is this correct? Does it matter?. Also when compiling which is the parent directory?

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 10:44 am

you need to create a 'source' directory inside the template one (the tutorial didn't really make that clear). Your main.s needs to be moved inside that source directory. The parent directory (where you type 'make') is the top one you're in (or make would complain there is no makefile found).

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

Re: Baking Pi

Thu Sep 06, 2012 10:50 am

mister_wavey wrote:you need to create a 'source' directory inside the template one (the tutorial didn't really make that clear). Your main.s needs to be moved inside that source directory. The parent directory (where you type 'make') is the top one you're in (or make would complain there is no makefile found).
OK now I think I understand. You were right about my path the arm-2008q3 has gone into my root path not my home path. I now have something to work on thanks.

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

Re: Baking Pi

Thu Sep 06, 2012 11:09 am

I was having similar problems, so I just compiled with the windows tools instead of linux. A cop out I know, but I'm just after a working kernel.img file from a text file, I don't need to be too picky how I get there. YMMV.

I was also thrown about where the 'source' directory was to be placed, but I downloaded the completed samples to check. I would recommend this for most problems - if you compare your work against what is CERTAIN to work, it helps immensely, at least for the first two lessons.
Hello!

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

Re: Baking Pi

Thu Sep 06, 2012 11:55 am

While Installing cdt-master-7.0.2.zip! from the Eclpise program I got the following Error massage.

An error occurred while collecting items to be installed
session context was:(profile=SDKProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Comparison method violates its general contract!
Comparison method violates its general contract!

The program that I am using is Eclipse SDK Version 3.6.2

Can Somone tell me how to fix this. I tried deleting and reloading the cdt-master-7.0.2.zip! file and this did not help so I presume that the file is not corrupt.

all the best
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 12:00 pm

for windows, I suspect you don't *need* the IDE part - I'll bet you can do it all on the commandline with just the yagarto tools and gnu toolchain. I certainly didn't install the IDE for running this on the mac.

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

Re: Baking Pi

Thu Sep 06, 2012 12:08 pm

I don not understand "IDE Part". I'm a beginner at this and find the "YAGARTO" website very unhelpful to say the least. :(

All the best
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 12:54 pm

according to the Baking Pi installation instructions, you use http://www.yagarto.de/#download to download the assembler toolchain for your platform.

For windows, there are three packages in the table of download packages on the webpage: try using just the first two. The IDE (Integrated Development Environment) part is optional (I strongly suspect. I'm using a mac so can't confirm for sure). The errors in your original post above are only related to this third part, which hopefully you can simply ignore by bypassing it. Just run the installers you downloaded for package 1 and 2 in that table, and then if you can type 'make' (without quotes) in a windows command window and it says anything other than 'make is not recognized...' then you're probably ready to start lesson 1.

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

Re: Baking Pi

Thu Sep 06, 2012 1:00 pm

Thanks Mister_wavey

I was expecting a program installed in windows, but I now see that the program is installed in the CMD environment.

All the best
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 1:10 pm

one thing to watch out for when writing source files on windows is to make sure the editor (e.g. notepad) doesn't add a .txt extension to your files, or the makefile won't be able to find the file you want it to compile. Use 'dir' in the command window to look at the created filename to be sure.

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

Re: Baking Pi

Thu Sep 06, 2012 1:39 pm

To confirm, you do not need eclipse, I did not use it. Considering the very serious security flaws java has at the moment I would uninstall java anyway atm, or at least disable it in every single browser you use.

Download an run both YAGARTO executables, create the main file as a text file, change the extension from .txt to .s and open/edit it with notepad++, this will prevent the inbuilt windows notepad from breaking everything. http://notepad-plus-plus.org/

When you are ready to compile, press the windows key + r, type in '"cmd" and press ok. Navigate to the parent directory of the source folder with the command "cd (directory path)" and then type in "make" and press return. This will create the kernel.img file which you can put on the SD card - make sure to install a normal raspbian os first and replace the existing kernel.img file because you need more than just the kernel to run everything.
Hello!

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

Re: Baking Pi

Thu Sep 06, 2012 1:55 pm

Source folder???

Do we create a "source" folder or is one there already? I get an error 1 trying to use make

All the best
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 1:58 pm

create one. and move your main.s into there.

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

Re: Baking Pi

Thu Sep 06, 2012 2:15 pm

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:

Return to “Bare metal, Assembly language”