Aaron Ardiri
[Valid RSS] RSS/XML feed
198 entries available (show all)

 

Internet of Things (IoT)
   

PLEASE TAKE A MOMENT TO FOLLOW MY NEW VENTURE:
 
RIoT Secure AB
 
ALL SECURITY RELATED TOPICS ON IoT wILL BE POSTED THERE


2016-10-18
>> PARTICLE.IO PHOTON PERFORMANCE - HOW DOES IT COMPARE?

Rarely do I get a first good impression of hardware; but the particle.io devices peak my interest.

In my earlier blog post I covered a initial hands on with the particle.io Photon hardware - a very affordable embedded device with a complete ecosystem for device management, firmware delivery, a custom cloud and a mobile SDK for building apps. I have personally always liked a bare-bones embedded platform; but most of these great features exist mainly due to the fact the device runs a RTOS and provides a user space for sketches. How does this impact the performance of the device with the background resources required for the RTOS?

As we identified the specifications of the particle.io Phonton were ok:

  • CPU:   STM32F205 120Mhz
    RAM:   128KB
    OS:    FreeRTOS

First of all; I wanted to identify how much of the 128KB memory would actually be available for the user sketches - digging into the documentation it is easy to find a system API to return the amount of memory:

  • void setup() 
    {
        Serial.begin(9600);
        delay(500);
        
        uint32_t freemem = System.freeMemory();
        Serial.print("free memory: ");
        Serial.println(freemem);
    }
    
    void loop() { }

Running the application and we are presented with a nice 63,912 bytes of available RAM for use in the user sketch - thats plenty :) at least when comparing it to an Arduino UNO using an 8bit AVR CPU and 2KB of RAM. Now it is time to put the platform to a real test - how can it handle a complex operation such as RSA that I ran as a benchmarch previously on Arduino devices.

  • Arduino UNO       16Mhz AVR               ==> 8504 ms * (was 12596 ms)
    Arduino Leonardo  16Mhz AVR               ==> 8563 ms * (was 12682 ms)
    Arduino Mega      16Mhz AVR               ==> 8504 ms * (was 12596 ms)
    Arduino Due       84Mhz ARM               ==> 1032 ms
    Arduino Yún       16Mhz AVR + 400Mhz MIPS ==>  707 ms
    Intel Galileo     400Mhz x86              ==>  192 ms
    
    *updated after mission critical code implemented in AVR asm

I would predict, based on the similarities between CPU architectures and available RAM that the particle.io Photon device would perform approximately around the same speed, if not better than an Arduino Due. I would suspect that the RTOS would not degrade the performance of the CPU more than 40% - I guess there is only one way to find out!

.... number crunching ....

And the results are in! Performing the RSA cryptographic functions using the public key takes 686ms, and on the private key 58,754ms (without optimizations). As expected; the comparable device would be the Arduino Due, which had performance metrics of 1032ms and 88,216ms respectively. Effectively; the particle.io photon device performs 50% better than the Arduino Due.

Overall; this maps to the difference in CPU speeds as well (120Mhz vs 84Mhz) so it is clear that the RTOS has little to no affect on the performance of the device under these conditions. It can now be confirmed that the user sketches are in fact executed natively with little or zero overhead.


 

advertisement (self plug):
need assistance in an IoT project? contact us for a free consultation.

 



Building a weather station with the particle.io Photon
 
Hands on with particle.io Photon

DISCLAIMER:
All content provided on this blog is for informational purposes only.
All comments are generated by users and moderated for inappropriateness periodically.
The owner will not be liable for any losses, injuries, or damages from the display or use of this information.