wallage
Posts: 2
Joined: Fri Nov 02, 2012 9:29 am

unable to blink status LED

Fri Nov 02, 2012 9:44 am

Hi,
I have read through the getting started topic on bare metal programming.
I have some knowledge of the assembly and c programming languages.
I can't get the image to run on my raspPi.
I created the files in a virtual machine (virtualbox with ubuntu).
I used crosstool-ng to create a toolchain to compile/assemble/link the whole thing.
In the virtual machine I'am unable to programm my sd-card so I copy the kernel.img to my host OS (win7) and have used both flashnul and win32diskimager to try and programm my sd-card.
So far no luck.
Could anyone help me get this thing to work?
greats.
Attachments
Blink.tar.bz2
(763 Bytes) Downloaded 179 times

hldswrth
Posts: 108
Joined: Mon Sep 10, 2012 4:14 pm

Re: unable to blink status LED

Fri Nov 02, 2012 11:47 am

You should not need to use a disk imager to make the bare metal programs work, although its also possible to take a card that's got a linux distribution on it and overwrite the kernel.img file.
Any blank FAT-formatted SD card (the default) should work fine, you need to copy the boot files and your kernel onto the SD card. These are the minimal set of files you need:

bootcode.bin
loader.bin
start.elf
optionally config.txt if you need to set things like overscan for your screen but not necessary
plus your kernel.img

The latest versions of these files can be downloaded from here:
https://github.com/raspberrypi/firmware ... aster/boot
Click the file name, click the "raw" button then save the file to the SD card (or your hard drive and then copy the files over later).

wallage
Posts: 2
Joined: Fri Nov 02, 2012 9:29 am

Re: unable to blink status LED

Fri Nov 02, 2012 1:21 pm

thanks for the help.
I copied the files start.elf and bootcode.bin + my generated kernel.img to th sd-card and it seems to work. You mentioned the loader.bin but that file in not in the repository any longer and I saw some reports that the functionaltity would be included in bootcode.bin. is this why the file is no longer in de repository?

hldswrth
Posts: 108
Joined: Mon Sep 10, 2012 4:14 pm

Re: unable to blink status LED

Fri Nov 02, 2012 1:28 pm

Glad to hear it is working.
No idea about loader.bin. The README on the firmware page has not been updated to remove mention of it so I don't know what's happened there. The version I have included it as a separate file but all this stuff seems to change every time I look at it.

JacobL
Posts: 76
Joined: Sun Apr 15, 2012 2:23 pm

Re: unable to blink status LED

Sat Nov 03, 2012 10:24 pm

It was removed recently. Here is the log from Git:

commit c57ea9dd367f12bf4fb41b7b86806a2dc6281176
Author: popcornmix <[email protected]>
Date: Sat Oct 20 00:56:15 2012 +0100

Remove plethora of start.elf files.
Now use start.elf and fixup.dat. Add config.txt paramater gpu_mem to select GPU mem and ARM gets the remainder. E.g. gpu_mem=64
Should handle 256M and 512M parts. The start_cd.elf and fixup_cd.dat will be used when gpu_mem=16.
loader.bin no longer needed.
Switch to compressed kernel images.

Edited: Seems my terminal ate some text...

Return to “Bare metal, Assembly language”