Topic : No interrupt vector file created

Forum : ST7/STM8

Original Post
Post Information Post
August 25, 2010 - 2:44pm
Guest

I recently got the following error when i externally added stm8_interrupt_vector.c to my project source. Creating a project in STVD with raisonance complier selected did not generate any interrupt_vector.c file for me so i decided to add that file that was previously generated by creating project with cosmic selected. For the time being i decided to use raisonance instead of cosmic because i have to wait after requesting a file.

#include "stm8s_it.h"
typedef void @far (*interrupt_handler_t)(void);

struct interrupt_vector {
unsigned char interrupt_instruction;
interrupt_handler_t interrupt_handler;
};

@far @interrupt void NonHandledInterrupt (void)
{
/* in order to detect unexpected events during development,
it is recommended to set a breakpoint on the following instruction
*/
return;
}

Anyway on above lines of stm8_interrupt_vector.c i get the following error

-----------------------------------------------------------------------------------------------------------

----------- Project blinkspeed - Raisonance - Configuration Debug -------------

Compiling stm8_interrupt_vector.c...
rcstm8 stm8_interrupt_vector.c OBJECT(Debug\stm8_interrupt_vector.o) PIN("C:\Program Files\Raisonance\Ride\inc\ST7") PIN("C:\Program Files\Raisonance\Ride\inc") DGC(page0) AUTO WRV(0) PR(Debug\stm8_interrupt_vector.lst) CD CO SB OT(0) DEBUG STM8(SMALL) PIN(library\inc)
RCSTM8 COMPILER V2.30.10.175 Evaluation (1 Kb code limited)
Copyright (c) Raisonance S.A.S. 1987-2010. All rights reserved.

*** WARNING C096 IN LINE 4 OF stm8_interrupt_vector.c : Function 'main' should return a value

*** ERROR P002 IN LINE 5 OF stm8_interrupt_vector.c : Invalid '@' character

*** ERROR P002 IN LINE 12 OF stm8_interrupt_vector.c : Invalid '@' character

RCSTM8 COMPILATION COMPLETE. 1 WARNING, 2 ERRORS

The command: "rcstm8 stm8_interrupt_vector.c OBJECT(Debug\stm8_interrupt_vector.o) PIN("C:\Program Files\Raisonance\Ride\inc\ST7") PIN("C:\Program Files\Raisonance\Ride\inc") DGC(page0) AUTO WRV(0) PR(Debug\stm8_interrupt_vector.lst) CD CO SB OT(0) DEBUG STM8(SMALL) PIN(library\inc) " has failed, the returned value is: 2
exit code=2.

blinkspeed.elf - 3 error(s), 1 warning(s)

Replies
Post Information Post
+1
0
-1
August 26, 2010 - 1:31pm
Raisonance Support Team

Hi,

Your problem is that you did not read the compiler documentation ;^)

The mechanism used by the Cosmic compiler is very different than ours.
With the Raisonance toolchain, you just have to add "interrupt N" after a function declaration, such as:

void UART_IRQ_Handler(void) interrupt 12
{
    ...
}

And that IT! The compiler/linker will automatically take care of your interrupts, create the vectors for them and locate them at the right place in memory.

2 suggestions though:
- Consider using Ride7 instead of STVD, as the toolset integration is better.
- Declare your main function with "void main(void)" and place a "while(1);" at its end.

Regards,