error compiling c app

hi,

could someone explain me why when compiling my app i get this error in many file:

“processor type not defined”

It’s not what you’d expect either… The processor does seem to be defined in the source… I’m looking at it now…

i’ve re-do all the work from scratch, and the only error i get now are:

.objs\aout.asm:598:Error [103] syntax error

.objs\aout.asm:600:Error [113] Symbol not previously defined (reg).

.objs\aout.asm:600:Error [113] Symbol not previously defined (reg).

.objs\aout.asm:600:Error [113] Symbol not previously defined (bit).

.objs\aout.asm:605:Error [145] Unmatched ENDM.

.objs\aout.asm:606:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:607:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:608:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:609:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:610:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:611:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:612:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:613:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:614:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:615:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:616:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:617:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:618:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:619:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:620:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:621:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

any suggestion?

Warning - while you were typing a new reply has been posted. You may wish to review your post.

Hah, I just figured it out too :smiley: ROFL…That’s 3 hours wasted! :wink:

Hey mail me the new one and I’ll scope it out.

email coming your way… Let me know if it works, I’ll document it more neatly for the wiki…

thanks, i will spend the  night on this  :stuck_out_tongue:

i’ve tried to integrate the code you give me,

now i just get this two errors:

Compiling: aout.c

aout.c:267:19: warning: no newline at end of file

aout.c:185: syntax error: token -> ‘void’ ; column 10

what is wrong?

aout.c:267:19: warning: no newline at end of file

this one is pretty easy: just make a new line at the end of the file, so that the file does not end with a char but a blank line!

aout.c:185: syntax error: token -> ‘void’ ; column 10

could you post a snippet (maybe lines 180 to 190) of aout.c?

cheers,

AC

thanks  i’ve solved this first errors.

now i get this one:

aout.c:213: syntax error: token -> ‘’ ; column 0

Process terminated with status 1 (0 minutes, 1 seconds)

1 errors, 0 warnings

here is a quote of the 4 last line of my file:

210:      bcf    CV_AOUT_LC_LAT_RCLK, CV_AOUT_LC_PIN_RCLK ; release latch

211:endasm;

213;  }

214:

 

Hi moxi,

I think you have to add two underscores before calling

[tt]__asm

asmcontent…bla…

__endasm;[/tt]

best,

Michael

btw: is it normal that there’s line 212 missing or have I watched too much doctor who investigating dissapearing things ;D

btw: is it normal that there’s line 212 missing or have I watched too much doctor who investigating dissapearing things

oups! it’s me that forgot it!

now, with the underscores before asm and endasm:

syntax error: token -> ‘__endasm’ ; column 8

??

can you post a bit more, so that I can see the whole logical snippet?

is everything allright with “__asm” in the beginning of the token? (eg. no “;” after “__asm”)?

here is my file in this last state, i’ve added all the code needed (i think):

/////////////////////////////////////////////////////////////////////////////

include “cmios.h”

include “pic18f452.h”

include “main.h”

include “aout.h”

/////////////////////////////////////////////////////////////////////////////

// Global variables

/////////////////////////////////////////////////////////////////////////////

// AOUT values

unsigned int aout_value[8];

// stores the last AOUT values (to determine, if the shift registers have to be updated)

unsigned int last_aout_value[8];

// the gate pins

aout_gates_t aout_gates;

// last state of the aout gate flags to determine changes

aout_gates_t last_aout_gates;

/////////////////////////////////////////////////////////////////////////////

// This function initializes the AOUT module

/////////////////////////////////////////////////////////////////////////////

void CV_AOUT_LC_Init(void) {

__asm

;; enable pin drivers

bcf CV_AOUT_LC_TRIS_RCLK, CV_AOUT_LC_PIN_RCLK

bcf CV_AOUT_LC_TRIS_DOUT, CV_AOUT_LC_PIN_DOUT

bcf CV_AOUT_LC_TRIS_SCLK, CV_AOUT_LC_PIN_SCLK

;; set voltages to 0V

lfsr FSR0, AOUT0_L

movlw 8

movwf MIOS_PARAMETER3 ; used as loop counter here

CV_AOUT_LC_InitVoutLoop

clrf POSTINC0

movlw 0x80

movwf POSTINC0

decfsz MIOS_PARAMETER3, F

rgoto CV_AOUT_LC_InitVoutLoop

;; update the AOUT pins

rcall CV_AOUT_LC_Update

return

__endasm;

}

void CV_AOUT_LC_Load2SR(void) {

    __asm

        bcf    CV_AOUT_LC_LAT_SCLK, CV_AOUT_LC_PIN_SCLK ; clear clock

;; superfast transfer with unrolled loop (takes some memory, but guarantees the

;; lowest system load :slight_smile:

CV_AOUT_LC_WRITE_BIT MACRO reg, bit

bcf CV_AOUT_LC_LAT_DOUT, CV_AOUT_LC_PIN_DOUT ; set out pin depending on register content (reg.bit)

btfsc reg, bit

bsf CV_AOUT_LC_LAT_DOUT, CV_AOUT_LC_PIN_DOUT

nop

        bsf    CV_AOUT_LC_LAT_SCLK, CV_AOUT_LC_PIN_SCLK ; rising clock edge

        bcf    CV_AOUT_LC_LAT_SCLK, CV_AOUT_LC_PIN_SCLK ; falling clock edge

ENDM

CV_AOUT_LC_WRITE_BIT TMP1, 7

CV_AOUT_LC_WRITE_BIT TMP1, 6

CV_AOUT_LC_WRITE_BIT TMP1, 5

CV_AOUT_LC_WRITE_BIT TMP1, 4

CV_AOUT_LC_WRITE_BIT TMP1, 3

CV_AOUT_LC_WRITE_BIT TMP1, 2

CV_AOUT_LC_WRITE_BIT TMP1, 1

CV_AOUT_LC_WRITE_BIT TMP1, 0

CV_AOUT_LC_WRITE_BIT TMP2, 7

CV_AOUT_LC_WRITE_BIT TMP2, 6

CV_AOUT_LC_WRITE_BIT TMP2, 5

CV_AOUT_LC_WRITE_BIT TMP2, 4

CV_AOUT_LC_WRITE_BIT TMP2, 3

CV_AOUT_LC_WRITE_BIT TMP2, 2

CV_AOUT_LC_WRITE_BIT TMP2, 1

CV_AOUT_LC_WRITE_BIT TMP2, 0

;; this must be done once all SRs in the chain have been uploaded!

#if 0

        bsf    CV_AOUT_LC_LAT_RCLK, CV_AOUT_LC_PIN_RCLK ; latch SID values

bcf CV_AOUT_LC_LAT_DOUT, CV_AOUT_LC_PIN_DOUT ; clear out pin (standby)

        bcf    CV_AOUT_LC_LAT_RCLK, CV_AOUT_LC_PIN_RCLK ; release latch

#endif

__endasm;

}

void CV_AOUT_LC_LoadAOUTx_8_8(void)

{

__asm

;; 8bit/8bit

swapf PREINC1, W ; AOUT0_H[3:0] -> TMP2[7:4]

andlw 0xf0

movwf TMP2

movf POSTDEC1, W ; AOUT0_L

swapf INDF1, W ; AOUT0_L[7:4] -> TMP2[3:0]

andlw 0x0f

iorwf TMP2, F

movf POSTINC1, W ; AOUT0_H

movf POSTINC1, W ; AOUT1_L

swapf PREINC1, W ; AOUT1_H[3:0] -> TMP1[7:4]

andlw 0xf0

movwf TMP1

movf POSTDEC1, W ; AOUT1_L

swapf INDF1, W ; AOUT1_L[7:4] -> TMP1[3:0]

andlw 0x0f

iorwf TMP1, F

bsf POSTINC1, 7 ; AOUT1_H

movf POSTDEC1, W ; AOUT1_L

movf POSTDEC1, W ; AOUT0_H

bsf INDF1, 7 ; AOUT0_H

movf POSTDEC1, W ; AOUT0_L

rgoto _CV_AOUT_LC_Load2SR

__endasm;

}

// --------------------------------------------------------------------------

//  FUNCTION: CV_AOUT_LC_Update

//  DESCRIPTION: refreshes the AOUT pins if AOUT values have been changed

//  OUT:  -

//  USES: TMP[12345] and MIOS_PARAMETER[12]

// --------------------------------------------------------------------------

void CV_AOUT_LC_Update(void) {

__asm

;; check if any output has to be updated

IFCLR AOUT0_H, 7, rgoto CV_AOUT_LC_Update_SRs

IFCLR AOUT1_H, 7, rgoto CV_AOUT_LC_Update_SRs

IFCLR AOUT2_H, 7, rgoto CV_AOUT_LC_Update_SRs

IFCLR AOUT3_H, 7, rgoto CV_AOUT_LC_Update_SRs

IFCLR AOUT4_H, 7, rgoto CV_AOUT_LC_Update_SRs

IFCLR AOUT5_H, 7, rgoto CV_AOUT_LC_Update_SRs

IFCLR AOUT6_H, 7, rgoto CV_AOUT_LC_Update_SRs

IFCLR AOUT7_H, 7, rgoto CV_AOUT_LC_Update_SRs

rgoto _CV_AOUT_LC_Update_NoSRs

__endasm;

}

void CV_AOUT_LC_Update_SRs(void) {

__asm

lfsr FSR1, AOUT6_L ; loads AOUT6_[LH] and AOUT7_[LH]

rcall CV_AOUT_LC_LoadAOUTx_8_8

lfsr FSR1, AOUT4_L ; loads AOUT4_[LH] and AOUT5_[LH]

rcall CV_AOUT_LC_LoadAOUTx_8_8

lfsr FSR1, AOUT2_L ; loads AOUT2_[LH] and AOUT3_[LH]

rcall CV_AOUT_LC_LoadAOUTx_8_8

lfsr FSR1, AOUT0_L ; loads AOUT0_[LH] and AOUT1_[LH]

rcall _CV_AOUT_LC_LoadAOUTx_8_8

        bsf    CV_AOUT_LC_LAT_RCLK, CV_AOUT_LC_PIN_RCLK ; latch SID values

bcf CV_AOUT_LC_LAT_DOUT, CV_AOUT_LC_PIN_DOUT ; clear out pin (standby)

        bcf    CV_AOUT_LC_LAT_RCLK, CV_AOUT_LC_PIN_RCLK ; release latch

__endasm;

}

i’ve added properly the __asm and endasm; for each parts…now the reports tell me that a lot of symbol are not defined (MIOS_PARAMETER3,POSTINC0,INDF1…)it’s like the asm code was not integrated correctly… :frowning:

as the snippet has just 193 lines, I expect the error has been before…

let’s see what looks suspicious:

  • line 54: you should move the [tt]return[/tt] after the [tt]__endasm; [/tt]==>

[tt]__endasm;

return;

}[/tt]

  • line 93: [tt]#if 0[/tt]

if 0 will never be true and therefore will never be processed? is that okay?

in cases like these, there might be an error in the header file?

besides the “return;” I can see no syntax error.

[tt]MIOS_PARAMETER3[/tt] is declared in cmios.h wich is included correctly. let’s see if that [tt]return; [/tt]solves it…

there is only header text before, this is the full file..

your hint don’t solve the problems, here is a quote of the errors reports:

.objs\aout.asm:216:Error [108] Illegal Character (,)

.objs\aout.asm:216:Error [128] Missing argument(s).

.objs\aout.asm:217:Error [113] Symbol not previously defined (CV_AOUT_LC_LoadAOUTx_8_8).

.objs\aout.asm:218:Error [108] Illegal Character (,)

.objs\aout.asm:218:Error [128] Missing argument(s).

.objs\aout.asm:219:Error [113] Symbol not previously defined (CV_AOUT_LC_LoadAOUTx_8_8).

.objs\aout.asm:220:Error [108] Illegal Character (,)

.objs\aout.asm:220:Error [128] Missing argument(s).

.objs\aout.asm:221:Error [113] Symbol not previously defined (CV_AOUT_LC_LoadAOUTx_8_8).

.objs\aout.asm:222:Error [108] Illegal Character (,)

.objs\aout.asm:222:Error [128] Missing argument(s).

.objs\aout.asm:224:Error [128] Missing argument(s).

.objs\aout.asm:225:Error [128] Missing argument(s).

.objs\aout.asm:226:Error [128] Missing argument(s).

.objs\aout.asm:237:Error [103] syntax error

.objs\aout.asm:238:Error [103] syntax error

.objs\aout.asm:239:Error [103] syntax error

.objs\aout.asm:240:Error [103] syntax error

.objs\aout.asm:241:Error [103] syntax error

.objs\aout.asm:242:Error [103] syntax error

.objs\aout.asm:243:Error [103] syntax error

.objs\aout.asm:244:Error [103] syntax error

.objs\aout.asm:245:Error [174] Unknown opcode “rgoto”

.objs\aout.asm:256:Warning [203] Found opcode in column 1.

.objs\aout.asm:257:Error [103] syntax error

.objs\aout.asm:260:Error [113] Symbol not previously defined (TMP2).

.objs\aout.asm:260:Error [113] Symbol not previously defined (TMP2).

.objs\aout.asm:262:Warning [203] Found opcode in column 1.

.objs\aout.asm:262:Error [113] Symbol not previously defined (INDF1).

.objs\aout.asm:262:Error [113] Symbol not previously defined (INDF1).

.objs\aout.asm:263:Error [103] syntax error

.objs\aout.asm:266:Error [113] Symbol not previously defined (TMP2).

.objs\aout.asm:266:Error [113] Symbol not previously defined (TMP2).

.objs\aout.asm:267:Error [113] Symbol not previously defined (POSTINC1).

.objs\aout.asm:267:Error [113] Symbol not previously defined (POSTINC1).

.objs\aout.asm:268:Error [113] Symbol not previously defined (POSTINC1).

.objs\aout.asm:268:Error [113] Symbol not previously defined (POSTINC1).

.objs\aout.asm:269:Warning [203] Found opcode in column 1.

.objs\aout.asm:270:Error [103] syntax error

.objs\aout.asm:273:Error [113] Symbol not previously defined (TMP1).

.objs\aout.asm:273:Error [113] Symbol not previously defined (TMP1).

pic16_allocRegByName:963 symbol name _aout_value regop= 00000000

.objs\aout.asm:275:Warning [203] Found opcode in column 1.

pic16_allocRegByName:963 symbol name _last_aout_value regop= 00000000

.objs\aout.asm:275:Error [113] Symbol not previously defined (INDF1).

pic16_allocRegByName:963 symbol name _aout_gates regop= 00000000

.objs\aout.asm:275:Error [113] Symbol not previously defined (INDF1).

pic16_allocRegByName:963 symbol name _last_aout_gates regop= 00000000

.objs\aout.asm:276:Error [103] syntax error

.objs\aout.asm:279:Error [113] Symbol not previously defined (TMP1).

.objs\aout.asm:279:Error [113] Symbol not previously defined (TMP1).

.objs\aout.asm:280:Error [113] Symbol not previously defined (POSTINC1).

.objs\aout.asm:280:Error [113] Symbol not previously defined (POSTINC1).

.objs\aout.asm:283:Error [113] Symbol not previously defined (INDF1).

.objs\aout.asm:283:Error [113] Symbol not previously defined (INDF1).

.objs\aout.asm:285:Error [174] Unknown opcode “rgoto”

.objs\aout.asm:295:Error [128] Missing argument(s).

.objs\aout.asm:298:Error [103] syntax error

.objs\aout.asm:299:Error [128] Missing argument(s).

.objs\aout.asm:300:Error [113] Symbol not previously defined (reg).

.objs\aout.asm:300:Error [113] Symbol not previously defined (reg).

.objs\aout.asm:300:Error [113] Symbol not previously defined (bit).

.objs\aout.asm:301:Error [128] Missing argument(s).

.objs\aout.asm:303:Error [128] Missing argument(s).

.objs\aout.asm:304:Error [128] Missing argument(s).

.objs\aout.asm:305:Error [145] Unmatched ENDM.

.objs\aout.asm:306:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:307:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:308:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:309:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:310:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:311:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:312:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:313:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:314:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:315:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:316:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:317:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:318:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:319:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:320:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:321:Error [174] Unknown opcode “CV_AOUT_LC_WRITE_BIT”

.objs\aout.asm:323:Error [128] Missing argument(s).

.objs\aout.asm:324:Error [128] Missing argument(s).

.objs\aout.asm:325:Error [128] Missing argument(s).

.objs\aout.asm:336:Error [128] Missing argument(s).

.objs\aout.asm:337:Error [128] Missing argument(s).

.objs\aout.asm:338:Error [128] Missing argument(s).

.objs\aout.asm:340:Error [108] Illegal Character (,)

.objs\aout.asm:340:Error [128] Missing argument(s).

.objs\aout.asm:342:Error [113] Symbol not previously defined (MIOS_PARAMETER3).

.objs\aout.asm:342:Error [113] Symbol not previously defined (MIOS_PARAMETER3).

.objs\aout.asm:343:Error [174] Unknown opcode “CV_AOUT_LC_InitVoutLoop”

.objs\aout.asm:344:Error [113] Symbol not previously defined (POSTINC0).

.objs\aout.asm:344:Error [113] Symbol not previously defined (POSTINC0).

.objs\aout.asm:346:Error [113] Symbol not previously defined (POSTINC0).

.objs\aout.asm:346:Error [113] Symbol not previously defined (POSTINC0).

.objs\aout.asm:347:Error [113] Symbol not previously defined (MIOS_PARAMETER3).

.objs\aout.asm:347:Error [113] Symbol not previously defined (MIOS_PARAMETER3).

.objs\aout.asm:348:Error [174] Unknown opcode “rgoto”

.objs\aout.asm:350:Error [113] Symbol not previously defined (CV_AOUT_LC_Update).

where have I to define this symbols?

Moxi,

you just have to care about the very first errors. Most time the rest of the errors are a result of the first one.

An illegal character is reported right before CV_AOUT_LC_LoadAOUTx_8_8, if I count these line-numbers (113) up to 108, this brings us straight to your “#if 0” thing.

please remove this completely from the code and compile again:

;; this must be done once all SRs in the chain have been uploaded!
#if 0
        bsf    CV_AOUT_LC_LAT_RCLK, CV_AOUT_LC_PIN_RCLK  ; latch SID values
  bcf  CV_AOUT_LC_LAT_DOUT, CV_AOUT_LC_PIN_DOUT  ; clear out pin (standby)
        bcf    CV_AOUT_LC_LAT_RCLK, CV_AOUT_LC_PIN_RCLK  ; release latch
#endif

When I think about it, it seems very likely that C-preprocessor directors are not supported in ASM codesnippets!

I bet this is it!

it’s the same report with removing what you say.. :frowning:

can you send me both the header and the source file and I see if I can compile it…

yes:

http://soundandbreakfast.ifrance.com/divers/aout.c

http://soundandbreakfast.ifrance.com/divers/aout.h