Forum : ST7/STM8
Post Information | Post |
---|---|
August 25, 2010 - 2:44pm
|
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" struct interrupt_vector { @far @interrupt void NonHandledInterrupt (void) Anyway on above lines of stm8_interrupt_vector.c i get the following error ----------------------------------------------------------------------------------------------------------- ----------- Project blinkspeed - Raisonance - Configuration Debug ------------- Compiling stm8_interrupt_vector.c... *** 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 blinkspeed.elf - 3 error(s), 1 warning(s) |
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:
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,