dextrus
Posts: 119
Joined: Tue Jan 24, 2012 10:10 pm
Location: Eastleigh, Hampshire
Contact: Website

Re: Test Whether Raspberry Pi Has 512MB RAM

Fri Oct 19, 2012 10:59 pm

The problem is many people will be purchasing their Pis now, with 512Mb ram. The will probably also purchase the pre-configured Raspbian SD card (overpriced!) from Farnell or RS.. Even if they didn't buy the pre-configured card, they would follow the instructions for Raspbian, or OpenELEC or whatever and make their own card and download the .elf files.

As it stands, they will not have access to the extra RAM, and they wouldn't even know they had it. I suspect that only knowledgeable people would have a chance of using the RAM. People that read threads like this.. Not the intended audience.

This then brings on a larger problem. If you wanted to publish or make serious software for the Pi, in my opinion, 5% or so of the market will be 512Mb "aware", This could take many months to solve, unless the <256Mb elf files are fixed immediately.

/Dextrus
Have more FUN with your Pi. Visit www.pi-fun.com

milhouse
Posts: 642
Joined: Mon Jan 16, 2012 12:59 pm

Re: Test Whether Raspberry Pi Has 512MB RAM

Fri Oct 19, 2012 11:19 pm

You're complaining about a problem that has only existed since Monday, less than a week. The update system for Raspbian and other distributions can (and almost certainly will) be modified with support for 512MB models in due course, and longer term a more suitable solution will be found. For the time being however, a manual work around is required (manually copying elf files) to gain access to the full RAM allocation.

Even if Pis are being bought by "ordinary" users (and apparently they are, which is great) I doubt very many of these buyers are buying in total, absolute ignorance - perhaps you should give people a bit more credit.

dextrus
Posts: 119
Joined: Tue Jan 24, 2012 10:10 pm
Location: Eastleigh, Hampshire
Contact: Website

Re: Test Whether Raspberry Pi Has 512MB RAM

Fri Oct 19, 2012 11:35 pm

You should work in PR!

You have a larger problem, in that anyone wanting to publish or promote serious software now has a 95/5% split with an undefined time as to when this problem will be resolved. It's all well and good to say it "will be resolved", but it was an almighty cock-up in the first place, and "resolving" probably means the "removal" or side-lining of the 256Mb model.

Also, what if I or you create something that only works on a 512 model and we want to give it away (I'm close!). What do we do?
Have more FUN with your Pi. Visit www.pi-fun.com

milhouse
Posts: 642
Joined: Mon Jan 16, 2012 12:59 pm

Re: Test Whether Raspberry Pi Has 512MB RAM

Fri Oct 19, 2012 11:57 pm

dextrus wrote: You have a larger problem, in that anyone wanting to publish or promote serious software now has a 95/5% split with an undefined time as to when this problem will be resolved. It's all well and good to say it "will be resolved", but it was an almighty cock-up in the first place, and "resolving" probably means the "removal" or side-lining of the 256Mb model.
"Almighty cock-up in the first place"? Groan, don't be such a drama queen.

Yes, hindsight is a wonderful thing, but it's only been 5 days since the new hardware launched. I also get the distinct impression you're a glass half empty kind of guy, and feel the need to moan for the sake of it.

Of course support for the 256MB hardware isn't going to be removed, there's absolutely no reason for anyone to take such action.
dextrus wrote:Also, what if I or you create something that only works on a 512 model and we want to give it away (I'm close!). What do we do?
Undoubtedly that will happen, perhaps more likely to happen as the 512MB begins to dominate the scene. However if developers want to create software that only works on the 512MB model that is absolutely their choice - I'm sure they will understand the consequences. In most cases however it shouldn't be necessary, even XBMC will continue to work on the 256MB model, albeit with a workaround or two due to the reduced memory.

Edit: And as if by magic...

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5572
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 12:11 am

Updated firmware pushed:
Removed plethora of start.elf files.
Now uses start.elf and fixup.dat.
Add config.txt parameter gpu_mem to select GPU mem and ARM gets the remainder. E.g.

Code: Select all

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 is no longer needed.
I've also switched to compressed kernel images.

Unfortunately rpi-update doesn't understand this yet, so after running rpi-update, run

Code: Select all

sudo sh -c 'cp /root/.rpi-firmware/* /boot'
and then reboot. [edit: corrected]

Feel free to:

Code: Select all

sudo rm /boot/arm*_start.elf

linuxstb
Posts: 77
Joined: Sat Jul 07, 2012 11:07 pm

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 12:35 am

Thanks Dom.

What are the limitations (if any) on the value of gpu_mem ? Does it for example need to be a multiple of 16?

I'm also curious what fixup.dat is for - it seems a shame to need more files, after you cleaned things a little by removing loader.bin

EDIT: Also, is there a default if gpu_mem is missing from config.txt ?

Regards,
Last edited by linuxstb on Sat Oct 20, 2012 12:37 am, edited 1 time in total.

milhouse
Posts: 642
Joined: Mon Jan 16, 2012 12:59 pm

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 12:37 am

Dom, I'm still not sure how this is going to automatically handle a situation where the GPU should be configured with more than 196MB RAM when it is available, eg. XBMC which could use 256MB GPU RAM on a 512MB board, but will have to use less GPU RAM (ie. 128MB) on a 256MB board (and implement a handful of workarounds due to the reduced memory).

XBMC is possibly a bit of an oddity in that it is more sensitive to GPU RAM allocation than other software which most often requires only a fixed GPU RAM allocation, and having more ARM RAM is simply a bonus. However being able to specify different memory splits and having the correct split chosen according to the current hardware model (256 or 512MB) must surely be an advantage, even if it is only seldom used.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5572
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 12:41 am

linuxstb wrote: What are the limitations (if any) on the value of gpu_mem ? Does it for example need to be a multiple of 16?

I'm also curious what fixup.dat is for - it seems a shame to need more files, after you cleaned things a little by removing loader.bin
The fixups are necessary. It's how the memory splits are interpolated.
I don't enforce a multiple of 16. I didn't test non-multiple of 16, but it may work.

BTW the code for generating fixup.dat and applying it is from Eben. He doesn't get the chance to write software much these days, so this is a rarity.

milhouse
Posts: 642
Joined: Mon Jan 16, 2012 12:59 pm

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 12:53 am

So far so good - booted a 512MB device with gpu_mem=16 (free mem 497MB), gpu_mem=196 (free mem 315MB) and gpu_mem=448 (free mem 59MB) without any problems!
Last edited by milhouse on Sat Oct 20, 2012 12:54 am, edited 1 time in total.

linuxstb
Posts: 77
Joined: Sat Jul 07, 2012 11:07 pm

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 12:53 am

dom wrote:The fixups are necessary. It's how the memory splits are interpolated.
I was more wondering about why that data needs to be in a separate file, rather than being embedded within start.elf/start_cd.elf ?

Also, you may have missed my edit to my original question - is there a default if gpu_mem is missing from config.txt?

Thanks.

milhouse
Posts: 642
Joined: Mon Jan 16, 2012 12:59 pm

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 12:57 am

linuxstb wrote:is there a default if gpu_mem is missing from config.txt?
On a 512MB it appears that 64 is the default.

jaromanda
Posts: 93
Joined: Wed Sep 12, 2012 12:33 pm

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 1:23 am

milhouse wrote:Dom, I'm still not sure how this is going to automatically handle a situation where the GPU should be configured with more than 196MB RAM when it is available, eg. XBMC which could use 256MB GPU RAM on a 512MB board, but will have to use less GPU RAM (ie. 128MB) on a 256MB board (and implement a handful of workarounds due to the reduced memory)..
the simplest way to satisfy every contingency clearly and concisely would be to have TWO values in config.txt
e.g:

gpu_mem256=value if 256 version
gpu_mem512=value if 512 version

or

gpu_mem=value for either memory version
gpu_mem512=value of 512 version if different to 256 value
I now own 2 RPi - does that mean I own a circumference?

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 1:42 am

pi@raspberrypi01 ~ $ sudo cp /root/.rpi-firmware/* /boot
cp: cannot stat `/root/.rpi-firmware/*': No such file or directory


This is where I started:

Code: Select all

sudo apt-get update; sudo apt-get upgrade
sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update
sudo chmod +x /usr/bin/rpi-update

sudo rpi-update

Not sure what's going wrong. I get no errors on sudo rpi-update? Any ideas.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

fv+
Posts: 9
Joined: Tue Aug 28, 2012 1:18 am

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 1:46 am

The granularity of 'gpu_mem' is down to 1MB: I tried with the following values of 'gpu_mem': 64, 72, 68, 66, and 65 and by comparing the output of '/proc/meminfo' I can see the difference in each of these cases.
Also on my 256MB RPi, the default for 'gpu_mem' is 64, the same value for the 512MB version.

Thanks again to dom and Eben for the excellent work!

Franco

milhouse
Posts: 642
Joined: Mon Jan 16, 2012 12:59 pm

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 1:47 am

malakai wrote: Not sure what's going wrong. I get no errors on sudo rpi-update? Any ideas.
What output did you get from rpi-update? Have you installed git-core? This is mine (it autodetected a 240/16 split even though I was using 496/16):

Code: Select all

root@raspberrypi:~# rpi-update
Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS
Performing self-update
Autodetecting memory split
Using ARM/GPU memory split of 240MB/16MB
Updating firmware (this will take a few minutes)
Using HardFP libraries
If no errors appeared, your firmware was successfully updated
A reboot is needed to activate the new firmware
and this is what I have in /root/.rpi-firmware after running rpi-update:

Code: Select all

root@raspberrypi:~# ls -la /root/.rpi-firmware/
total 16864
drwxr-xr-x 5 root root    4096 Oct 20 02:02 .
drwx------ 4 root root    4096 Oct 15 15:19 ..
-rw-r--r-- 1 root root   17756 Oct 20 02:02 bootcode.bin
-rw-r--r-- 1 root root   18693 Oct  6 17:53 COPYING.linux
-rw-r--r-- 1 root root    2015 Oct 20 02:02 fixup_cd.dat
-rw-r--r-- 1 root root    5277 Oct 20 02:02 fixup.dat
drwxr-xr-x 8 root root    4096 Oct 20 02:02 .git
-rw-r--r-- 1 root root 2104952 Oct 20 02:02 kernel_cutdown.img
-rw-r--r-- 1 root root 9522048 Oct 20 02:02 kernel_emergency.img
-rw-r--r-- 1 root root 2695192 Oct 20 02:02 kernel.img
-rw-r--r-- 1 root root    1447 Oct  6 17:53 LICENCE.broadcom
drwxr-xr-x 3 root root    4096 Oct  6 17:53 modules
-rw-r--r-- 1 root root     582 Oct  6 17:53 README.md
-rw-r--r-- 1 root root  522536 Oct 20 02:02 start_cd.elf
-rw-r--r-- 1 root root 2347220 Oct 20 02:02 start.elf
drwxr-xr-x 5 root root    4096 Oct  6 17:53 vc
To get it working:

Code: Select all

#(as root)
cd /boot
rm arm*.elf
rm loader.bin
cp /root/.rpi-firmware/start.elf .
cp /root/.rpi-firmware/fixup*.dat .
echo "gpu_mem=XXX" >> ./config.txt
reboot

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 2:04 am

#(as root)
cd /boot
rm arm*.elf
rm loader.bin
cp /root/.rpi-firmware/start.elf .
cp /root/.rpi-firmware/fixup*.dat .
echo "gpu_mem=XXX" >> ./config.txt
reboot
Thanks Milhouse I think I just needed sudo bash to get it to work not sure why
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

zardoz99
Posts: 175
Joined: Fri Jan 13, 2012 2:25 pm
Location: Somewhere in Canada.

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 8:28 am

I'm needing a little clarification here..

If we use using 16M GPU memory, should we overwrite that start.elf and fixup.dat files with the _cd versions or do they both get selectively used depending on the gpu_mem value? (Personally, I can't see how that would work unless start.elf daisy-chains to start_cd.elf).

Z.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26864
Joined: Sat Jul 30, 2011 7:41 pm

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 8:37 am

dextrus wrote:You should work in PR!

You have a larger problem, in that anyone wanting to publish or promote serious software now has a 95/5% split with an undefined time as to when this problem will be resolved. It's all well and good to say it "will be resolved", but it was an almighty cock-up in the first place, and "resolving" probably means the "removal" or side-lining of the 256Mb model.

Also, what if I or you create something that only works on a 512 model and we want to give it away (I'm close!). What do we do?
I'm sorry, but what cockup? What problem?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 8:56 am

malakai wrote:
#(as root)
cd /boot
rm arm*.elf
rm loader.bin
cp /root/.rpi-firmware/start.elf .
cp /root/.rpi-firmware/fixup*.dat .
echo "gpu_mem=XXX" >> ./config.txt
reboot
Thanks Milhouse I think I just needed sudo bash to get it to work not sure why
I had the same issue,
did first sudo su, then cp, that worked for me.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5572
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 9:14 am

zardoz99 wrote: If we use using 16M GPU memory, should we overwrite that start.elf and fixup.dat files with the _cd versions or do they both get selectively used depending on the gpu_mem value? (Personally, I can't see how that would work unless start.elf daisy-chains to start_cd.elf).
It's automatic. No need to rename files in /boot.
bootcode.bin now parses config.txt and based on that chooses which start.elf/fixup.dat files to load.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5572
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 10:24 am

I've updated bootcode.bin. Can now optionally specify, e.g.
gpu_mem_256=128
gpu_mem_512=256
and they override gpu_mem if running on matching sdram sized part.

gpu_mem effectively sets both of these, but can be overridden by the explicit options.

jaromanda
Posts: 93
Joined: Wed Sep 12, 2012 12:33 pm

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 10:26 am

dom wrote:I've updated bootcode.bin. Can now optionally specify, e.g.
gpu_mem_256=128
gpu_mem_512=256
and they override gpu_mem if running on matching sdram sized part.

gpu_mem effectively sets both of these, but can be overridden by the explicit options.
what a brilliant idea I had ... only took you 9 hours to implement it - guess you had to sleep though :D
I now own 2 RPi - does that mean I own a circumference?

Wanderlei
Posts: 79
Joined: Tue Aug 21, 2012 2:01 pm

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 1:31 pm

Where would be the best place to stay up to date with changes like this?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5572
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 1:42 pm

Wanderlei wrote:Where would be the best place to stay up to date with changes like this?
https://github.com/raspberrypi/firmware/commits/master
https://twitter.com/RPF_Dev_Updates

droorzn
Posts: 9
Joined: Sat Oct 20, 2012 3:37 pm

Re: Test Whether Raspberry Pi Has 512MB RAM

Sat Oct 20, 2012 3:51 pm

dom wrote:Updated firmware pushed:
Removed plethora of start.elf files.
Now uses start.elf and fixup.dat.
Add config.txt parameter gpu_mem to select GPU mem and ARM gets the remainder. E.g.

Code: Select all

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 is no longer needed.
I've also switched to compressed kernel images.

Unfortunately rpi-update doesn't understand this yet, so after running rpi-update, run

Code: Select all

sudo sh -c 'cp /root/.rpi-firmware/* /boot'
and then reboot. [edit: corrected]

Feel free to:

Code: Select all

sudo rm /boot/arm*_start.elf
Sorry, i'm new to Linux and i've already fill my SD card with raspbian wheezy. i've downloaded start.elf ,fixup.dat,start_cd.elf and fixup_cd.dat. What should i copy to SD card?
can i ask you few question?
1. What the differences of start.elf and fixup.dat with start_cd.elf and fixup_cd.dat?
2. What is this code means?

Code: Select all

sudo sh -c 'cp /root/.rpi-firmware/* /boot'
and then reboot. [edit: corrected]
Feel free to:

Code: Select all

sudo rm /boot/arm*_start.elf
3. What is "*" in arm*_start.elf? in my SD card there are arm_128_start.elf,arm_192_start.elf,arm_224_start.elf and arm_240_start.elf?

Thanks

Return to “General discussion”