Page 13 of 18

Re: The Raspberry Pi 2 Q&A thread

Posted: Sun Feb 08, 2015 1:47 pm
by joan
Mausy5043 wrote: ...
Your earlier post suggested that it is possible to distiguish between the different hardware versions.
Now, I understand that one can really only distighuish between the Pi 2 on the one hand and [ A/A+/B/B+ ] on the other.

Might a firmware update (rpi-update) change that? Or is the revisionnumber hardcoded in the SoC?
Remember this is a Pi 2 question and answer thread. For Pi 2 (and possibly subsequent) models I assume the new six hex digit scheme will be used. For prior models I assume the old four hex digit scheme will be used. See http://elinux.org/RPi_HardwareHistory for a mapping of the old revision numbers to models.

Re: The Raspberry Pi 2 Q&A thread

Posted: Sun Feb 08, 2015 2:59 pm
by pico
dom wrote: That will underclock the Pi2 a little to 840MHz.
OK. I thought I'd read it would just be ignored by the RPi2 if < 900.
dom wrote: Suppose Pi1 has serial 0x11111111 and Pi2 has serial 0x22222222 then you can do:

Code: Select all

arm_freq=950  # applies to any board
[0x11111111]
arm_freq=840  # applies only to board with serial 0x11111111
[0x22222222]
arm_freq=1000 # applies only to board with serial 0x22222222
Thanks --- that's a useful trick to know, but I'm looking for something that can boot up sensibly in *any* B, B+ (and now) RPi2, as I'm sending out card with images to RPis of various types that I never actually see.

Is there any trick like the above that will work on a model type rather than a serial number, for example?

Re: The Raspberry Pi 2 Q&A thread

Posted: Sun Feb 08, 2015 3:45 pm
by dom
pico wrote:Is there any trick like the above that will work on a model type rather than a serial number, for example?
No. I'll think about it though.

Re: The Raspberry Pi 2 Q&A thread

Posted: Sun Feb 08, 2015 4:07 pm
by scidata
I was thinking about the MAC address. However, all the pi's I have are remarkably similar in MAC and I don't yet have a Pi2.

Sudden freeze

Posted: Sun Feb 08, 2015 4:45 pm
by with ice cream
I am experiencing sudden freezes (and there is no camera flashes that could cause this). There are no suspicious syslog entries. Firmware was second to current, updated on Friday, Feb. 6. I am updating now again as I type.

Also, the screen (connected via HDSM-to-VGA adaptor) only has the proper resolution on every other boot. I think I have everything that is needed in my config.txt:

Code: Select all

hdmi_force_hotplug=1
hdmi_mode=57
hdmi_drive=2

Re: The Raspberry Pi 2 Q&A thread

Posted: Sun Feb 08, 2015 4:49 pm
by DirkS
scidata wrote:I was thinking about the MAC address. However, all the pi's I have are remarkably similar in MAC and I don't yet have a Pi2.
B8:27:EB is the RPFs manufacturer part of the mac address; the other half is based on the serial number.

Re: The Raspberry Pi 2 Q&A thread

Posted: Sun Feb 08, 2015 5:21 pm
by Mausy5043
joan wrote: ... For Pi 2 (and possibly subsequent) models I assume the new six hex digit scheme will be used. For prior models I assume the old four hex digit scheme will be used.
:shock:

In that case, could you please update your post from 07 Feb 2015 15:35 where you suggested otherwise: :?:
joan wrote:

Code: Select all

T type (0='A', 1='B', 2='A+', 3='B+', 4='Pi 2 B', 5='Alpha', 6='Compute Module')
That has had me puzzled for some time. ;)
Thanks!

Re: The Raspberry Pi 2 Q&A thread

Posted: Sun Feb 08, 2015 5:30 pm
by davidcoton
There are two possibilities, but I don't know which is correct. (I haven't updated my Pi 1 B/B+ firmware and I don't intend to in the middle of a project.)

1) Latest (or future) firmware will use the new scheme on older hardware.
2) A hardware change is needed for the new scheme, which can only be incorporated in new production of older models.

FWIW I would guess (1) is correct, and if its (2) then the change may or may not be made. But I don't know for certain.

C compiler options for Pi2

Posted: Sun Feb 08, 2015 5:59 pm
by bleep42
Hi, can anyone recommend the best C compiler options for the Pi2; on my pi B+ i use 'cc -O2 xyz.c' I'm after best performance rather than code size.
Thanks Kevin.

Re: The Raspberry Pi 2 Q&A thread

Posted: Sun Feb 08, 2015 6:28 pm
by Shadow_7
mikronauts wrote:Pi + power hungry WiFi stick + ??? probably needs over 1A, and the price differential between 1A and 2A is minimal, so why take a chance?
Availability! 2A plugs off the shelf are still a rare, or an out of stock at best item. More so in quantity if you have more than one device to power. Where the 1A plugs are in quantity and in a bargain bin at walmart. For those of us that prefer off the shelf and avoid online financials like a plague. It's what we like best about the pi, once you have the computer (craigslist or otherwise), everything else can be found locally and in stock. Up and running in under an hour, even if it's your very first pi and your ISP sucks.

Re: The Raspberry Pi 2 Q&A thread

Posted: Sun Feb 08, 2015 6:33 pm
by mikronauts
I would strongly recommend you get a powered external hub if you are stuck with a 1A adapter.

I've had great success using 2.1A Samsung phone chargers, which I find everywhere, or DC-DC converters with 3A or higher output.
Shadow_7 wrote:
mikronauts wrote:Pi + power hungry WiFi stick + ??? probably needs over 1A, and the price differential between 1A and 2A is minimal, so why take a chance?
Availability! 2A plugs off the shelf are still a rare, or an out of stock at best item. More so in quantity if you have more than one device to power. Where the 1A plugs are in quantity and in a bargain bin at walmart. For those of us that prefer off the shelf and avoid online financials like a plague. It's what we like best about the pi, once you have the computer (craigslist or otherwise), everything else can be found locally and in stock. Up and running in under an hour, even if it's your very first pi and your ISP sucks.

Re: The Raspberry Pi 2 Q&A thread

Posted: Sun Feb 08, 2015 6:59 pm
by Leopold
Why would arm and gpu memory not add up to 1024?

Code: Select all

OpenELEC:~ # vcgencmd get_mem arm
arm=752M
OpenELEC:~ # vcgencmd get_mem gpu
gpu=256M

Re: The Raspberry Pi 2 Q&A thread

Posted: Sun Feb 08, 2015 7:06 pm
by PhilE
16MB of the address map (which for architectural reasons is limited to 1GB) is occupied by the peripherals.

Re: C compiler options for Pi2

Posted: Sun Feb 08, 2015 7:08 pm
by DougieLawson
bleep42 wrote:Hi, can anyone recommend the best C compiler options for the Pi2; on my pi B+ i use 'cc -O2 xyz.c' I'm after best performance rather than code size.
Thanks Kevin.
Build a Makefile for your project and you can run make -j 6 to get the compiler running in parallel on all four CPUs.

Re: The Raspberry Pi 2 Q&A thread

Posted: Sun Feb 08, 2015 7:12 pm
by PhilE
I suspect bleep42 meant code performance rather than compilation time...

Re: The Raspberry Pi 2 Q&A thread

Posted: Sun Feb 08, 2015 7:20 pm
by DougieLawson
PhilE wrote:I suspect bleep42 meant code performance rather than compilation time...
Then some careful tweaking with -O? values and measuring the execution time for a test case is the name of the game.

Re: The Raspberry Pi 2 Q&A thread

Posted: Mon Feb 09, 2015 1:31 am
by rahlquist
Shadow_7 wrote:
mikronauts wrote:Pi + power hungry WiFi stick + ??? probably needs over 1A, and the price differential between 1A and 2A is minimal, so why take a chance?
Availability! 2A plugs off the shelf are still a rare, or an out of stock at best item. More so in quantity if you have more than one device to power. Where the 1A plugs are in quantity and in a bargain bin at walmart. For those of us that prefer off the shelf and avoid online financials like a plague. It's what we like best about the pi, once you have the computer (craigslist or otherwise), everything else can be found locally and in stock. Up and running in under an hour, even if it's your very first pi and your ISP sucks.
I'll second mikronauts here. After what I saw firsthand tonight, ( http://www.raspberrypi.org/forums/viewt ... 63&t=99276 ) I wont ever depend on a cheapie 2A or even a good 1A. Matter of fact I am switching over to old laptop bricks and 3A buck converters.

Re: The Raspberry Pi 2 Q&A thread

Posted: Mon Feb 09, 2015 2:31 am
by W. H. Heydt
rahlquist wrote:
Shadow_7 wrote:
mikronauts wrote:Pi + power hungry WiFi stick + ??? probably needs over 1A, and the price differential between 1A and 2A is minimal, so why take a chance?
Availability! 2A plugs off the shelf are still a rare, or an out of stock at best item. More so in quantity if you have more than one device to power. Where the 1A plugs are in quantity and in a bargain bin at walmart. For those of us that prefer off the shelf and avoid online financials like a plague. It's what we like best about the pi, once you have the computer (craigslist or otherwise), everything else can be found locally and in stock. Up and running in under an hour, even if it's your very first pi and your ISP sucks.
I'll second mikronauts here. After what I saw firsthand tonight, ( http://www.raspberrypi.org/forums/viewt ... 63&t=99276 ) I wont ever depend on a cheapie 2A or even a good 1A. Matter of fact I am switching over to old laptop bricks and 3A buck converters.
US: http://electronics.mcmelectronics.com/s ... er&x=0&y=0
http://www.adafruit.com/products/1995
or if you like to use your own cables: http://www.adafruit.com/products/1994

And I'm sure there are many more out there.
UK/Euro: https://www.newit.co.uk/shop/accessorie ... ower-5V-2A

Re: C compiler options for Pi2

Posted: Mon Feb 09, 2015 9:05 am
by bleep42
DougieLawson wrote:
bleep42 wrote:Hi, can anyone recommend the best C compiler options for the Pi2; on my pi B+ i use 'cc -O2 xyz.c' I'm after best performance rather than code size.
Thanks Kevin.
Build a Makefile for your project and you can run make -j 6 to get the compiler running in parallel on all four CPUs.
I suspect bleep42 meant code performance rather than compilation time...
Hi, Thanks.
Yes I mean compiler options for the compiled object. I'm assuming that as we have a nice new Arm 7 Cortex, there will be some good optimisations that the compiler can make for that core, but you probably have to let the compiler know that it's compiling for an ARM 7 Cortex, I'm fully aware of the '-O' options, I'm wanting to know if there are any flags to tell the compiler it's compiling for an ARM 7 Cortex processor.
Thanks for your help. Kevin.

Re: C compiler options for Pi2

Posted: Mon Feb 09, 2015 9:08 am
by AndyD
bleep42 wrote:... I'm wanting to know if there are any flags to tell the compiler it's compiling for an ARM 7 Cortex processor.
Thanks for your help. Kevin.
There is a threads in the C/C++ forum ... Compiling for Raspberry Pi 2

Re: The Raspberry Pi 2 Q&A thread

Posted: Mon Feb 09, 2015 9:15 am
by DougieLawson
-mcpu=name and -march=archname are the flags.
The RPi2 kernel is built with

Code: Select all

-march=armv7-a,-march=armv5t
The RPi1 kernel is built with

Code: Select all

-march=armv6k,-march=armv5t

Re: The Raspberry Pi 2 Q&A thread

Posted: Mon Feb 09, 2015 1:22 pm
by rahlquist
Yep, those are all excellent options. Only reason I am moving to the ridiculous wattage laptop adapters (for pi use at least) is I have quite a few just lurking about.

'real-life' performance comparison

Posted: Mon Feb 09, 2015 1:30 pm
by Nigel Day
Having just got my hands on a Pi2, I was interested in running a database performance test on it to see how the Pi2 compares in speed with a Pi B+. I prepared a new microSD card with the latest Raspian image, used apt-get update and upgrade to make sure I was really up to date (as of this morning), and then ran my performance test on a B+. I then shut down the machine, put the card in a Pi2, and ran the performance test again - so the database software was exactly the same in both runs. No over-clocking on either board!

Looking at the single-threaded case, the Pi B+ gave me an insert rate of 1282 records per second (each insert being done as a single transaction, and waiting for one to complete before setting off the next; the client application was running in a separate address space to the database server, with communication via TCP/IP to ensure the database was protected in case the client application misbehaved.) On the Pi2, I got a figure of 5263, 4.1 times faster! The various other tests with a single-threaded client gave similar performance improvements: the deletion rate went up from 1299 to 5556 records per second, for example, a performance improvement of 4.3; the lowest figure I got was from the single-threaded tests was 3.2 (when doing a series of queries each returning 50 records at a time).

The test suite I was using can also do the tests using multiple connections in separate threads, to really hammer the database server. On the B+, this does not lead to better performance; indeed on some of the tests performance can be fractionally worse, probably due to the extra overheads of managing multiple threads. On the Pi2, though, the extra cores come into play; even though the database server I was using does not use multiple threads to handle an individual transaction, it does use them for handling client server communications, for example. The insert rate increased to 8696 records per second, an improvement of 6.8 times that achieved on the B+, and the update and deletion tests saw similar improvement, with figures of 6.8 and 7.3 respectively. For queries, the improvement was even better, hitting 8.1; this is because the server knows that queries for separate clients can be done in parallel as there is no danger of getting inconsistent results.

So, in summary, when using just a single-threaded client application (and driving the database server in a way where it would also be running just one thread at a time) the software was running about 4 times faster on the Pi2 than it had been on the B+. when driving the database harder via a multi-threaded client application, the performance improvement was up to 8 times better. The Pi2 is a winner!

(for the record, the software I was using was Polyhedra, an in-memory relational DBMS that uses the client-server model. I was using its primary API: ODBC. Polyhedra Lite is available for free on the Raspberry Pi - see http://developer.polyhedra.com for details of the software and for download instructions.)

Re: The Raspberry Pi 2 Q&A thread

Posted: Mon Feb 09, 2015 3:52 pm
by cacb
This is potentially a stupid question about compatibility between PI1 Models B/B+ vs. PI2 Moldel B.

I have seen it mentioned that programs running on PI1 B/B+ will run just fine on the PI2. I have several PI1 machines and one of the issues is that compiling software can be very slow (cross-compilation is too advanced for me). If I buy a PI2 and install raspbian on it, then compiling C++ programs will be several times faster, but will those binaries run under raspbian on the PI1 machines?

I understand that PI1 is arm6 and PI2 is arm7, so potentially the question is stupid. But I'd like a clear answer anyway :P

Re: The Raspberry Pi 2 Q&A thread

Posted: Mon Feb 09, 2015 4:04 pm
by dulcidi
Hello, can I Power my raspberry pi 2 with 5.3v or it Will burn the board?