Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


Correct TickHook application

Posted by PBXNewbie on July 18, 2007
I want to access the DBGU UART on a SAM7S256 using an ISR. My understanding is that DBGU interrupts show up as a SYS interrupt, which is the interrupt used by the tick timer. Therefore, I believe that I need to place my ISR into TickHook. My questions are:
1. Can anyone confirm that this is the right way to do so? If not, can you please let me know a better way to accomplish what I want to do?
2. If this is the right way, is TickHook necessarily a coroutine?
3. Do I need to enable coroutines to put in a tickhook, or merely just enable tickhook?
3. Can I use a xQueueReceiveFromISR from within tickhook, or do I need to use crQUEUE_RECEIVE_FROM_ISR?
4. If tickhook is a coroutine, does it need to yield or just return?

I also wish to put the system in idle mode when it is not doing anything. My understanding is that I can do so by creating an idlehook routine. My questions related to this are:
1. Is idlehook necessariloy a coroutine?
2. Do I need to enable coroutines to put in an idlehook or merely just enable idlehook?
3. If I put the processor into idle mode in idlehook, will it automatically come out of idle mode when a task is ready or do I need to take it out of idlemode in a tickhook routine?
4. Does idlehook need to yield or just return?

Any help would be very much appreciated.

Thanks in advance.

RE: Correct TickHook application

Posted by Dave on July 18, 2007
One way to use two system interrupts is to have a single system interrupt handler ISR. The ISR looks at the status bits of the system peripherals and calls a standard function to handle either the PIT or the DBU handler as appropriate. You need to take care that the context is saved before this is done. You do not use the tick hook.

The idle hook has nothing to do with coroutines other than it being a convenient place to call the coroutine schedule function. All you need to do is enable the idle hook then write a function:

void vApplicationIdleHook( void )
//place processor into sleep mode here

The sleep mode chosen must ensure that timer interrupts will wake the processor up again.

RE: Correct TickHook application

Posted by PBXNewbie on July 19, 2007
Thanks Dave. That was very helpful.

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

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists