Sign in

username:

password:



Not a member?

Search lpc2000



Search tips

Subscribe to lpc2000



lpc2000 by Keywords

2106 | ADC | ARM7 | Atmel | Bootloader | CAN | CrossStudio | CrossWorks | DDS | ECos | Ethernet | ETM | FIFO | FLASH | FPGA | GCC | GDB | GNU | GNUARM | GPIO | I2C | IAP | IAR | JTAG | Kickstart | LCD | Linux | LPC | LPC-E2294 | LPC2000 | LPC2100 | LPC2104 | Lpc2106 | Lpc210x | LPC2114 | LPC2119 | LPC2124 | LPC2129 | Lpc2138 | LPC213x | LPC21xx | LPC2210 | LPC2212 | LPC2214 | LPC2292 | LPC2294 | LPC2xxx | LPC3128 | MCB2100 | Olimex | Philips | PWM | Rowley | RTC | RTOS | SPI | SSP | UART | UART0 | UART1 | ULINK | USB | Watchdog | Wiggler

Ads

Discussion Groups

Discussion Groups | LPC2000 | CrossStudio: C++ interrupt service

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

CrossStudio: C++ interrupt service - fl429 - Feb 7 13:40:00 2005


Hi, folks,

I am trying out a few things on a IAR Kickstart board, with
CrossStudio 1.3.

I'd like to write code in C++ instead of C. My test C++ code ran ok
until I added an interrupt service routine, for Timer0 as my test
example.

I have a ISR like this: (in a .cpp file)

static void timer0ISR(void) __attribute__ ((interrupt ("IRQ")));

static void timer0ISR()
{
// doing something here }

void SetupTimer0()
{
//
// Init VIC here, not shown
//
VICVectAddr0 = (unsigned int)timer0ISR;
//
// etc

}

The problem is the result code always calls the default DO-Nothing
handler in the "Philips_210x_startup.s" and stalls there.

The same piece of code in C seems ok.

Any ideas ?

Thanks,

Lei



Re: CrossStudio: C++ interrupt service


(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )


RE: CrossStudio: C++ interrupt service - Paul Curtis - Feb 7 13:41:00 2005

Perhaps you need "extern C" magic?

extern "C" {
static void timer0ISR(void) __attribute__ ((interrupt ("IRQ")));
};

Dunno. I'm not an ARM person.

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for MSP430, ARM, AVR and (soon) MAXQ processors

> -----Original Message-----
> From: fl429 [mailto:]
> Sent: 07 February 2005 17:41
> To:
> Subject: [lpc2000] CrossStudio: C++ interrupt service >
> Hi, folks,
>
> I am trying out a few things on a IAR Kickstart board, with
> CrossStudio 1.3.
>
> I'd like to write code in C++ instead of C. My test C++ code
> ran ok until I added an interrupt service routine, for Timer0
> as my test example.
>
> I have a ISR like this: (in a .cpp file)
>
> static void timer0ISR(void) __attribute__ ((interrupt ("IRQ")));
>
> static void timer0ISR()
> {
> // doing something here > }
>
> void SetupTimer0()
> {
> //
> // Init VIC here, not shown
> //
> VICVectAddr0 = (unsigned int)timer0ISR;
> //
> // etc
>
> }
>
> The problem is the result code always calls the default
> DO-Nothing handler in the "Philips_210x_startup.s" and stalls there.
>
> The same piece of code in C seems ok.
>
> Any ideas ?
>
> Thanks,
>
> Lei >
>
> Yahoo! Groups Links >





(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: CrossStudio: C++ interrupt service - fl429 - Feb 7 17:26:00 2005


A guy from Rowley helped me figured it out. It turns out that I have
to uncomment the line

#define VECTORED_IRQ_INTERRUPTS

in the startup.s file. In the sample C project the line is already
done.

Great support !

Thanks,

Lei --- In , "fl429" <fl429@y...> wrote:
>
> Hi, folks,
>
> I am trying out a few things on a IAR Kickstart board, with
> CrossStudio 1.3.
>
> I'd like to write code in C++ instead of C. My test C++ code ran ok
> until I added an interrupt service routine, for Timer0 as my test
> example.
>
> I have a ISR like this: (in a .cpp file)
>
> static void timer0ISR(void) __attribute__ ((interrupt ("IRQ")));
>
> static void timer0ISR()
> {
> // doing something here > }
>
> void SetupTimer0()
> {
> //
> // Init VIC here, not shown
> //
> VICVectAddr0 = (unsigned int)timer0ISR;
> //
> // etc
>
> }
>
> The problem is the result code always calls the default DO-Nothing
> handler in the "Philips_210x_startup.s" and stalls there.
>
> The same piece of code in C seems ok.
>
> Any ideas ?
>
> Thanks,
>
> Lei





(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )