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




Loading

vTickISR for ARM7 (LPC2138) not OK?

Posted by Martin Kupke on February 20, 2008
To completely understand my issue, may be it's worth to have a look to my former opened thread, when i started using FreeRTOS with my ARM7 (LPC2138) board.
Title is: "ARM7 LPC2138 problem with portRESTORE_CONTEXT"
https://sourceforge.net/forum/forum.php?thread_id=1939761&forum_id=382005

To get the FreeRTOS running on my board, i need to adapt the portISR.c file. The vTickISR function needs to be modified from:
/* Ready for the next interrupt. */
T0_IR = portTIMER_MATCH_ISR_BIT;
VICVectAddr = portCLEAR_VIC_INTERRUPT;

After reading the (vectored) interrupt handling section in the "LPC213x User Manual" which i downloaded from NXP website, i found out that the reset condition for interrupt is 0. So i modified the implementation to:
/* Ready for the next interrupt. */
T0_IR |= portTIMER_MATCH_ISR_BIT;
T0_IR &= ~portTIMER_MATCH_ISR_BIT;
VICVectAddr = portCLEAR_VIC_INTERRUPT;

Now the FreeRTOS is running on my board. Without the clear bit instruction (set reset condition for interrupt) the vTickISR routine is only called once.

Bye,
Kuppi...

RE: vTickISR for ARM7 (LPC2138) not OK?

Posted by Richard on February 20, 2008
That's odd, I've never had a problem with this and used the code on many different LPC2000 devices. I will look at it. Can you provide a link to the doc you downloaded, and a page number? Thanks.

Regards.

RE: vTickISR for ARM7 (LPC2138) not OK?

Posted by Richard on February 21, 2008
From my LPC2138 manual, ref the T0_IR register:

"Interrupt Register (IR, TIMER0: T0IR - 0xE000 4000 and TIMER1: T1IR - 0xE000 8000)
The Interrupt Register consists of four bits for the match interrupts and four bits for the
capture interrupts. If an interrupt is generated then the corresponding bit in the IR will be
high. Otherwise, the bit will be low. Writing a logic one to the corresponding IR bit will reset
the interrupt. Writing a zero has no effect."

Seems writing a 1 to the register (as per the FreeRTOS.org code) is the correct operation.

Regards.

RE: vTickISR for ARM7 (LPC2138) not OK?

Posted by Martin Kupke on February 27, 2008
At first i've to say that i'm sorry for the confusion. Of course Richard is right as you can see in the description of the "User Manual":
14.5.1 Interrupt Register (IR, TIMER0: T0IR - 0xE000 4000 and TIMER1: T1IR
- 0xE000 8000)
The Interrupt Register consists of four bits for the match interrupts and four bits for the
capture interrupts. If an interrupt is generated then the corresponding bit in the IR will be
high. Otherwise, the bit will be low. Writing a logic one to the corresponding IR bit will reset the interrupt. Writing a zero has no effect.

I haven't read the manual carefully, just had a fast overview and mis-interpreted the "Reset value". With the "Reset value" is meant, the value which is initialized after a reset condition and not the value to reset the register. (Sorry)

My real problem was my assembler startup code. Now my ARM7 board is up and running with FreeRTOS.

Bye,
Kuppi...


[ 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