Page 1 of 1

Baking Pi Required Files

Posted: Thu Sep 13, 2012 2:35 am
by emcsquirreled
I am trying to separate my Raspbian and my Baking Pi OS's onto different SD cards. Thus, I copied the following files from my current SD card to the new one:
  • loader.bin
    bootcode.bin
    start.elf
    config.txt
    kernel.img
The kernel (which is Baking Pi OK05) boots just fine one the Raspbian card, but fails to do anything on the new SD card. What did I miss? The old card was 2GB, and the new card is 16MB. Could this cause a problem?

Re: Baking Pi Required Files

Posted: Thu Sep 13, 2012 4:04 am
by badut
What's in your config.txt?
Does it do anything if you just put test_mode=1 in your config.txt?

Also try getting the latest firmware from https://github.com/raspberrypi/firmware
And checking that your SD card is formatted as FAT.

(btw, is it really 16Mb? or did you mean 16Gb?)

Re: Baking Pi Required Files

Posted: Thu Sep 13, 2012 4:13 pm
by emcsquirreled
badut wrote:What's in your config.txt? Does it do anything if you just put test_mode=1 in your config.txt?
I just had a kernel_old=1 line. Adding a test_mode=1 line makes it all work. What does this change? The kernel_old should call the old-version bootloader code, so what does test_mode change?
badut wrote:(btw, is it really 16Mb? or did you mean 16Gb?)
I really meant 16Mb. All my kernels so far have been so small that this should work. I am trying to find a use for an old SD card, and protecting my main Raspbian card seemed like a good idea. Especially when I get around to implementing a filesystem...

Re: Baking Pi Required Files

Posted: Thu Sep 13, 2012 6:20 pm
by DexOS
emcsquirreled wrote:
badut wrote:What's in your config.txt? Does it do anything if you just put test_mode=1 in your config.txt?
I just had a kernel_old=1 line. Adding a test_mode=1 line makes it all work. What does this change? The kernel_old should call the old-version bootloader code, so what does test_mode change?
badut wrote:(btw, is it really 16Mb? or did you mean 16Gb?)
I really meant 16Mb. All my kernels so far have been so small that this should work. I am trying to find a use for an old SD card, and protecting my main Raspbian card seemed like a good idea. Especially when I get around to implementing a filesystem...
There could be the problem, it most likely not formating it as fat32, but fat16.
Make sure it is formated fat32.
I am sure i read Fat32 format requires 512MB min ?.

Re: Baking Pi Required Files

Posted: Thu Sep 13, 2012 8:28 pm
by emcsquirreled
DexOS wrote:There could be the problem, it most likely not formating it as fat32, but fat16.
Make sure it is formated fat32.
I am sure i read Fat32 format requires 512MB min ?.
According to the Disk Utility in Ubuntu 10.04 LTS:

Code: Select all

Partition Type: W95 FAT32 (LBA) (0x0c)
Type: FAT (16-bit version)
Capacity: 15MB (14,892,544 bytes)
So I guess the 512MB is not a requirement, but a recommendation. 15MB is WAY too small to do much with, but it is currently blinking away a SOS from Baking Pi's OK05 tutorial. This card is going to become the heart of a robotics controller, so it really does not need anything more intensive than GPIO access, register manipulation, and a bit of a stack.

The problem was with the config.txt. It must look like this in order to run:

config.txt

Code: Select all

kernel_old=1
test_mode=1
What does the test_mode flag do? I have not been able to find an explanation as to why it causes everything to go.

Re: Baking Pi Required Files

Posted: Thu Sep 13, 2012 8:52 pm
by DexOS
emcsquirreled wrote:
DexOS wrote:There could be the problem, it most likely not formating it as fat32, but fat16.
Make sure it is formated fat32.
I am sure i read Fat32 format requires 512MB min ?.
According to the Disk Utility in Ubuntu 10.04 LTS:

Code: Select all

Partition Type: W95 FAT32 (LBA) (0x0c)
Type: FAT (16-bit version)
Capacity: 15MB (14,892,544 bytes)
So I guess the 512MB is not a requirement, but a recommendation. 15MB is WAY too small to do much with, but it is currently blinking away a SOS from Baking Pi's OK05 tutorial. This card is going to become the heart of a robotics controller, so it really does not need anything more intensive than GPIO access, register manipulation, and a bit of a stack.

The problem was with the config.txt. It must look like this in order to run:

config.txt

Code: Select all

kernel_old=1
test_mode=1
What does the test_mode flag do? I have not been able to find an explanation as to why it causes everything to go.
test_mode=1 is a test done when the boards where at the factory, it displays a image on screen and plays a sound, but it must do other stuff too, if it will not boot without it.

Note: if you remove the kernel.img and put ear phones in you will see and hear the sound played.

Also it does say "Type: FAT (16-bit version)" which is fat16, as well fat32 :? and its possible that "test_mode" lets it boot Fat16.

Re: Baking Pi Required Files

Posted: Thu Sep 13, 2012 8:55 pm
by emcsquirreled
Hmm. I'll play around with it some more, but I'm afraid I am a little too new to all of this to actually get to the bottom of this. We'll see...

Re: Baking Pi Required Files

Posted: Thu Sep 13, 2012 11:37 pm
by badut
FWIW, I'm pretty sure I formatted my card as FAT (as opposed to FAT32).
I put the latest firmware files on there, created a config.txt with kernel_old=1 and never had a problem (just finished Baking Pi Screen01).
I don't need to have test_mode=1
I'm using a 1Gb card. But I don't think 16Mb is a problem because apparently quite a few people are using them: http://sirlagz.net/2012/07/31/how-to-ru ... b-sd-card/

BTW: You mentioned you are planning to implement a file system. Have you got technical info on how that could be done? I'm trying to find out how I can read/write to the SD card.

Re: Baking Pi Required Files

Posted: Thu Sep 13, 2012 11:58 pm
by emcsquirreled
badut wrote:FWIW, I'm pretty sure I formatted my card as FAT (as opposed to FAT32).
I put the latest firmware files on there, created a config.txt with kernel_old=1 and never had a problem (just finished Baking Pi Screen01).
I don't need to have test_mode=1
It would seem that the test_mode flag *should* be unnecessary. I'm beginning to suspect something else is wrong, but I have not found it yet. Still looking...
badut wrote:BTW: You mentioned you are planning to implement a file system. Have you got technical info on how that could be done? I'm trying to find out how I can read/write to the SD card.
I have zero technical data, besides the fact that some folks on this forum have mentioned either doing it or planning on doing it in the future. I am still learning how to think in ASM, so the filesystem is curently on a back-burner status. If I get one working, I'll probably throw it up here for people to take a look at, but don't hold your breath! ;)

Re: Baking Pi Required Files

Posted: Fri Sep 14, 2012 12:39 am
by emcsquirreled
Well, not sure what I did, but I just bricked my 16MB SD card. I thoughtlessly removed the Raspbian SD card from the Pi while it was running (YIKES!!! :shock: ), inserted the BakingPi SD card loaded with OK05, and... nothing. I get some flickers on the OK LED during the boot (a long pulse, a little shorter pulse, and then a really fast pulse), but no SOS. I have reformatted the SD card 3 or 4 times, remade the kernel, checked several different config.txt setups, and nothing seems to revive the card. Any thoughts?

Re: Baking Pi Required Files

Posted: Fri Sep 14, 2012 1:40 am
by dwelch67
using windows or linux to format the card? HP has a good usb drive formatting tool that tends to do a good job, on linux you can do things like use dd if=/dev/zero to wipe out the file system. It may be gone though there may be something below the filesystem layer, something in hardware that might be upset...

Re: Baking Pi Required Files

Posted: Fri Sep 14, 2012 5:26 am
by badut
Does the 16Mb still work on other computers? can write and read data from windows machine for example?
That might help diagnose if it's toast.
Dun worry, you can get a new one 100 times bigger for a few bucks.

Even if it's not toast, it might be worth trying another card just to save you this time. ;)

Re: Baking Pi Required Files

Posted: Fri Sep 14, 2012 1:48 pm
by emcsquirreled
dwelch67 wrote:using windows or linux to format the card? HP has a good usb drive formatting tool that tends to do a good job, on linux you can do things like use dd if=/dev/zero to wipe out the file system. It may be gone though there may be something below the filesystem layer, something in hardware that might be upset...
I was using an Ubuntu GUI program called Disk Utility. I am going to try again today with dd, as it might do something differently (it takes longer than the GUI app, so it must be doing something...)
badut wrote:Does the 16Mb still work on other computers? can write and read data from windows machine for example?
That might help diagnose if it's toast.
Dun worry, you can get a new one 100 times bigger for a few bucks.

Even if it's not toast, it might be worth trying another card just to save you this time. ;)
The funny thing is, Ubuntu recognizes it, lets me reformat it, reads and writes files without complaining, and treats it just like it should. It is only the Pi which doesn't like it. This is strange, as it is the other SD card which got removed while powered on. That card still boots Raspbian just fine, but the card I inserted AFTER pulling the plug did not work, despite the fact that it had booted earlier and had not been changed.

Re: Baking Pi Required Files

Posted: Fri Sep 14, 2012 1:59 pm
by dwelch67
If I remember right I think it is the beagleboard folks that have a page on preparing the sd card for their system. Some low level linux stuff related to sectors and such, maybe dig that up and try it on your sd card maybe it will overwrite/repair what you are seeing.

Re: Baking Pi Required Files

Posted: Fri Sep 14, 2012 2:34 pm
by tufty
Rather than pissing about formatting with Ubuntu and trying to work out the wierd track/sector calculations for SD cards, you may well find the easiest option is to format it using a digital camera. This, in my experience, almost always works.

Simon

Re: Baking Pi Required Files

Posted: Fri Sep 14, 2012 3:33 pm
by inder
This brings up another question. What's the safe, recommended way of shutting down the Pi after a bare metal boot? Something along the lines of halt in Raspbian.

Re: Baking Pi Required Files

Posted: Sat Sep 15, 2012 7:13 am
by tufty
With the current state of bare metal dev, it's not much of a problem - there's no writes to the card. Once we have filesystem writes going on, a sync / sync / sync / halt sequence is gonna be needed.

Simon