User avatar
joan
Posts: 12821
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: The Raspberry Pi 2 Q&A thread

Sun Feb 08, 2015 1:47 pm

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.

pico
Posts: 16
Joined: Sun Sep 16, 2012 2:49 pm

Re: The Raspberry Pi 2 Q&A thread

Sun Feb 08, 2015 2:59 pm

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?

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

Re: The Raspberry Pi 2 Q&A thread

Sun Feb 08, 2015 3:45 pm

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.

User avatar
scidata
Posts: 90
Joined: Tue Jan 06, 2015 4:21 pm
Location: Toronto
Contact: Website

Re: The Raspberry Pi 2 Q&A thread

Sun Feb 08, 2015 4:07 pm

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.
"Self-education is, I firmly believe, the only kind of education there is" - Isaac Asimov

User avatar
with ice cream
Posts: 144
Joined: Mon Jul 30, 2012 7:25 am

Sudden freeze

Sun Feb 08, 2015 4:45 pm

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

DirkS
Posts: 7732
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: The Raspberry Pi 2 Q&A thread

Sun Feb 08, 2015 4:49 pm

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.

Mausy5043
Posts: 3
Joined: Sun Feb 08, 2015 12:14 pm
Location: Tilburg, NL

Re: The Raspberry Pi 2 Q&A thread

Sun Feb 08, 2015 5:21 pm

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!
Mausy5043 - NL

User avatar
davidcoton
Posts: 2454
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: The Raspberry Pi 2 Q&A thread

Sun Feb 08, 2015 5:30 pm

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.
"If it ain't broke, fix it until it is."
“Raspberry Pi is a trademark of the Raspberry Pi Foundation”
The Pink Unicorn is a symbol of commitment to sensible discussion of future versions of the Raspberry Pi ™

User avatar
bleep42
Posts: 129
Joined: Wed Mar 07, 2012 12:43 pm
Location: Sussex
Contact: Website

C compiler options for Pi2

Sun Feb 08, 2015 5:59 pm

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.

Shadow_7
Posts: 25
Joined: Sat Jul 12, 2014 5:50 am

Re: The Raspberry Pi 2 Q&A thread

Sun Feb 08, 2015 6:28 pm

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.

User avatar
mikronauts
Posts: 2623
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: The Raspberry Pi 2 Q&A thread

Sun Feb 08, 2015 6:33 pm

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.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Leopold
Posts: 5
Joined: Fri Jul 05, 2013 4:07 am

Re: The Raspberry Pi 2 Q&A thread

Sun Feb 08, 2015 6:59 pm

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

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1422
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: The Raspberry Pi 2 Q&A thread

Sun Feb 08, 2015 7:06 pm

16MB of the address map (which for architectural reasons is limited to 1GB) is occupied by the peripherals.

User avatar
DougieLawson
Posts: 30505
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: C compiler options for Pi2

Sun Feb 08, 2015 7:08 pm

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.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1422
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: The Raspberry Pi 2 Q&A thread

Sun Feb 08, 2015 7:12 pm

I suspect bleep42 meant code performance rather than compilation time...

User avatar
DougieLawson
Posts: 30505
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: The Raspberry Pi 2 Q&A thread

Sun Feb 08, 2015 7:20 pm

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.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

rahlquist
Posts: 146
Joined: Tue Jan 21, 2014 1:02 pm

Re: The Raspberry Pi 2 Q&A thread

Mon Feb 09, 2015 1:31 am

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.

W. H. Heydt
Posts: 7627
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: The Raspberry Pi 2 Q&A thread

Mon Feb 09, 2015 2:31 am

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

User avatar
bleep42
Posts: 129
Joined: Wed Mar 07, 2012 12:43 pm
Location: Sussex
Contact: Website

Re: C compiler options for Pi2

Mon Feb 09, 2015 9:05 am

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.

User avatar
AndyD
Posts: 2320
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: C compiler options for Pi2

Mon Feb 09, 2015 9:08 am

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

User avatar
DougieLawson
Posts: 30505
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: The Raspberry Pi 2 Q&A thread

Mon Feb 09, 2015 9:15 am

-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
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

rahlquist
Posts: 146
Joined: Tue Jan 21, 2014 1:02 pm

Re: The Raspberry Pi 2 Q&A thread

Mon Feb 09, 2015 1:22 pm

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.

Nigel Day
Posts: 22
Joined: Sat Jun 16, 2012 2:15 pm

'real-life' performance comparison

Mon Feb 09, 2015 1:30 pm

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.)

cacb
Posts: 35
Joined: Sun Feb 01, 2015 12:18 am

Re: The Raspberry Pi 2 Q&A thread

Mon Feb 09, 2015 3:52 pm

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

dulcidi
Posts: 1
Joined: Mon Feb 09, 2015 3:57 pm

Re: The Raspberry Pi 2 Q&A thread

Mon Feb 09, 2015 4:04 pm

Hello, can I Power my raspberry pi 2 with 5.3v or it Will burn the board?

Return to “General discussion”

Who is online

Users browsing this forum: Douglas6, Paul Hutch and 60 guests