Quality RTOS & Embedded Software

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


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 ]    [ 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