Assembly Error: ISRs undefniert (Symbol undefined)

Gast #1143203
Lesenswert?

Hallo beisammen,

Infos vorab: CodeVisionAVR / C
Jede ISR wird nach der Kompilierung als undefined bezeichnet, z.B.

Error: D:\...asm(1071) Undefined symbol: _usart1_rx_isr
ISR (z.B. in uart.c): interrupt [USART1_RXC] void 
usart1_rx_isr(void){...}

ebenso wird main nicht gefunden, obwohl es vorhanden ist. avr_compiler.h 
ist inkludiert...

Woran kann dies liegen?
MfG
Gast #1143728
Lesenswert?

Das ganze Projekt würde verwirren ;)

Ich verwende einfach mal das SPI Modul als Bsp. Alles absolut banal, 
evtl. eine Option/include welche/s ich vergessen hab? Leider aber nicht 
so einfach... fast ein ganzer Tag ist schon rum...

1
/*-spi.c---------------------------------------------------------------*/
2
#include "spi.h"
3

4
void InitSPI(void)
5
{
6
    // SPI initialization
7
    // SPI Type: Master
8
    // SPI Clock Rate: 2*1000,000 kHz
9
    // SPI Clock Phase: Cycle Half
10
    // SPI Clock Polarity: Low
11
    // SPI Data Order: MSB First
12
    SPCR=0xD1;
13
    SPSR=0x01;
14
    
15
    ClearSPI_InterruptFlag();
16
}
17
void ClearSPI_InterruptFlag(void)
18
{
19
    // Clear the SPI interrupt flag
20
    #asm
21
        in   r30,spsr
22
        in   r30,spdr
23
    #endasm
24
}
25

26

27
// SPI interrupt service routine
28
ISR(SPI_STC)
29
{
30
    unsigned char data;
31
    data = SPDR;
32
    // ..
33
}
34

35
/*-common.h-Auszug------------------------------------------------------*/
36
#include "macro.h"
37
#include "stdint.h"
38
#include "avr_compiler.h"
39

40
/*-main.c---------------------------------------------------------------*/
41
#include "common.h"
42
#include "init.h"
43
#include "timer.h"
44
#include "spi.h"
45
#include "sw_timer.h"
46

47
void init(void);
48
void main(void);
49

50
void init(void)
51
{
52
    //Init hardware/system
53
    InitSystem();
54
    InitPorts();
55
    
56
    InitTimer0();
57
    InitTimer1();
58
    InitTimer2();
59
    InitTimer3();
60
    
61
    InitExternalInterrupts();
62
    InitTimerInterrupts();
63

64
    InitUART1();
65
    InitSPI();
66
}
67

68
void main(void)
69
{
70
    init();
71
       
72
    // Global enable interrupts
73
    sei();
74
    
75
    while (1)
76
    {
77
        ;
78
    };
79
}
Gast #1144460
Lesenswert?

gut, dann versteh ich aber folgendes Marco (in avr_compiler.h) / bzw. 
dessen Sinn nicht:
1
#define ISR(vec) interrupt[vec] void handler_##vec(void)

folglich wird mir folgende Fehlermeldung für
1
ISR(TIM3_CAPT)
ausgegeben:
Error: 
D:\subversion_projects\ppp09\software\q_avr_test\src\gen\files\List\PPP0 
9_simulation.asm(1066)  Undefined symbol: _handler_28

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren