Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


ECC under FreeRTOS

Posted by D.L. on October 30, 2008

Does anyone have experience with Elliptic Curve Crpytography running under FreeRTOS? I'm currently working with an AT91SAM7X256 (ARM7TDMI). I tried to do some encryption with the MIRACL library from http://www.shamus.ie. There are no problems with "simple" operations with big numbers, e.g. the calculation of 50!. But when I try to execute an elliptic curve operation, everything stands still :(
The encryption works without FreeRTOS.

So has anyone experienced with this topic. Of course, it is also possible to use some other library - I'm not tied up to MIRACL.



RE: ECC under FreeRTOS

Posted by Dave on October 30, 2008
I dont know about ECC, but a few pointers to look at first.

Does the algorithm use a lot of stack? Stack overflow is the most common problem. FreeRTOS includes some utilities to detect stack overflow.

Does the algorithm do anything using global variables, or is it in any other way not re entrant? If so then you will have to use guards if accessing the library from more than one task.

Does the algorithm attempt to perform any dynamic memory allocation using malloc? If so then you will need to ensure your linker script allocates a heap, or replace calls to malloc with pvPortMalloc().

RE: ECC under FreeRTOS

Posted by D.L. on October 30, 2008
Hi Dave!

Thanks a lot for your hints! I think, the library uses a lot of stack. I tried to dramatically reduce the memory-consumption of FreeRTOS and my program. I decreased the Heap-Size and disabled every unused part.
I tried to announce a StackOverflow with vApplicationStackOverflowHook but without success (there is no announcement). (configCHECK_FOR_STACK_OVERFLOW is set to 2).

The Lib has some switches which prevents it to allocate any vars. So everything is static and on the stack. It's used in only one thread. So I think there should not be a problem with reentrance or global variables.

I'm on my wits' end. What else can i do to analyze the problem?

RE: ECC under FreeRTOS

Posted by MEdwards on October 30, 2008
Did you increase the stack allocated to the task in the call to xTaskCreate?

RE: ECC under FreeRTOS

Posted by D.L. on October 31, 2008
Of course, I did not ;(
But again, my program is not running. I think I have to try a bare-metal implementation for this problem. But I'll keep at it and will try other things with FreeRTOS. I'm still impressed... :)

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

Version 10.1.0 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner