Quality RTOS & Embedded Software

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


Loading

Increment epoch time from vTickISR

Posted by savindra on March 1, 2017

Hi ,

I am following below method to sync my external RTC with internal timer. Incrementing epoch millliseconds from vTickISR.

But i want to sync my epoch milliseconds with external RTC just after my system startsup. But vTickISR is called when FreeRTOS scheduler is started so i have to wait till scheduler is started. Is there any function in FreeRTOS that can tell me that scheduler is started so that once scheduler is started i can sync my epcohms with RTC and it keep on incrementing just after syncing.

LiBIncEpochTime() { g_ulEpochMs++; }

pragma interrupt ( vTickISR( vect = VECT( configTICKVECTOR ), enable ) )

void vTickISR( void ) { / Increment the tick, and perform any processing the new tick value necessitates. / ///increment epoch seconds LIBIncEpochTime();

setipl( configMAXSYSCALLINTERRUPTPRIORITY );
{
	if( xTaskIncrementTick() != pdFALSE )
	{
		taskYIELD();
	}
}
setipl( configKERNELINTERRUPTPRIORITY );

}*

Regards, Savindra


Increment epoch time from vTickISR

Posted by rtel on March 1, 2017

Look at line 552 (at the time of writing) in the following file.

https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Source/timers.c

If you set configUSEDAEMONTASKSTARTUPHOOK to 1 you must provide an implementation of:

void vApplicationDaemonTaskStartupHook( void );

Assuming the timer task is the highest priority task in the system - which is normally the case - then vApplicationDaemonTaskStartupHook() will get called once when the first task starts executing.

Does that meet your needs?


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


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 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.


Careers

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

Renesas

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