Version 10

    pi2.gifThe Raspberry Pi Foundation have just released their latest Raspberry Pi, but this is no simple update, oh no it is a seismic shift for the single board computer. Since its release in 2012, the Raspberry Pi has seen a number of updates. First, the RAM was increased from 256MB to 512MB and then with the B+ in 2014 we saw two more USB ports and an expanded GPIO. But what has remained the same are the CPU and GPU, namely the ARM11 CPU and VideoCore IV GPU that form the BCM2835 system on a chip (SoC).


    So what makes the new Raspberry Pi any better than it’s predecessors? There has been a specification bump and the trusty BCM2835 has been replaced with a BCM2836 that has been custom made by Broadcom for the Raspberry Pi. This new SoC brings a new CPU in the form of an ARM7 based quad core processor running at 900Mhz per core! Comparing this new processor against the old single core 700Mhz ARM11, on paper we have a significantly greater amount of processing power on offer! To support the new CPU we have 1GB of 450Mhz RAM, increased from the 512MB 400Mhz RAM used on the B+


    So this increase in specification means a higher price, right?


    Wrong!


    The Raspberry Pi 2 remains the same price as the B+! A major achievement for the Foundation.


     

    Comparison of recent Raspberry Pi Models

     

     

    Raspberry Pi 2

    Raspberry Pi B+

    Raspberry Pi A+

    SoC

    BCM2836

    BCM2835

    BCM2835

    CPU

    ARM7

    ARM11

    ARM11

    RAM

    1GB

    512MB

    256MB

    GPU

    VideoCoreIV

    VideoCoreIV

    VideoCoreIV

    GPIO

    40 Pins

    40 Pins

    40 Pins

    Ethernet

    10/100 Ethernet

    10/100 Ethernet

    NONE

    USB

    4 Ports

    4 Ports

    1 Port

    Storage

    Micro SD

    Micro SD

    Micro SD

    Camera Interface

    Yes

    Yes

    Yes

    Display Interface

    Yes

    Yes

    Yes

     

    Physically the Raspberry Pi 2 has exactly the same dimensions as the B+, meaning that 99% of cases that fit the B+ will fit Pi 2.

     

     

    GPIO


    The Raspberry Pi 2 also comes with the same 40 pin GPIO (General Purpose Input  Output) that was introduced with the B+. The pin mapping is identical for the Pi2, B+ and A+ boards enabling projects and add on boards to be interchanged between each of the boards. Boards that were also designed for the A and B series Pis will also work with the Raspberry Pi 2, but the caveat is that they must fit within the layout of the B+ shape board, so boards such as Piface Digital will not work, hence the team have created a new version of their board.


    The Raspberry Pi 2 also complies with the HAT (Hardware Attached on Top) standard, enabling future add on boards to use an EEPROM (Electrically Erasable Programmable Read Only Memory) which can communicate with the Raspberry Pi 2 in order to configure the Pi ready to use the device. The HAT standard was introduced with the B+ in 2014 and as yet it has not been fully implemented but will be in the near future.

     

     

    Test Baseline


    The Raspberry Pi 2 is a seriously well specified single board computer and has enough processing power to easily be used as a standard PC, but how can we quantify that? Bring on the benchmarks!

     

    How we tested


    For each Raspberry Pi tested we used the 8GB Micro SD card that came with each of the boards. We ran the Raspbian operating system and launched all tests from the desktop. The software for each Raspberry Pi was upgraded to the latest version using

     

     

    sudo apt-get update && sudo apt-get upgrade

     

    The only necessary difference between the Raspberry Pi 2 and the B+ tested lies in the kernel image used. In the boot partition of the micro SD card lies kernel.img which is compatible with the ARM11 CPU used in the previous Raspberry Pi models. For the Raspberry Pi 2 the Foundation have switched to an ARM 7 CPU, and this requires a new kernel image, kernel7.img in order to fully use all four CPU cores.

     

    So let us start our series of tests.

     

    Boot Times

     

    We tested the stock Raspbian install on both the Raspberry Pi 2 and the B+ focusing on booting to the login prompt.

     

     

    Boot to prompt

    Time Taken

    Raspberry Pi 2

    17 seconds

    Raspberry Pi B+

    33 Seconds

     

    Clearly we can see that the Raspberry Pi 2 boots in around half the time of the B+ which is a remarkable speed increase.


    We next altered the boot configuration via raspi-config, so that both Raspberry Pi boot straight to the desktop (which will become the default action in future versions of Raspbian).


    The times were:

     

    Boot to desktop

    Time Taken

    Raspberry Pi 2

    21 seconds

    Raspberry Pi B+

    42 seconds

     

    Again we see that the Raspberry Pi 2 is around double the speed of the B+, and this is before any enhancements are made to really take the Raspberry Pi 2 to full speed.

     

    Compute Prime to 20000

     

    Next we wanted to push both Raspberry Pi to their limits and fortunately there is a great tool to test any Linux computer, sysbench. Sysbench has a full suite of tests that can be run to determine the limits of your computer.

     

    To install sysbench on your Raspberry Pi, open LXTerminal and type

     

    sudo apt-get install sysbench


    One of the best tests is for brute CPU processing power and to run this test via sysbench type the following into LXTerminal

     

    sysbench --num-threads=4 --test=cpu --cpu-max-prime=20000 run


    Results


    Version

    Time Taken

    Raspberry Pi 2

    1. 195.9543 seconds / 3 minutes 16 seconds

    Raspberry Pi B+

    1. 1331.6552 seconds / 22 minutes 12 seconds

     

    This test stresses the ARM CPU to 100% to calculate all the prime numbers up to 20000. As you can see, the Raspberry Pi 2 is the clear winner with a time of 3 minutes 16 seconds versus the B+ at 22 minutes 12 seconds. This really shows how powerful the CPU at the heart of Raspberry Pi 2 is.

     

    For our second test we ran an application called memtester.


    Memtester checks the memory installed on a computer for any faults, it runs a number of integrity checks that push the RAM to it’s limits. Ordinarily this test just performs this action and reports back, but to test how fast the test could be completed we used the time command, to time how long the process took.

    To install these applications, open LXTerminal and type

     

    sudo apt-get install memtester

    sudo apt-get install time

     

    With the applications installed run the following command in LXTerminal

     

    sudo time memtester 256M 1

     

    This runs memtester with superuser powers, this is necessary to make sure that the chunk of RAM that we wish to test is locked only to us. In this case we are checking 256MB of RAM, and the test will only run once. The time command runs before memtester to tell Raspbian that we wish to time the operation. You will notice that the test is only run on 256MB of RAM and not the full allocation present on the Raspberry Pi. This is simply because we cannot gain access to all of the RAM once the operating system is loaded as it allocates a portion of RAM for itself. (To run a full test of every single megabyte of RAM we would need to use a tool like Memtest86, which runs before the operating system is loaded. Sadly, this application is not available for the Raspberry Pi.)

     

     

    Version

    Time Taken

    Raspberry Pi 2

    1. 1560.99 / 26 minutes 1 second

    Raspberry Pi B+

    1. 4208.09 seconds / 1hr 10 minutes 8 seconds

     

    The Raspberry Pi 2 handled this task in 26 minutes 1 second, 44 minutes and 7 seconds quicker than the Raspberry Pi B+, quite a remarkable achievement!

     

    The Raspberry Pi Foundation are keen to point out that this is the Raspberry Pi that they wanted to release many years ago, but it has taken two years of research and development at a cost of around £3 Million, to fully realise their dream.

     

    To round off our investigation we also ran a few more tests to see how quickly the new Raspberry Pi 2 could handle day to day tasks.

     

     

    Application

    Raspberry Pi 2

    Raspberry Pi B+

    Minecraft - Load a new world

    21 seconds

    42 seconds

    Python 3 - Open Application

    4 seconds

    13 seconds

    Sonic Pi 2 - Open Application

    11 seconds

    21 seconds

    Libreoffice - Open a new text document

    9 seconds

    18 seconds

    Epiphany Browser - To Google

    8 seconds

    13 seconds

     


    Conclusion


    These tests show that the new Raspberry Pi 2 is a much more powerful computer. It can perform better than its predecessors but still comes in at a bargain price. In fact, the Raspberry Pi 2 rarely went “full throttle” in fact. Even when opening Minecraft-- a very CPU intensive task --CPU usage rarely went above 50%. (Compare this to the B+ which went to 100% when opening Minecraft.) Does this spell the end of the B+ and A+? Not at all-- there is still a market for these boards, especially for industrial applications that do not require the raw power of the Raspberry Pi 2. In fact, there are a number of great robotics projects being forged with the A+ at it’s heart.

     

    As you can see from the tests above the new Raspberry Pi 2 is a beast of a single board computer and it will become the new foundation for a new future full of great projects-- all powered by a credit card sized computer that was dreamt of in Cambridge.


    About the author:


    Les Pounder is an author and trainer specialising in the Raspberry Pi. He is part of the Raspberry Pi Foundation's training team delivering training to teachers across the United Kingdom. He has a blog at http://bigl.es and is @biglesp on Twitter.