"Missing definition" errors ...

piklab
prometx
2012-09-26
2013-05-20
  • prometx
    prometx
    2012-09-26

    Hello,

    I'm trying to get start programming PICS in Piklab on a P18F4320. I'm using an old MPLAB ICD2 and a, similarly ancient, Qwickflash dev board. I'm trying to understand how to reference registers in C using the SDCC compiler. I'm attempting the following simple C code:

      
      
    /* ----------------------------------------------------------------------- */
    /* Configuration bits: adapt to your setup and needs */
    /* ----------------------------------------------------------------------- */
    /* Template source file generated by piklab */
    #include <pic18fregs.h> 
    #include <delay.h>
    unsigned int i; void main(void) 
    { 
      
      TRISD.TRISD4 = 0; 
    while(1) 
    { 
      PORTD.RD4=1; 
      for (i=1;i<1000;i++); 
      PORTD.RD4=0; 
      for (i=1;i<1000;i++); 
      
    } 
    }
    

    I've removed some other things, like configuration bits, to focus on the compilation failure of the above, which results in:

    sdcc --use-non-free -mpic16 -p18f4320 -V --debug -I/home/promet/piklab-projects/ -c PIC18F4320.c 
    + "/usr/bin/sdcpp" -nostdinc -Wall -I"/home/promet/piklab-projects/" -Dpic18f4320 -D__18f4320 -DSTACK_MODEL_SMALL -obj-ext=.o -DSDCC_MODEL_SMALL -DSDCC=290 -DSDCC_REVISION=5416 -DSDCC_pic16 -D__pic16 -isystem "/usr/bin/../share/sdcc/include/pic16" -isystem "/usr/share/sdcc/include/pic16" -isystem "/usr/bin/../share/sdcc/include" -isystem "/usr/share/sdcc/include" "PIC18F4320.c"  
    warning 117: unknown compiler option '--use-non-free' ignored 
    PIC18F4320.c:17: error: 25: Structure/Union expected left of '.->' 
    PIC18F4320.c:22: error: 25: Structure/Union expected left of '.->' 
    PIC18F4320.c:24: error: 25: Structure/Union expected left of '.->' 
    *** Exited with status: 1 ***
    

    I can't seem to get the syntax correct to address various pins/registers. I'd consulted the included "pic18f43920.h" (included referenced in the above noted "pic18fregs.h" file), which simply is an include of the "pic18f4220.h" file. I tried using the various syntax in that (4220.h) file to find definitions to enter into my code to address registers/pins, etc. but, though defined there, the defined syntax seems to produce a lot of errors from the compiler.

    Probably, well, obviously, I'm doing it incorrectly. I'd appreciate any input anyone might have, and thanks for your time.

     
  • Alain Portal
    Alain Portal
    2012-09-26

    When you report problems, please give the version of tools you use.

    If you want to access to only one bit of a register, you have to use the associated structure instead of the register name, eg.:
    TRISDbits.TRISD4 = 0;

    PORTDbits.RD4=1;
    PORTDbits.RD4=0;

    Untested, but should work.

     
  • prometx
    prometx
    2012-09-26

    Ah sorry about that, I'm using

    Piklab
    Version 0.16.1
    Using KDE Development Platform 4.8.5 (4.8.5)

    Thanks very much for the reply, I will try and implement with the above syntax. Thanks very much for your time!

    P

     
  • prometx
    prometx
    2012-09-26

    Hi,

    Also, re: versions,

    sdcc --version
    

    reports this

    SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.9.0 #5416 (Feb  3 2010) (UNIX)
    

    Compilation of this code

      
    /* ----------------------------------------------------------------------- */
    /* Configuration bits: adapt to your setup and needs */
    /* ----------------------------------------------------------------------- */
    /* Template source file generated by piklab */
    #include <pic18fregs.h> 
    #include <delay.h>
    unsigned int i; void main(void) 
    { 
      
      TRISDbits.TRISD4 = 0; 
    while(1) 
    { 
      PORTDbits.RD4=1; 
      for (i=1;i<1000;i++); 
      PORTDbits.RD4=0; 
      for (i=1;i<1000;i++); 
      
    } 
    }
    

    Fails with this result

    sdcc --use-non-free -mpic16 -p18f4320 -V --debug -I/home/promet/piklab-projects/ -c PIC18F4320.c 
    + "/usr/bin/sdcpp" -nostdinc -Wall -I"/home/promet/piklab-projects/" -Dpic18f4320 -D__18f4320 -DSTACK_MODEL_SMALL -obj-ext=.o -DSDCC_MODEL_SMALL -DSDCC=290 -DSDCC_REVISION=5416 -DSDCC_pic16 -D__pic16 -isystem "/usr/bin/../share/sdcc/include/pic16" -isystem "/usr/share/sdcc/include/pic16" -isystem "/usr/bin/../share/sdcc/include" -isystem "/usr/share/sdcc/include" "PIC18F4320.c"  
    + "/usr/bin/gpasm" -DSDCC_MODEL_SMALL -DSTACK_MODEL_SMALL -g -c "PIC18F4320.asm" -o "PIC18F4320.o" 
    warning 117: unknown compiler option '--use-non-free' ignored 
    sdcc --use-non-free -mpic16 -p18f4320 -V --debug -Wl-c -Wl-m -I/home/promet/piklab-projects/ -oPIC18F4320.hex PIC18F4320.o 
    warning 117: unknown compiler option '--use-non-free' ignored 
    using default linker script "/usr/share/gputils/lkr/18f4320.lkr" 
    missing definition for symbol "_TRISDbits", required by "PIC18F4320.o" 
    + "/usr/bin/gplink" -I"/usr/bin/../share/sdcc/lib/pic16" -I"/usr/share/sdcc/lib/pic16" -I"/usr/bin/../share/sdcc/lib" -I"/usr/share/sdcc/lib" -c -m -w -r -o PIC18F4320.hex PIC18F4320.o crt0i.o libdev18f4320.lib libsdcc.lib  
    + "/usr/bin/gplink" -I"/usr/bin/../share/sdcc/lib/pic16" -I"/usr/share/sdcc/lib/pic16" -I"/usr/bin/../share/sdcc/lib" -I"/usr/share/sdcc/lib" -c -m -w -r -o PIC18F4320.hex PIC18F4320.o crt0i.o libdev18f4320.lib libsdcc.lib returned errorcode 256 
    *** Exited with status: 1 ***
    

    It seems to not be kosher with the "TRISDbits" syntax, strangely. I will fish around in the headers and see if I can find out why. Thanks again!

     
  • prometx
    prometx
    2012-09-26

    Also, in case anyone finds it useful, here are the contents of the header file "pic18f4220.h" which, in my installation, is included as the header data for the file "pic18f4320.h" which, in turn, is included by the (as I understand it), "catch-all" header "pic18fregs.h" in the code above:

    /*
     * pic18f4220.h - PIC18F4220 Device Library Header
     *
     * This file is part of the GNU PIC Library.
     *
     * January, 2004
     * The GNU PIC Library is maintained by,
     *  Vangelis Rokas <vrokas@otenet.gr>
     *
     * $Id: pic18f4220.h 5369 2009-02-09 23:45:54Z tecodev $
     *
     */
    #ifndef __PIC18F4220_H__
    #define __PIC18F4220_H__
    extern __sfr __at (0xf80) PORTA;
    typedef union {
        struct {
            unsigned RA0:1;
            unsigned RA1:1;
            unsigned RA2:1;
            unsigned RA3:1;
            unsigned RA4:1;
            unsigned RA5:1;
            unsigned RA6:1;
            unsigned RA7:1;
        };
        struct {
            unsigned AN0:1;
            unsigned AN1:1;
            unsigned AN2:1;
            unsigned AN3:1;
            unsigned :1;
            unsigned AN4:1;
            unsigned OSC2:1;
            unsigned :1;
        };
        struct {
            unsigned :1;
            unsigned :1;
            unsigned VREFM:1;
            unsigned VREFP:1;
            unsigned T0CKI:1;
            unsigned SS:1;
            unsigned CLK0:1;
            unsigned :1;
        };
        struct {
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned LVDIN:1;
            unsigned :1;
            unsigned :1;
        };
    } __PORTAbits_t;
    extern volatile __PORTAbits_t __at (0xf80) PORTAbits;
    extern __sfr __at (0xf81) PORTB;
    typedef union {
        struct {
            unsigned RB0:1;
            unsigned RB1:1;
            unsigned RB2:1;
            unsigned RB3:1;
            unsigned RB4:1;
            unsigned RB5:1;
            unsigned RB6:1;
            unsigned RB7:1;
        };
        struct {
            unsigned INT0:1;
            unsigned INT1:1;
            unsigned INT2:1;
            unsigned CCP2:1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
        };
        struct {
            unsigned AN12:1;
            unsigned AN10:1;
            unsigned AN8:1;
            unsigned AN9:1;
            unsigned AN11:1;
            unsigned KBI1:1;
            unsigned KBI2:1;
            unsigned KBI3:1;
        };
    } __PORTBbits_t;
    extern volatile __PORTBbits_t __at (0xf81) PORTBbits;
    extern __sfr __at (0xf82) PORTC;
    typedef union {
        struct {
            unsigned RC0:1;
            unsigned RC1:1;
            unsigned RC2:1;
            unsigned RC3:1;
            unsigned RC4:1;
            unsigned RC5:1;
            unsigned RC6:1;
            unsigned RC7:1;
        };
        struct {
            unsigned T1OSO:1;
            unsigned T1OSI:1;
            unsigned :1;
            unsigned SCK:1;
            unsigned SDI:1;
            unsigned SDO:1;
            unsigned TX:1;
            unsigned RX:1;
        };
        struct {
            unsigned T1CKI:1;
            unsigned CCP2:1;
            unsigned CCP1:1;
            unsigned SCL:1;
            unsigned SDA:1;
            unsigned :1;
            unsigned CK:1;
            unsigned DT:1;
        };
    } __PORTCbits_t;
    extern volatile __PORTCbits_t __at (0xf82) PORTCbits;
    extern __sfr __at (0xf83) PORTD;
    typedef union {
        struct {
            unsigned RD0:1;
            unsigned RD1:1;
            unsigned RD2:1;
            unsigned RD3:1;
            unsigned RD4:1;
            unsigned RD5:1;
            unsigned RD6:1;
            unsigned RD7:1;
        };
        struct {
            unsigned PSP0:1;
            unsigned PSP1:1;
            unsigned PSP2:1;
            unsigned PSP3:1;
            unsigned PSP4:1;
            unsigned PSP5:1;
            unsigned PSP6:1;
            unsigned PSP7:1;
        };
        struct {
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned P1B:1;
            unsigned P1C:1;
            unsigned P1D:1;
        };
    } __PORTDbits_t;
    extern volatile __PORTDbits_t __at (0xf83) PORTDbits;
    extern __sfr __at (0xf84) PORTE;
    typedef union {
        struct {
            unsigned RE0:1;
            unsigned RE1:1;
            unsigned RE2:1;
            unsigned RE3:1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
        };
        struct {
            unsigned AN5:1;
            unsigned AN6:1;
            unsigned AN7:1;
            unsigned MCLR:1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
        };
        struct {
            unsigned RD:1;
            unsigned WR:1;
            unsigned CS:1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
        };
    } __PORTEbits_t;
    extern volatile __PORTEbits_t __at (0xf84) PORTEbits;
    extern __sfr __at (0xf89) LATA;
    typedef union {
        struct {
            unsigned LATA0:1;
            unsigned LATA1:1;
            unsigned LATA2:1;
            unsigned LATA3:1;
            unsigned LATA4:1;
            unsigned LATA5:1;
            unsigned LATA6:1;
            unsigned :1;
        };
    } __LATAbits_t;
    extern volatile __LATAbits_t __at (0xf89) LATAbits;
    extern __sfr __at (0xf8a) LATB;
    typedef union {
        struct {
            unsigned LATB0:1;
            unsigned LATB1:1;
            unsigned LATB2:1;
            unsigned LATB3:1;
            unsigned LATB4:1;
            unsigned LATB5:1;
            unsigned LATB6:1;
            unsigned LATB7:1;
        };
    } __LATBbits_t;
    extern volatile __LATBbits_t __at (0xf8a) LATBbits;
    extern __sfr __at (0xf8b) LATC;
    typedef union {
        struct {
            unsigned LATC0:1;
            unsigned LATC1:1;
            unsigned LATC2:1;
            unsigned LATC3:1;
            unsigned LATC4:1;
            unsigned LATC5:1;
            unsigned LATC6:1;
            unsigned LATC7:1;
        };
    } __LATCbits_t;
    extern volatile __LATCbits_t __at (0xf8b) LATCbits;
    extern __sfr __at (0xf8c) LATD;
    typedef union {
        struct {
            unsigned LATD0:1;
            unsigned LATD1:1;
            unsigned LATD2:1;
            unsigned LATD3:1;
            unsigned LATD4:1;
            unsigned LATD5:1;
            unsigned LATD6:1;
            unsigned LATD7:1;
        };
    } __LATDbits_t;
    extern volatile __LATDbits_t __at (0xf8c) LATDbits;
    extern __sfr __at (0xf8d) LATE;
    typedef union {
        struct {
            unsigned LATE0:1;
            unsigned LATE1:1;
            unsigned LATE2:1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
        };
    } __LATEbits_t;
    extern volatile __LATEbits_t __at (0xf8d) LATEbits;
    extern __sfr __at (0xf92) TRISA;
    typedef union {
        struct {
            unsigned TRISA0:1;
            unsigned TRISA1:1;
            unsigned TRISA2:1;
            unsigned TRISA3:1;
            unsigned TRISA4:1;
            unsigned TRISA5:1;
            unsigned TRISA6:1;
            unsigned :1;
        };
    } __TRISAbits_t;
    extern volatile __TRISAbits_t __at (0xf92) TRISAbits;
    extern __sfr __at (0xf93) TRISB;
    typedef union {
        struct {
            unsigned TRISB0:1;
            unsigned TRISB1:1;
            unsigned TRISB2:1;
            unsigned TRISB3:1;
            unsigned TRISB4:1;
            unsigned TRISB5:1;
            unsigned TRISB6:1;
            unsigned TRISB7:1;
        };
    } __TRISBbits_t;
    extern volatile __TRISBbits_t __at (0xf93) TRISBbits;
    extern __sfr __at (0xf94) TRISC;
    typedef union {
        struct {
            unsigned TRISC0:1;
            unsigned TRISC1:1;
            unsigned TRISC2:1;
            unsigned TRISC3:1;
            unsigned TRISC4:1;
            unsigned TRISC5:1;
            unsigned TRISC6:1;
            unsigned TRISC7:1;
        };
    } __TRISCbits_t;
    extern volatile __TRISCbits_t __at (0xf94) TRISCbits;
    extern __sfr __at (0xf95) TRISD;
    typedef union {
        struct {
            unsigned TRISD0:1;
            unsigned TRISD1:1;
            unsigned TRISD2:1;
            unsigned TRISD3:1;
            unsigned TRISD4:1;
            unsigned TRISD5:1;
            unsigned TRISD6:1;
            unsigned TRISD7:1;
        };
    } __TRISDbits_t;
    extern volatile __TRISDbits_t __at (0xf95) TRISDbits;
    extern __sfr __at (0xf96) TRISE;
    typedef union {
        struct {
            unsigned TRISE0:1;
            unsigned TRISE1:1;
            unsigned TRISE2:1;
            unsigned :1;
            unsigned PSPMODE:1;
            unsigned IBOV:1;
            unsigned OBF:1;
            unsigned IBF:1;
        };
    } __TRISEbits_t;
    extern volatile __TRISEbits_t __at (0xf96) TRISEbits;
    extern __sfr __at (0xf9b) OSCTUNE;
    typedef union {
        struct {
            unsigned TUN0:1;
            unsigned TUN1:1;
            unsigned TUN2:1;
            unsigned TUN3:1;
            unsigned TUN4:1;
            unsigned TUN5:1;
            unsigned :1;
            unsigned :1;
        };
    } __OSCTUNEbits_t;
    extern volatile __OSCTUNEbits_t __at (0xf9b) OSCTUNEbits;
    extern __sfr __at (0xf9d) PIE1;
    typedef union {
        struct {
            unsigned TMR1IE:1;
            unsigned TMR2IE:1;
            unsigned CCP1IE:1;
            unsigned SSPIE:1;
            unsigned TXIE:1;
            unsigned RCIE:1;
            unsigned ADIE:1;
            unsigned PSPIE:1;
        };
    } __PIE1bits_t;
    extern volatile __PIE1bits_t __at (0xf9d) PIE1bits;
    extern __sfr __at (0xf9e) PIR1;
    typedef union {
        struct {
            unsigned TMR1IF:1;
            unsigned TMR2IF:1;
            unsigned CCP1IF:1;
            unsigned SSPIF:1;
            unsigned TXIF:1;
            unsigned RCIF:1;
            unsigned ADIF:1;
            unsigned PSPIF:1;
        };
    } __PIR1bits_t;
    extern volatile __PIR1bits_t __at (0xf9e) PIR1bits;
    extern __sfr __at (0xf9f) IPR1;
    typedef union {
        struct {
            unsigned TMR1IP:1;
            unsigned TMR2IP:1;
            unsigned CCP1IP:1;
            unsigned SSPIP:1;
            unsigned TXIP:1;
            unsigned RCIP:1;
            unsigned ADIP:1;
            unsigned PSPIP:1;
        };
    } __IPR1bits_t;
    extern volatile __IPR1bits_t __at (0xf9f) IPR1bits;
    extern __sfr __at (0xfa0) PIE2;
    typedef union {
        struct {
            unsigned CCP2IE:1;
            unsigned TMR3IE:1;
            unsigned LVDIE:1;
            unsigned BCLIE:1;
            unsigned EEIE:1;
            unsigned :1;
            unsigned CMIE:1;
            unsigned OSCFIE:1;
        };
    } __PIE2bits_t;
    extern volatile __PIE2bits_t __at (0xfa0) PIE2bits;
    extern __sfr __at (0xfa1) PIR2;
    typedef union {
        struct {
            unsigned CCP2IF:1;
            unsigned TMR3IF:1;
            unsigned LVDIF:1;
            unsigned BCLIF:1;
            unsigned EEIF:1;
            unsigned :1;
            unsigned CMIF:1;
            unsigned OSCFIF:1;
        };
    } __PIR2bits_t;
    extern volatile __PIR2bits_t __at (0xfa1) PIR2bits;
    extern __sfr __at (0xfa2) IPR2;
    typedef union {
        struct {
            unsigned CCP2IP:1;
            unsigned TMR3IP:1;
            unsigned LVDIP:1;
            unsigned BCLIP:1;
            unsigned EEIP:1;
            unsigned :1;
            unsigned CMIP:1;
            unsigned OSCFIP:1;
        };
    } __IPR2bits_t;
    extern volatile __IPR2bits_t __at (0xfa2) IPR2bits;
    extern __sfr __at (0xfa6) EECON1;
    typedef union {
        struct {
            unsigned RD:1;
            unsigned WR:1;
            unsigned WREN:1;
            unsigned WRERR:1;
            unsigned FREE:1;
            unsigned :1;
            unsigned CFGS:1;
            unsigned EEPGD:1;
        };
    } __EECON1bits_t;
    extern volatile __EECON1bits_t __at (0xfa6) EECON1bits;
    extern __sfr __at (0xfa7) EECON2;
    extern __sfr __at (0xfa8) EEDATA;
    extern __sfr __at (0xfa9) EEADR;
    extern __sfr __at (0xfab) RCSTA;
    typedef union {
        struct {
            unsigned RX9D:1;
            unsigned OERR:1;
            unsigned FERR:1;
            unsigned ADDEN:1;
            unsigned CREN:1;
            unsigned SREN:1;
            unsigned RX9:1;
            unsigned SPEN:1;
        };
    } __RCSTAbits_t;
    extern volatile __RCSTAbits_t __at (0xfab) RCSTAbits;
    extern __sfr __at (0xfac) TXSTA;
    typedef union {
        struct {
            unsigned TX9D:1;
            unsigned TRMT:1;
            unsigned BRGH:1;
            unsigned :1;
            unsigned SYNC:1;
            unsigned TXEN:1;
            unsigned TX9:1;
            unsigned CSRC:1;
        };
    } __TXSTAbits_t;
    extern volatile __TXSTAbits_t __at (0xfac) TXSTAbits;
    extern __sfr __at (0xfad) TXREG;
    extern __sfr __at (0xfae) RCREG;
    extern __sfr __at (0xfaf) SPBRG;
    extern __sfr __at (0xfb1) T3CON;
    typedef union {
        struct {
            unsigned TMR3ON:1;
            unsigned TMR3CS:1;
            unsigned T3SYNC:1;
            unsigned T3CCP1:1;
            unsigned T3CKPS0:1;
            unsigned T3CKPS1:1;
            unsigned T3CCP2:1;
            unsigned RD16:1;
        };
    } __T3CONbits_t;
    extern volatile __T3CONbits_t __at (0xfb1) T3CONbits;
    extern __sfr __at (0xfb2) TMR3L;
    extern __sfr __at (0xfb3) TMR3H;
    extern __sfr __at (0xfb4) CMCON;
    typedef union {
        struct {
            unsigned CM0:1;
            unsigned CM1:1;
            unsigned CM2:1;
            unsigned CIS:1;
            unsigned C1INV:1;
            unsigned C2INV:1;
            unsigned C1OUT:1;
            unsigned C2OUT:1;
        };
    } __CMCONbits_t;
    extern volatile __CMCONbits_t __at (0xfb4) CMCONbits;
    extern __sfr __at (0xfb5) CVRCON;
    typedef union {
        struct {
            unsigned CVR0:1;
            unsigned CVR1:1;
            unsigned CVR2:1;
            unsigned CVR3:1;
            unsigned CVREF:1;
            unsigned CVRR:1;
            unsigned CVROE:1;
            unsigned CVREN:1;
        };
    } __CVRCONbits_t;
    extern volatile __CVRCONbits_t __at (0xfb5) CVRCONbits;
    extern __sfr __at (0xfba) CCP2CON;
    typedef union {
        struct {
            unsigned CCP2M0:1;
            unsigned CCP2M1:1;
            unsigned CCP2M2:1;
            unsigned CCP2M3:1;
            unsigned DCCP2Y:1;
            unsigned DCCP2X:1;
            unsigned :1;
            unsigned :1;
        };
    } __CCP2CONbits_t;
    extern volatile __CCP2CONbits_t __at (0xfba) CCP2CONbits;
    extern __sfr __at (0xfbb) CCPR2L;
    extern __sfr __at (0xfbc) CCPR2H;
    extern __sfr __at (0xfbd) CCP1CON;
    typedef union {
        struct {
            unsigned CCP1M0:1;
            unsigned CCP1M1:1;
            unsigned CCP1M2:1;
            unsigned CCP1M3:1;
            unsigned DC1B0:1;
            unsigned DC1B1:1;
            unsigned P1M0:1;
            unsigned P1M1:1;
        };
    } __CCP1CONbits_t;
    extern volatile __CCP1CONbits_t __at (0xfbd) CCP1CONbits;
    extern __sfr __at (0xfb7) PWM1CON;
    typedef union {
        struct {
            unsigned PDC0:1;
            unsigned PDC1:1;
            unsigned PDC2:1;
            unsigned PDC3:1;
            unsigned PDC4:1;
            unsigned PDC5:1;
            unsigned PDC6:1;
            unsigned PRSEN:1;
        };
    } __PWM1CONbits_t;
    extern volatile __PWM1CONbits_t __at (0xfb7) PWM1CONbits;
    extern __sfr __at (0xfb6) ECCPAS;
    typedef union {
        struct {
            unsigned PSSBD0:1;
            unsigned PSSBD1:1;
            unsigned PSSAC0:1;
            unsigned PSSAC1:1;
            unsigned ECCPAS0:1;
            unsigned ECCPAS1:1;
            unsigned ECCPAS2:1;
            unsigned ECCPASE:1;
        };
    } __ECCPASbits_t;
    extern volatile __ECCPASbits_t __at (0xfb6) ECCPASbits;
    extern __sfr __at (0xfbe) CCPR1L;
    extern __sfr __at (0xfbf) CCPR1H;
    extern __sfr __at (0xfc0) ADCON2;
    typedef union {
        struct {
            unsigned ADCS0:1;
            unsigned ADCS1:1;
            unsigned ADCS2:1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned ADFM:1;
        };
    } __ADCON2bits_t;
    extern volatile __ADCON2bits_t __at (0xfc0) ADCON2bits;
    extern __sfr __at (0xfc1) ADCON1;
    typedef union {
        struct {
            unsigned PCFG0:1;
            unsigned PCFG1:1;
            unsigned PCFG2:1;
            unsigned PCFG3:1;
            unsigned VCFG0:1;
            unsigned VCFG1:1;
            unsigned :1;
            unsigned :1;
        };
    } __ADCON1bits_t;
    extern volatile __ADCON1bits_t __at (0xfc1) ADCON1bits;
    extern __sfr __at (0xfc2) ADCON0;
    typedef union {
        struct {
            unsigned ADON:1;
            unsigned GO:1;
            unsigned CHS0:1;
            unsigned CHS1:1;
            unsigned CHS2:1;
            unsigned CHS3:1;
            unsigned :1;
            unsigned :1;
        };
    } __ADCON0bits_t;
    extern volatile __ADCON0bits_t __at (0xfc2) ADCON0bits;
    extern __sfr __at (0xfc3) ADRESL;
    extern __sfr __at (0xfc4) ADRESH;
    extern __sfr __at (0xfc5) SSPCON2;
    typedef union {
        struct {
            unsigned SEN:1;
            unsigned RSEN:1;
            unsigned PEN:1;
            unsigned RCEN:1;
            unsigned ACKEN:1;
            unsigned ACKDT:1;
            unsigned ACKSTAT:1;
            unsigned GCEN:1;
        };
    } __SSPCON2bits_t;
    extern volatile __SSPCON2bits_t __at (0xfc5) SSPCON2bits;
    extern __sfr __at (0xfc6) SSPCON1;
    typedef union {
        struct {
            unsigned SSPM0:1;
            unsigned SSPM1:1;
            unsigned SSPM2:1;
            unsigned SSPM3:1;
            unsigned CKP:1;
            unsigned SSPEN:1;
            unsigned SSPOV:1;
            unsigned WCOL:1;
        };
    } __SSPCON1bits_t;
    extern volatile __SSPCON1bits_t __at (0xfc6) SSPCON1bits;
    extern __sfr __at (0xfc7) SSPSTAT;
    typedef union {
        struct {
            unsigned BF:1;
            unsigned UA:1;
            unsigned R_W:1;
            unsigned S:1;
            unsigned P:1;
            unsigned D_A:1;
            unsigned CKE:1;
            unsigned SMP:1;
        };
    } __SSPSTATbits_t;
    extern volatile __SSPSTATbits_t __at (0xfc7) SSPSTATbits;
    extern __sfr __at (0xfc8) SSPADD;
    extern __sfr __at (0xfc9) SSPBUF;
    extern __sfr __at (0xfca) T2CON;
    typedef union {
        struct {
            unsigned T2CKPS0:1;
            unsigned T2CKPS1:1;
            unsigned TMR2ON:1;
            unsigned TOUTPS0:1;
            unsigned TOUTPS1:1;
            unsigned TOUTPS2:1;
            unsigned TOUTPS3:1;
            unsigned :1;
        };
    } __T2CONbits_t;
    extern volatile __T2CONbits_t __at (0xfca) T2CONbits;
    extern __sfr __at (0xfcb) PR2;
    extern __sfr __at (0xfcc) TMR2;
    extern __sfr __at (0xfcd) T1CON;
    typedef union {
        struct {
            unsigned TMR1ON:1;
            unsigned TMR1CS:1;
            unsigned NOT_T1SYNC:1;
            unsigned T1OSCEN:1;
            unsigned T1CKPS0:1;
            unsigned T1CKPS1:1;
            unsigned :1;
            unsigned RD16:1;
        };
    } __T1CONbits_t;
    extern volatile __T1CONbits_t __at (0xfcd) T1CONbits;
    extern __sfr __at (0xfce) TMR1L;
    extern __sfr __at (0xfcf) TMR1H;
    extern __sfr __at (0xfd0) RCON;
    typedef union {
        struct {
            unsigned BOR:1;
            unsigned POR:1;
            unsigned PD:1;
            unsigned TO:1;
            unsigned RI:1;
            unsigned :1;
            unsigned :1;
            unsigned IPEN:1;
        };
    } __RCONbits_t;
    extern volatile __RCONbits_t __at (0xfd0) RCONbits;
    extern __sfr __at (0xfd1) WDTCON;
    typedef union {
        struct {
            unsigned SWDTEN:1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
        };
        struct {
            unsigned SWDTE:1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
        };
    } __WDTCONbits_t;
    extern volatile __WDTCONbits_t __at (0xfd1) WDTCONbits;
    extern __sfr __at (0xfd2) LVDCON;
    typedef union {
        struct {
            unsigned LVDL0:1;
            unsigned LVDL1:1;
            unsigned LVDL2:1;
            unsigned LVDL3:1;
            unsigned LVDEN:1;
            unsigned VRST:1;
            unsigned :1;
            unsigned :1;
        };
        struct {
            unsigned LVV0:1;
            unsigned LVV1:1;
            unsigned LVV2:1;
            unsigned LVV3:1;
            unsigned :1;
            unsigned BGST:1;
            unsigned :1;
            unsigned :1;
        };
    } __LVDCONbits_t;
    extern volatile __LVDCONbits_t __at (0xfd2) LVDCONbits;
    extern __sfr __at (0xfd3) OSCCON;
    typedef union {
        struct {
            unsigned SCS:1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
        };
    } __OSCCONbits_t;
    extern volatile __OSCCONbits_t __at (0xfd3) OSCCONbits;
    extern __sfr __at (0xfd5) T0CON;
    typedef union {
        struct {
            unsigned T0PS0:1;
            unsigned T0PS1:1;
            unsigned T0PS2:1;
            unsigned PSA:1;
            unsigned T0SE:1;
            unsigned T0CS:1;
            unsigned T08BIT:1;
            unsigned TMR0ON:1;
        };
    } __T0CONbits_t;
    extern volatile __T0CONbits_t __at (0xfd5) T0CONbits;
    extern __sfr __at (0xfd6) TMR0L;
    extern __sfr __at (0xfd7) TMR0H;
    extern __sfr __at (0xfd8) STATUS;
    typedef union {
        struct {
            unsigned C:1;
            unsigned DC:1;
            unsigned Z:1;
            unsigned OV:1;
            unsigned N:1;
            unsigned :1;
            unsigned :1;
            unsigned :1;
        };
    } __STATUSbits_t;
    extern volatile __STATUSbits_t __at (0xfd8) STATUSbits;
    extern __sfr __at (0xfd9) FSR2L;
    extern __sfr __at (0xfda) FSR2H;
    extern __sfr __at (0xfdb) PLUSW2;
    extern __sfr __at (0xfdc) PREINC2;
    extern __sfr __at (0xfdd) POSTDEC2;
    extern __sfr __at (0xfde) POSTINC2;
    extern __sfr __at (0xfdf) INDF2;
    extern __sfr __at (0xfe0) BSR;
    extern __sfr __at (0xfe1) FSR1L;
    extern __sfr __at (0xfe2) FSR1H;
    extern __sfr __at (0xfe3) PLUSW1;
    extern __sfr __at (0xfe4) PREINC1;
    extern __sfr __at (0xfe5) POSTDEC1;
    extern __sfr __at (0xfe6) POSTINC1;
    extern __sfr __at (0xfe7) INDF1;
    extern __sfr __at (0xfe8) WREG;
    extern __sfr __at (0xfe9) FSR0L;
    extern __sfr __at (0xfea) FSR0H;
    extern __sfr __at (0xfeb) PLUSW0;
    extern __sfr __at (0xfec) PREINC0;
    extern __sfr __at (0xfed) POSTDEC0;
    extern __sfr __at (0xfee) POSTINC0;
    extern __sfr __at (0xfef) INDF0;
    extern __sfr __at (0xff0) INTCON3;
    typedef union {
        struct {
            unsigned INT1F:1;
            unsigned INT2F:1;
            unsigned :1;
            unsigned INT1E:1;
            unsigned INT2E:1;
            unsigned :1;
            unsigned INT1P:1;
            unsigned INT2P:1;
        };
        struct {
            unsigned INT1IF:1;
            unsigned INT2IF:1;
            unsigned :1;
            unsigned INT1IE:1;
            unsigned INT2IE:1;
            unsigned :1;
            unsigned INT1IP:1;
            unsigned INT2IP:1;
        };
    } __INTCON3bits_t;
    extern volatile __INTCON3bits_t __at (0xff0) INTCON3bits;
    extern __sfr __at (0xff1) INTCON2;
    typedef union {
        struct {
            unsigned RBIP:1;
            unsigned :1;
            unsigned T0IP:1;
            unsigned :1;
            unsigned INTEDG2:1;
            unsigned INTEDG1:1;
            unsigned INTEDG0:1;
            unsigned RBPU:1;
        };
    } __INTCON2bits_t;
    extern volatile __INTCON2bits_t __at (0xff1) INTCON2bits;
    extern __sfr __at (0xff2) INTCON;
    typedef union {
        struct {
            unsigned RBIF:1;
            unsigned INT0F:1;
            unsigned T0IF:1;
            unsigned RBIE:1;
            unsigned INT0E:1;
            unsigned T0IE:1;
            unsigned PEIE:1;
            unsigned GIE:1;
        };
        struct {
            unsigned :1;
            unsigned INT0IF:1;
            unsigned TMR0IF:1;
            unsigned :1;
            unsigned INT0IE:1;
            unsigned TMR0IE:1;
            unsigned GIEL:1;
            unsigned GIEH:1;
        };
    } __INTCONbits_t;
    extern volatile __INTCONbits_t __at (0xff2) INTCONbits;
    extern __sfr __at (0xff3) PRODL;
    extern __sfr __at (0xff4) PRODH;
    extern __sfr __at (0xff5) TABLAT;
    extern __sfr __at (0xff6) TBLPTRL;
    extern __sfr __at (0xff7) TBLPTRH;
    extern __sfr __at (0xff8) TBLPTRU;
    extern __sfr __at (0xff9) PCL;
    extern __sfr __at (0xffa) PCLATH;
    extern __sfr __at (0xffb) PCLATU;
    extern __sfr __at (0xffc) STKPTR;
    typedef union {
        struct {
            unsigned STKPTR0:1;
            unsigned STKPTR1:1;
            unsigned STKPTR2:1;
            unsigned STKPTR3:1;
            unsigned STKPTR4:1;
            unsigned :1;
            unsigned STKUNF:1;
            unsigned STKFUL:1;
        };
    } __STKPTRbits_t;
    extern volatile __STKPTRbits_t __at (0xffc) STKPTRbits;
    extern __sfr __at (0xffd) TOSL;
    extern __sfr __at (0xffe) TOSH;
    extern __sfr __at (0xfff) TOSU;
    /* Configuration registers locations */
    #define __CONFIG1H  0x300001
    #define __CONFIG2L  0x300002
    #define __CONFIG2H  0x300003
    #define __CONFIG3H  0x300005
    #define __CONFIG4L  0x300006
    #define __CONFIG5L  0x300008
    #define __CONFIG5H  0x300009
    #define __CONFIG6L  0x30000A
    #define __CONFIG6H  0x30000B
    #define __CONFIG7L  0x30000C
    #define __CONFIG7H  0x30000D
    /* Oscillator 1H options */
    #define _OSC_11XX_1H    0xFC    /* 11XX EXT RC-CLKOUT on RA6 */
    #define _OSC_101X_1H    0xFA    /* 101X EXT RC-CLKOUT on RA6 */
    #define _OSC_INT_CLKOUT_on_RA6_Port_on_RA7_1H   0xF9    /* INT RC-CLKOUT_on_RA6_Port_on_RA7 */
    #define _OSC_INT_Port_on_RA6_Port_on_RA7_1H 0xF8    /* INT RC-Port_on_RA6_Port_on_RA7 */
    #define _OSC_EXT_Port_on_RA6_1H 0xF7    /* EXT RC-Port_on_RA6 */
    #define _OSC_HS_PLL_1H  0xF6    /* HS-PLL enabled freq=4xFosc1 */
    #define _OSC_EC_PORT_1H 0xF5    /* EC-Port on RA6 */
    #define _OSC_EC_CLKOUT_1H   0xF4    /* EC-CLKOUT on RA6 */
    #define _OSC_EXT_CLKOUT_on_RA6_1H   0xF3    /* EXT RC-CLKOUT_on_RA6 */
    #define _OSC_HS_1H  0xF2    /* HS */
    #define _OSC_XT_1H  0xF1    /* XT */
    #define _OSC_LP_1H  0xF0    /* LP */
    /* Fail Safe Clock Monitor Enable 1H options */
    #define _FCMEN_OFF_1H   0xBF    /* Disabled */
    #define _FCMEN_ON_1H    0xFF    /* Enabled */
    /* Internal External Switch Over 1H options */
    #define _IESO_OFF_1H    0x7F    /* Disabled */
    #define _IESO_ON_1H 0xFF    /* Enabled */
    /* Power Up Timer 2L options */
    #define _PUT_OFF_2L 0xFF    /* Disabled */
    #define _PUT_ON_2L  0xFE    /* Enabled */
    /* Brown Out Detect 2L options */
    #define _BODEN_ON_2L    0xFF    /* Enabled */
    #define _BODEN_OFF_2L   0xFD    /* Disabled */
    /* Brown Out Voltage 2L options */
    #define _BODENV_2_0V_2L 0xFF    /* 2.0V */
    #define _BODENV_2_7V_2L 0xFB    /* 2.7V */
    #define _BODENV_4_2V_2L 0xF7    /* 4.2V */
    #define _BODENV_4_5V_2L 0xF3    /* 4.5V */
    /* Watchdog Timer 2H options */
    #define _WDT_ON_2H  0xFF    /* Enabled */
    #define _WDT_DISABLED_CONTROLLED_2H 0xFE    /* Disabled-Controlled by SWDTEN bit */
    /* Watchdog Postscaler 2H options */
    #define _WDTPS_1_32768_2H   0xFF    /* 1:32768 */
    #define _WDTPS_1_16384_2H   0xFD    /* 1:16384 */
    #define _WDTPS_1_8192_2H    0xFB    /* 1:8192 */
    #define _WDTPS_1_4096_2H    0xF9    /* 1:4096 */
    #define _WDTPS_1_2048_2H    0xF7    /* 1:2048 */
    #define _WDTPS_1_1024_2H    0xF5    /* 1:1024 */
    #define _WDTPS_1_512_2H 0xF3    /* 1:512 */
    #define _WDTPS_1_256_2H 0xF1    /* 1:256 */
    #define _WDTPS_1_128_2H 0xEF    /* 1:128 */
    #define _WDTPS_1_64_2H  0xED    /* 1:64 */
    #define _WDTPS_1_32_2H  0xEB    /* 1:32 */
    #define _WDTPS_1_16_2H  0xE9    /* 1:16 */
    #define _WDTPS_1_8_2H   0xE7    /* 1:8 */
    #define _WDTPS_1_4_2H   0xE5    /* 1:4 */
    #define _WDTPS_1_2_2H   0xE3    /* 1:2 */
    #define _WDTPS_1_1_2H   0xE1    /* 1:1 */
    /* CCP2 Mux 3H options */
    #define _CCP2MUX_RC1_3H 0xFF    /* RC1 */
    #define _CCP2MUX_RB3_3H 0xFE    /* RB3 */
    /* PortB A/D Enable 3H options */
    #define _PBADEN_PORTB_4_0__analog_inputs_on_RSET_3H 0xFF    /* PORTB<4:0> configured as analog_inputs_on_RESET */
    #define _PBADEN_PORTB_4_0__digital_I_O_on_REST_3H   0xFD    /* PORTB<4:0> configured as digital_I_O_on_RESET */
    /* MCLR enable 3H options */
    #define _MCLRE_MCLR_Enabled_RE3_Disabled_3H 0xFF    /* MCLR Enabled_RE3_Disabled */
    #define _MCLRE_MCLR_Disabled_RE3_Enabled_3H 0x7F    /* MCLR Disabled__RE3_Enabled */
    /* Stack Overflow Reset 4L options */
    #define _STVR_ON_4L 0xFF    /* Enabled */
    #define _STVR_OFF_4L    0xFE    /* Disabled */
    /* Low Voltage Program 4L options */
    #define _LVP_ON_4L  0xFF    /* Enabled */
    #define _LVP_OFF_4L 0xFB    /* Disabled */
    /* Background Debug 4L options */
    #define _BACKBUG_OFF_4L 0xFF    /* Disabled */
    #define _BACKBUG_ON_4L  0x7F    /* Enabled */
    /* Code Protect 000200-0007FF 5L options */
    #define _CP_0_OFF_5L    0xFF    /* Disabled */
    #define _CP_0_ON_5L 0xFE    /* Enabled */
    /* Code Protect 000800-000FFF 5L options */
    #define _CP_1_OFF_5L    0xFF    /* Disabled */
    #define _CP_1_ON_5L 0xFD    /* Enabled */
    /* Data EE Read Protect 5H options */
    #define _CPD_OFF_5H 0xFF    /* Disabled */
    #define _CPD_ON_5H  0x7F    /* Enabled */
    /* Code Protect Boot 5H options */
    #define _CPB_OFF_5H 0xFF    /* Disabled */
    #define _CPB_ON_5H  0xBF    /* Enabled */
    /* Table Write Protect 00200-007FF 6L options */
    #define _WRT_0_OFF_6L   0xFF    /* Disabled */
    #define _WRT_0_ON_6L    0xFE    /* Enabled */
    /* Table Write Protect 00800-00FFF 6L options */
    #define _WRT_1_OFF_6L   0xFF    /* Disabled */
    #define _WRT_1_ON_6L    0xFD    /* Enabled */
    /* Data EE Write Protect 6H options */
    #define _WRTD_OFF_6H    0xFF    /* Disabled */
    #define _WRTD_ON_6H 0x7F    /* Enabled */
    /* Table Write Protect Boot 6H options */
    #define _WRTB_OFF_6H    0xFF    /* Disabled */
    #define _WRTB_ON_6H 0xBF    /* Enabled */
    /* Config. Write Protect 6H options */
    #define _WRTC_OFF_6H    0xFF    /* Disabled */
    #define _WRTC_ON_6H 0xDF    /* Enabled */
    /* Table Read Protect 00200-007FF 7L options */
    #define _EBTR_0_OFF_7L  0xFF    /* Disabled */
    #define _EBTR_0_ON_7L   0xFE    /* Enabled */
    /* Table Read Protect 00800-00FFF 7L options */
    #define _EBTR_1_OFF_7L  0xFF    /* Disabled */
    #define _EBTR_1_ON_7L   0xFD    /* Enabled */
    /* Table Read Protect Boot 7H options */
    #define _EBTRB_OFF_7H   0xFF    /* Disabled */
    #define _EBTRB_ON_7H    0xBF    /* Enabled */
    /* Device ID locations */
    #define __IDLOC0    0x200000
    #define __IDLOC1    0x200001
    #define __IDLOC2    0x200002
    #define __IDLOC3    0x200003
    #define __IDLOC4    0x200004
    #define __IDLOC5    0x200005
    #define __IDLOC6    0x200006
    #define __IDLOC7    0x200007
    #endif
    
     
  • Alain Portal
    Alain Portal
    2012-10-12

    I don't understand why you get this error, I tried your code and there is no such error, but I got a different one :

    sdcc --use-non-free -mpic16 -p18f4320 -V --debug -I/home/alain/Documents/piklab/bug18f4320/ -c bug18f4320.c 
    + "/usr/libexec/sdcc/sdcpp" -nostdinc -Wall -I/home/alain/Documents/piklab/bug18f4320/ -Dpic18f4320 -D__18f4320 -D__SDCC_PIC18F4320 -DSTACK_MODEL_SMALL -D__STACK_MODEL_SMALL -obj-ext=.o -D__SDCC_USE_NON_FREE -DSDCC_USE_NON_FREE -D__SDCC=3_2_0 -DSDCC=320 -D__SDCC_REVISION=8008 -DSDCC_REVISION=8008 -D__SDCC_pic16 -DSDCC_pic16 -D__pic16 -D__STDC_NO_COMPLEX__ -D__STDC_NO_THREADS__ -D__STDC_NO_ATOMICS__ -D__STDC_NO_VLA__ -isystem "/usr/libexec/sdcc/../share/sdcc/include/pic16" -isystem "/usr/share/sdcc/include/pic16" -isystem "/usr/libexec/sdcc/../share/sdcc/include" -isystem "/usr/share/sdcc/include" -isystem "/usr/libexec/sdcc/../share/sdcc/non-free/include/pic16" -isystem "/usr/share/sdcc/non-free/include/pic16" -isystem "/usr/libexec/sdcc/../share/sdcc/non-free/include" -isystem "/usr/share/sdcc/non-free/include" "bug18f4320.c"  
    bug18f4320.c:7: erreur : 20: Undefined identifier '_RC_OSC_1H' 
    bug18f4320.c:7: erreur : 20: Undefined identifier '_FSCM_ON_1H' 
    bug18f4320.c:7: erreur : 2: Initializer element is not constant 
    bug18f4320.c:8: erreur : 20: Undefined identifier '_PWRT_OFF_2L' 
    bug18f4320.c:8: erreur : 20: Undefined identifier '_BOR_ON_2L' 
    bug18f4320.c:8: erreur : 20: Undefined identifier '_BORV_20_2L' 
    bug18f4320.c:8: erreur : 2: Initializer element is not constant 
    bug18f4320.c:9: erreur : 20: Undefined identifier '_WDTPS_32K_2H' 
    bug18f4320.c:9: erreur : 2: Initializer element is not constant 
    bug18f4320.c:10: erreur : 20: Undefined identifier '_CCP2MX_C1_3H' 
    bug18f4320.c:10: erreur : 20: Undefined identifier '_PBAD_ANA_3H' 
    bug18f4320.c:10: erreur : 20: Undefined identifier '_MCLRE_ON_3H' 
    bug18f4320.c:10: erreur : 2: Initializer element is not constant 
    bug18f4320.c:11: erreur : 20: Undefined identifier '_DEBUG_OFF_4L' 
    bug18f4320.c:11: erreur : 2: Initializer element is not constant 
    bug18f4320.c:12: erreur : 20: Undefined identifier '_CP0_OFF_5L' 
    bug18f4320.c:12: erreur : 20: Undefined identifier '_CP1_OFF_5L' 
    bug18f4320.c:12: erreur : 2: Initializer element is not constant 
    bug18f4320.c:14: erreur : 20: Undefined identifier '_WRT0_OFF_6L' 
    bug18f4320.c:14: erreur : 20: Undefined identifier '_WRT1_OFF_6L' 
    bug18f4320.c:14: erreur : 2: Initializer element is not constant 
    bug18f4320.c:16: erreur : 20: Undefined identifier '_EBTR0_OFF_7L' 
    bug18f4320.c:16: erreur : 20: Undefined identifier '_EBTR1_OFF_7L' 
    bug18f4320.c:16: erreur : 2: Initializer element is not constant 
    *** Sortie avec le code : 1 ***
    
     
  • Alain Portal
    Alain Portal
    2012-10-12

    Your sdcc version is old, you should update to 3.2.0.
    And what about gputils?

     

  • Anonymous
    2012-10-14

    Thanks for the replies, I will try updating sdcc.

    dionysos-sf, I'm unsure why you're getting those config errors. Maybe those are added in by default in your build? I removed all   of the parameters in my code to try and focus on the error I was experiencing. Thanks for chiming in though.

     

  • Anonymous
    2012-10-16

    Hmmmm, yeah, crazy corn…

    I updated to the most recent version of SDCC and gputils (3.2.0 & 0.14.2 respectively) and still get the following error. I've got the feeling this is one of those startlingly simple things that I will feel silly about if I ever resolve it. Somethings just mis-tweaked somewhere, I just can't seem to find where… =P

    sdcc --use-non-free -mpic16 -p18f4320 -V --debug -I/home/promet/Tech and Projects/Piklab/ -I/usr/share/sdcc/include/ -c portb-test.c 
    + "/usr/local/bin/sdcpp" -nostdinc -Wall -I/home/promet/Tech\ and\ Projects/Piklab/ -I/usr/share/sdcc/include/ -Dpic18f4320 -D__18f4320 -D__SDCC_PIC18F4320 -DSTACK_MODEL_SMALL -D__STACK_MODEL_SMALL -obj-ext=.o -D__SDCC_USE_NON_FREE -DSDCC_USE_NON_FREE -D__SDCC=3_2_0 -DSDCC=320 -D__SDCC_REVISION=8008 -DSDCC_REVISION=8008 -D__SDCC_pic16 -DSDCC_pic16 -D__pic16 -D__STDC_NO_COMPLEX__ -D__STDC_NO_THREADS__ -D__STDC_NO_ATOMICS__ -D__STDC_NO_VLA__ -isystem "/usr/local/bin/../share/sdcc/include/pic16" -isystem "/usr/local/share/sdcc/include/pic16" -isystem "/usr/local/bin/../share/sdcc/include" -isystem "/usr/local/share/sdcc/include" -isystem "/usr/local/bin/../share/sdcc/non-free/include/pic16" -isystem "/usr/local/share/sdcc/non-free/include/pic16" -isystem "/usr/local/bin/../share/sdcc/non-free/include" -isystem "/usr/local/share/sdcc/non-free/include" "portb-test.c"  
    + "/usr/local/bin/gpasm" -DSTACK_MODEL_SMALL -D__STACK_MODEL_SMALL -g -o "portb-test.o" -c "portb-test.asm" 
    sdcc --use-non-free -mpic16 -p18f4320 -V --debug -Wl-c -Wl-m -I/home/promet/Tech and Projects/Piklab/ -oportb-test.hex portb-test.o 
    using default linker script "/usr/local/share/gputils/lkr/18f4320.lkr" 
    missing definition for symbol "_TRISD", required by "portb-test.o" 
    missing definition for symbol "_TRISDbits", required by "portb-test.o" 
    + "/usr/local/bin/gplink" -I"/usr/local/bin/../share/sdcc/lib/pic16" -I"/usr/local/share/sdcc/lib/pic16" -I"/usr/local/bin/../share/sdcc/non-free/lib/pic16" -I"/usr/local/share/sdcc/non-free/lib/pic16" -c -m -w -r -o "portb-test.hex" "portb-test.o" crt0i.o "libdev18f4320.lib" "libsdcc.lib"  
    + "/usr/local/bin/gplink" -I"/usr/local/bin/../share/sdcc/lib/pic16" -I"/usr/local/share/sdcc/lib/pic16" -I"/usr/local/bin/../share/sdcc/non-free/lib/pic16" -I"/usr/local/share/sdcc/non-free/lib/pic16" -c -m -w -r -o "portb-test.hex" "portb-test.o" crt0i.o "libdev18f4320.lib" "libsdcc.lib" returned errorcode 256 
    *** Exited with status: 1 ***
    
     
  • Alain Portal
    Alain Portal
    2012-10-18

    After deleting all code related to CONFIG, I confirm the problem

     
  • Alain Portal
    Alain Portal
    2012-10-18

    This is a sdcc bug!
    There is no _TRISD or _TRISDbits symbols in "libdev18f4320.lib" :(

     
  • Gál Zsolt
    Gál Zsolt
    2012-10-19

    I checked out the latest gputils and sdcc version from svn source. After compiling and installing the binaries:

    gpasm -v
    gpasm-0.14.2 #845 (Oct 19 2012)

    sdcc -v
    SDCC : pic16/pic14 3.2.1 #8160 (Oct 19 2012) (Linux)

    uname -a
    Linux cr700deb 3.2.0-0.bpo.3-686-pae #1 SMP Thu Aug 23 08:21:41 UTC 2012 i686 GNU/Linux

    ; ---------------------------------------------------------------------------------------

    I can manged to compile the source code mentioned above. Here is the result:

    sdcc -use-non-free -mpic16 -p18f4320 -V -debug -I/home/zsolti/Fejlesztes/PIC_Programok/PIC16F/sdcc_teszt/2012_1019_sdcc_pic16/ -c main.c
    + /usr/local/bin/sdcpp -nostdinc -Wall -I/home/zsolti/Fejlesztes/PIC_Programok/PIC16F/sdcc_teszt/2012_1019_sdcc_pic16/ -Dpic18f4320 -D__18f4320 -D__SDCC_PIC18F4320 -DSTACK_MODEL_SMALL -D__STACK_MODEL_SMALL -obj-ext=.o -D__SDCC_USE_NON_FREE -DSDCC_USE_NON_FREE -D__SDCC=3_2_1 -DSDCC=321 -D__SDCC_REVISION=8160 -DSDCC_REVISION=8160 -D__SDCC_pic16 -DSDCC_pic16 -D__pic16 -D__STDC_NO_COMPLEX__ -D__STDC_NO_THREADS__ -D__STDC_NO_ATOMICS__ -D__STDC_NO_VLA__ -isystem /usr/local/bin/../share/sdcc/include/pic16 -isystem /usr/local/share/sdcc/include/pic16 -isystem /usr/local/bin/../share/sdcc/include -isystem /usr/local/share/sdcc/include -isystem /usr/local/bin/../share/sdcc/non-free/include/pic16 -isystem /usr/local/share/sdcc/non-free/include/pic16 -isystem /usr/local/bin/../share/sdcc/non-free/include -isystem /usr/local/share/sdcc/non-free/include main.c 
    + /usr/local/bin/gpasm -DSTACK_MODEL_SMALL -D__STACK_MODEL_SMALL -g -o main.o -c main.asm

    sdcc -use-non-free -mpic16 -p18f4320 -V -debug -Wl-c -Wl-m -I/home/zsolti/Fejlesztes/PIC_Programok/PIC16F/sdcc_teszt/2012_1019_sdcc_pic16/ -otest_pic16.hex main.o
    using default linker script "/usr/local/share/gputils/lkr/18f4320_g.lkr"
    + /usr/local/bin/gplink -I/usr/local/bin/../share/sdcc/lib/pic16 -I/usr/local/share/sdcc/lib/pic16 -I/usr/local/bin/../share/sdcc/non-free/lib/pic16 -I/usr/local/share/sdcc/non-free/lib/pic16 -c -m -w -r -o test_pic16.hex main.o crt0i.o libdev18f4320.lib libsdcc.lib 

    *** Kész ***
    Parsing COFF file: /home/zsolti/Fejlesztes/PIC_Programok/PIC16F/sdcc_teszt/2012_1019_sdcc_pic16/test_pic16.cof
    Device name: "18F4320"

    ; -------------------------------------------------------------------------------------------------------

    If I open the libdev18f4320.lib from /usr/local/share/sdcc/non-free/pic16 I can see this:

    Information:
    No. of file members:  9
    No. of symbols:       187

    File Members:
    eeprom8_gptrget1_dispatch.o   size: 404 bytes
    eeprom8_gptrget2_dispatch.o   size: 404 bytes
    eeprom8_gptrget3_dispatch.o   size: 404 bytes
    eeprom8_gptrget4_dispatch.o   size: 404 bytes
    eeprom8_gptrput1_dispatch.o   size: 404 bytes
    eeprom8_gptrput2_dispatch.o   size: 404 bytes
    eeprom8_gptrput3_dispatch.o   size: 404 bytes
    eeprom8_gptrput4_dispatch.o   size: 404 bytes
    libdev18f4320_a-pic18f4320.o  size: 5604 bytes

    Symbols:
    _ADCON0             libdev18f4320_a-pic18f4320.o
    _ADCON0bits         libdev18f4320_a-pic18f4320.o
    _ADCON1             libdev18f4320_a-pic18f4320.o
    _ADCON1bits         libdev18f4320_a-pic18f4320.o
    _ADCON2             libdev18f4320_a-pic18f4320.o
    _ADCON2bits         libdev18f4320_a-pic18f4320.o
    _ADRES              libdev18f4320_a-pic18f4320.o
    _ADRESH             libdev18f4320_a-pic18f4320.o
    _ADRESL             libdev18f4320_a-pic18f4320.o
    _BSR                libdev18f4320_a-pic18f4320.o
    _CCP1CON            libdev18f4320_a-pic18f4320.o
    _CCP1CONbits        libdev18f4320_a-pic18f4320.o
    _CCP2CON            libdev18f4320_a-pic18f4320.o
    _CCP2CONbits        libdev18f4320_a-pic18f4320.o
    _CCPR1              libdev18f4320_a-pic18f4320.o
    _CCPR1H             libdev18f4320_a-pic18f4320.o
    _CCPR1L             libdev18f4320_a-pic18f4320.o
    _CCPR2              libdev18f4320_a-pic18f4320.o
    _CCPR2H             libdev18f4320_a-pic18f4320.o
    _CCPR2L             libdev18f4320_a-pic18f4320.o
    _CMCON              libdev18f4320_a-pic18f4320.o
    _CMCONbits          libdev18f4320_a-pic18f4320.o
    _CVRCON             libdev18f4320_a-pic18f4320.o
    _CVRCONbits         libdev18f4320_a-pic18f4320.o
    _DDRA               libdev18f4320_a-pic18f4320.o
    _DDRAbits           libdev18f4320_a-pic18f4320.o
    _DDRB               libdev18f4320_a-pic18f4320.o
    _DDRBbits           libdev18f4320_a-pic18f4320.o
    _DDRC               libdev18f4320_a-pic18f4320.o
    _DDRCbits           libdev18f4320_a-pic18f4320.o
    _DDRD               libdev18f4320_a-pic18f4320.o
    _DDRDbits           libdev18f4320_a-pic18f4320.o
    _DDRE               libdev18f4320_a-pic18f4320.o
    _DDREbits           libdev18f4320_a-pic18f4320.o
    _ECCPAS             libdev18f4320_a-pic18f4320.o
    _ECCPASbits         libdev18f4320_a-pic18f4320.o
    _EEADR              libdev18f4320_a-pic18f4320.o
    _EECON1             libdev18f4320_a-pic18f4320.o
    _EECON1bits         libdev18f4320_a-pic18f4320.o
    _EECON2             libdev18f4320_a-pic18f4320.o
    _EEDATA             libdev18f4320_a-pic18f4320.o
    _FSR0H              libdev18f4320_a-pic18f4320.o
    _FSR0L              libdev18f4320_a-pic18f4320.o
    _FSR1H              libdev18f4320_a-pic18f4320.o
    _FSR1L              libdev18f4320_a-pic18f4320.o
    _FSR2H              libdev18f4320_a-pic18f4320.o
    _FSR2L              libdev18f4320_a-pic18f4320.o
    _INDF0              libdev18f4320_a-pic18f4320.o
    _INDF1              libdev18f4320_a-pic18f4320.o
    _INDF2              libdev18f4320_a-pic18f4320.o
    _INTCON             libdev18f4320_a-pic18f4320.o
    _INTCON2            libdev18f4320_a-pic18f4320.o
    _INTCON2bits        libdev18f4320_a-pic18f4320.o
    _INTCON3            libdev18f4320_a-pic18f4320.o
    _INTCON3bits        libdev18f4320_a-pic18f4320.o
    _INTCONbits         libdev18f4320_a-pic18f4320.o
    _IPR1               libdev18f4320_a-pic18f4320.o
    _IPR1bits           libdev18f4320_a-pic18f4320.o
    _IPR2               libdev18f4320_a-pic18f4320.o
    _IPR2bits           libdev18f4320_a-pic18f4320.o
    _LATA               libdev18f4320_a-pic18f4320.o
    _LATAbits           libdev18f4320_a-pic18f4320.o
    _LATB               libdev18f4320_a-pic18f4320.o
    _LATBbits           libdev18f4320_a-pic18f4320.o
    _LATC               libdev18f4320_a-pic18f4320.o
    _LATCbits           libdev18f4320_a-pic18f4320.o
    _LATD               libdev18f4320_a-pic18f4320.o
    _LATDbits           libdev18f4320_a-pic18f4320.o
    _LATE               libdev18f4320_a-pic18f4320.o
    _LATEbits           libdev18f4320_a-pic18f4320.o
    _LVDCON             libdev18f4320_a-pic18f4320.o
    _LVDCONbits         libdev18f4320_a-pic18f4320.o
    _OSCCON             libdev18f4320_a-pic18f4320.o
    _OSCCONbits         libdev18f4320_a-pic18f4320.o
    _OSCTUN2            libdev18f4320_a-pic18f4320.o
    _OSCTUN2bits        libdev18f4320_a-pic18f4320.o
    _OSCTUNE            libdev18f4320_a-pic18f4320.o
    _OSCTUNEbits        libdev18f4320_a-pic18f4320.o
    _PC                 libdev18f4320_a-pic18f4320.o
    _PCL                libdev18f4320_a-pic18f4320.o
    _PCLATH             libdev18f4320_a-pic18f4320.o
    _PCLATU             libdev18f4320_a-pic18f4320.o
    _PIE1               libdev18f4320_a-pic18f4320.o
    _PIE1bits           libdev18f4320_a-pic18f4320.o
    _PIE2               libdev18f4320_a-pic18f4320.o
    _PIE2bits           libdev18f4320_a-pic18f4320.o
    _PIR1               libdev18f4320_a-pic18f4320.o
    _PIR1bits           libdev18f4320_a-pic18f4320.o
    _PIR2               libdev18f4320_a-pic18f4320.o
    _PIR2bits           libdev18f4320_a-pic18f4320.o
    _PLUSW0             libdev18f4320_a-pic18f4320.o
    _PLUSW1             libdev18f4320_a-pic18f4320.o
    _PLUSW2             libdev18f4320_a-pic18f4320.o
    _PORTA              libdev18f4320_a-pic18f4320.o
    _PORTAbits          libdev18f4320_a-pic18f4320.o
    _PORTB              libdev18f4320_a-pic18f4320.o
    _PORTBbits          libdev18f4320_a-pic18f4320.o
    _PORTC              libdev18f4320_a-pic18f4320.o
    _PORTCbits          libdev18f4320_a-pic18f4320.o
    _PORTD              libdev18f4320_a-pic18f4320.o
    _PORTDbits          libdev18f4320_a-pic18f4320.o
    _PORTE              libdev18f4320_a-pic18f4320.o
    _PORTEbits          libdev18f4320_a-pic18f4320.o
    _POSTDEC0           libdev18f4320_a-pic18f4320.o
    _POSTDEC1           libdev18f4320_a-pic18f4320.o
    _POSTDEC2           libdev18f4320_a-pic18f4320.o
    _POSTINC0           libdev18f4320_a-pic18f4320.o
    _POSTINC1           libdev18f4320_a-pic18f4320.o
    _POSTINC2           libdev18f4320_a-pic18f4320.o
    _PR2                libdev18f4320_a-pic18f4320.o
    _PREINC0            libdev18f4320_a-pic18f4320.o
    _PREINC1            libdev18f4320_a-pic18f4320.o
    _PREINC2            libdev18f4320_a-pic18f4320.o
    _PROD               libdev18f4320_a-pic18f4320.o
    _PRODH              libdev18f4320_a-pic18f4320.o
    _PRODL              libdev18f4320_a-pic18f4320.o
    _PWM1CON            libdev18f4320_a-pic18f4320.o
    _PWM1CONbits        libdev18f4320_a-pic18f4320.o
    _RCON               libdev18f4320_a-pic18f4320.o
    _RCONbits           libdev18f4320_a-pic18f4320.o
    _RCREG              libdev18f4320_a-pic18f4320.o
    _RCSTA              libdev18f4320_a-pic18f4320.o
    _RCSTAbits          libdev18f4320_a-pic18f4320.o
    _SPBRG              libdev18f4320_a-pic18f4320.o
    _SSPADD             libdev18f4320_a-pic18f4320.o
    _SSPBUF             libdev18f4320_a-pic18f4320.o
    _SSPCON1            libdev18f4320_a-pic18f4320.o
    _SSPCON1bits        libdev18f4320_a-pic18f4320.o
    _SSPCON2            libdev18f4320_a-pic18f4320.o
    _SSPCON2bits        libdev18f4320_a-pic18f4320.o
    _SSPSTAT            libdev18f4320_a-pic18f4320.o
    _SSPSTATbits        libdev18f4320_a-pic18f4320.o
    _STATUS             libdev18f4320_a-pic18f4320.o
    _STATUSbits         libdev18f4320_a-pic18f4320.o
    _STKPTR             libdev18f4320_a-pic18f4320.o
    _STKPTRbits         libdev18f4320_a-pic18f4320.o
    _T0CON              libdev18f4320_a-pic18f4320.o
    _T0CONbits          libdev18f4320_a-pic18f4320.o
    _T1CON              libdev18f4320_a-pic18f4320.o
    _T1CONbits          libdev18f4320_a-pic18f4320.o
    _T2CON              libdev18f4320_a-pic18f4320.o
    _T2CONbits          libdev18f4320_a-pic18f4320.o
    _T3CON              libdev18f4320_a-pic18f4320.o
    _T3CONbits          libdev18f4320_a-pic18f4320.o
    _TABLAT             libdev18f4320_a-pic18f4320.o
    _TBLPTR             libdev18f4320_a-pic18f4320.o
    _TBLPTRH            libdev18f4320_a-pic18f4320.o
    _TBLPTRL            libdev18f4320_a-pic18f4320.o
    _TBLPTRU            libdev18f4320_a-pic18f4320.o
    _TMR0               libdev18f4320_a-pic18f4320.o
    _TMR0H              libdev18f4320_a-pic18f4320.o
    _TMR0L              libdev18f4320_a-pic18f4320.o
    _TMR1               libdev18f4320_a-pic18f4320.o
    _TMR1H              libdev18f4320_a-pic18f4320.o
    _TMR1L              libdev18f4320_a-pic18f4320.o
    _TMR2               libdev18f4320_a-pic18f4320.o
    _TMR3               libdev18f4320_a-pic18f4320.o
    _TMR3H              libdev18f4320_a-pic18f4320.o
    _TMR3L              libdev18f4320_a-pic18f4320.o
    _TOS                libdev18f4320_a-pic18f4320.o
    _TOSH               libdev18f4320_a-pic18f4320.o
    _TOSL               libdev18f4320_a-pic18f4320.o
    _TOSU               libdev18f4320_a-pic18f4320.o
    _TRISA              libdev18f4320_a-pic18f4320.o
    _TRISAbits          libdev18f4320_a-pic18f4320.o
    _TRISB              libdev18f4320_a-pic18f4320.o
    _TRISBbits          libdev18f4320_a-pic18f4320.o
    _TRISC              libdev18f4320_a-pic18f4320.o
    _TRISCbits          libdev18f4320_a-pic18f4320.o
    _TRISD              libdev18f4320_a-pic18f4320.o
    _TRISDbits          libdev18f4320_a-pic18f4320.o
    _TRISE              libdev18f4320_a-pic18f4320.o
    _TRISEbits          libdev18f4320_a-pic18f4320.o
    _TXREG              libdev18f4320_a-pic18f4320.o
    _TXSTA              libdev18f4320_a-pic18f4320.o
    _TXSTAbits          libdev18f4320_a-pic18f4320.o
    _WDTCON             libdev18f4320_a-pic18f4320.o
    _WDTCONbits         libdev18f4320_a-pic18f4320.o
    _WREG               libdev18f4320_a-pic18f4320.o
    ___eeprom_gptrget1  eeprom8_gptrget1_dispatch.o
    ___eeprom_gptrget2  eeprom8_gptrget2_dispatch.o
    ___eeprom_gptrget3  eeprom8_gptrget3_dispatch.o
    ___eeprom_gptrget4  eeprom8_gptrget4_dispatch.o
    ___eeprom_gptrput1  eeprom8_gptrput1_dispatch.o
    ___eeprom_gptrput2  eeprom8_gptrput2_dispatch.o
    ___eeprom_gptrput3  eeprom8_gptrput3_dispatch.o
    ___eeprom_gptrput4  eeprom8_gptrput4_dispatch.o

    So I can find the _TRISD and _TRISDbits symbols.


    In addition: You can check inside the SETTINGS menu which version of SDCC are used by PIKLAB during compiling the code. Inside the SETTINGS menu there is a point where you can set the compilers. I suggest to check the path at the SDCC settings, and you can check yourself with the magnifier icon the version of sdcc and gputils that PIKLAB recognised.

     
  • Gál Zsolt
    Gál Zsolt
    2012-10-19

    I have repeated the procedure with the latest official release of SDCC ( 3.2.0 ) and gputils ( 0.14.2 )  and I get the same error as you described. So I think, it is better to use the latest SVN version of SDCC.

    sdcc -use-non-free -mpic16 -p18f4320 -V -debug -I/home/zsolti/Fejlesztes/PIC_Programok/PIC16F/sdcc_teszt/2012_1019_sdcc_pic16/ -c main.c
    + "/usr/local/bin/sdcpp" -nostdinc -Wall -I/home/zsolti/Fejlesztes/PIC_Programok/PIC16F/sdcc_teszt/2012_1019_sdcc_pic16/ -Dpic18f4320 -D__18f4320 -D__SDCC_PIC18F4320 -DSTACK_MODEL_SMALL -D__STACK_MODEL_SMALL -obj-ext=.o -D__SDCC_USE_NON_FREE -DSDCC_USE_NON_FREE -D__SDCC=3_2_0 -DSDCC=320 -D__SDCC_REVISION=8008 -DSDCC_REVISION=8008 -D__SDCC_pic16 -DSDCC_pic16 -D__pic16 -D__STDC_NO_COMPLEX__ -D__STDC_NO_THREADS__ -D__STDC_NO_ATOMICS__ -D__STDC_NO_VLA__ -isystem "/usr/local/bin/../share/sdcc/include/pic16" -isystem "/usr/local/share/sdcc/include/pic16" -isystem "/usr/local/bin/../share/sdcc/include" -isystem "/usr/local/share/sdcc/include" -isystem "/usr/local/bin/../share/sdcc/non-free/include/pic16" -isystem "/usr/local/share/sdcc/non-free/include/pic16" -isystem "/usr/local/bin/../share/sdcc/non-free/include" -isystem "/usr/local/share/sdcc/non-free/include" "main.c" 
    + "/usr/local/bin/gpasm" -DSTACK_MODEL_SMALL -D__STACK_MODEL_SMALL -g -o "main.o" -c "main.asm"
    sdcc -use-non-free -mpic16 -p18f4320 -V -debug -Wl-c -Wl-m -I/home/zsolti/Fejlesztes/PIC_Programok/PIC16F/sdcc_teszt/2012_1019_sdcc_pic16/ -otest_pic16.hex main.o
    using default linker script "/usr/local/share/gputils/lkr/18f4320.lkr"
    missing definition for symbol "_TRISDbits", required by "main.o"
    + "/usr/local/bin/gplink" -I"/usr/local/bin/../share/sdcc/lib/pic16" -I"/usr/local/share/sdcc/lib/pic16" -I"/usr/local/bin/../share/sdcc/non-free/lib/pic16" -I"/usr/local/share/sdcc/non-free/lib/pic16" -c -m -w -r -o "test_pic16.hex" "main.o" crt0i.o "libdev18f4320.lib" "libsdcc.lib" 
    + "/usr/local/bin/gplink" -I"/usr/local/bin/../share/sdcc/lib/pic16" -I"/usr/local/share/sdcc/lib/pic16" -I"/usr/local/bin/../share/sdcc/non-free/lib/pic16" -I"/usr/local/share/sdcc/non-free/lib/pic16" -c -m -w -r -o "test_pic16.hex" "main.o" crt0i.o "libdev18f4320.lib" "libsdcc.lib" returned errorcode 256

    *** Kilépési hely: 1 ***

    ; -------------------------------------------------------------------------------------------------------

    sdcc -v
    SDCC : mcs51/gbz80/z80/z180/r2k/r3ka/ds390/pic16/pic14/TININative/ds400/hc08/s08 3.2.0 #8008 (Jul  6 2012) (Linux)

    gpasm -v
    gpasm-0.14.2 #711 (Oct 19 2012)

    uname -a
    Linux cr700deb 3.2.0-0.bpo.3-686-pae #1 SMP Thu Aug 23 08:21:41 UTC 2012 i686 GNU/Linux

    piklab -v
    Qt: 3.3.8b
    KDE: 3.5.10
    Piklab: 0.15.12

     
  • Gál Zsolt
    Gál Zsolt
    2012-10-19

    I am always refreshing my sdcc and gputils, so that is why I was success for first time.
    Then I deleted the sdcc and gputlis directories from /usr/local/share and I installed the official releases. That cause for me the error as you described above. So I agree with that opinion, that SDCC 3.2.0 has this problem.
    I deleted my svn directory and downloaded the gputils and sdcc from svn. After installing this two package I can manage to compile the sample code.

     
  • Gál Zsolt
    Gál Zsolt
    2012-10-19

    For checking out the svn source I am using this command:

    svn co https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc sdcc

    I made a script for compiling the source. This script have these lines:

    LANG=C
    ./configure -enable-new-pics -disable-s08-port -disable-r3ka-port -disable-z80-port -disable-avr-port -disable-ds390-port -disable-ds400-port -disable-gbz80-port -disable-hc08-port -disable-mcs51-port -disable-xa51-port -disable-z180-port -disable-r2k-port
    make

     
  • Alain Portal
    Alain Portal
    2012-10-19

    I did exactly what you suggested, and I got:

    '/home/alain/Code/sdcc/depot/sdcc/device/non-free/lib/pic16//../../../../bin/sdcc' -DHAVE_CONFIG_H -I. -I..  -I. -I../../../../include/pic16 -I../../../../non-free/include/pic16  -p18f24k50 --std-c99 --asm="'/usr/bin/gpasm'" --fomit-frame-pointer --obanksel=9 --denable-peeps --optimize-cmp --optimize-df --i-code-in-asm -DUSE_FLOATS=0 -mpic16 -p18f452 -c -o libdev18f24k50_a-pic18f24k50.o `test -f 'pic18f24k50.c' || echo './'`pic18f24k50.c
    libdev18f24k50_a-pic18f24k50.asm:8:Error[132]   Unknown processor.
    libdev18f24k50_a-pic18f24k50.asm:326:Error[131]   Processor type is undefined.
    libdev18f24k50_a-pic18f24k50.asm:328:Error[131]   Processor type is undefined.
    libdev18f24k50_a-pic18f24k50.asm:330:Error[131]   Processor type is undefined.
    libdev18f24k50_a-pic18f24k50.asm:331:Error[131]   Processor type is undefined.
    .....
    libdev18f24k50_a-pic18f24k50.asm:645:Error[131]   Processor type is undefined.
    libdev18f24k50_a-pic18f24k50.asm:647:Error[131]   Processor type is undefined.
    libdev18f24k50_a-pic18f24k50.asm:648:Error[131]   Processor type is undefined.
    libdev18f24k50_a-pic18f24k50.asm:649:Error[131]   Processor type is undefined.
    make[7]: *** [libdev18f24k50_a-pic18f24k50.o] Erreur 1
    
     
  • Gál Zsolt
    Gál Zsolt
    2012-10-19

    Which version of gputils is installed on your system?

    gpasm -v

    If I see well, the compiler want to use gpasm from /usr/bin, so I think you have an old gputils installed on your system from the Linux distribution. It is better to remove that and install the latest version from svn of gputils. There are lot of new PIC in it. 

    https://sourceforge.net/p/gputils/code/846/tree/trunk/gputils/ChangeLog

    See: 2012-07-02

     
  • Alain Portal
    Alain Portal
    2012-10-19

    I'm using the last stable revision, 0.14.2 #711 (Jul 28 2012)

     
  • Gál Zsolt
    Gál Zsolt
    2012-10-20

    That version has no support for 18f24k50. The appropriate header file exists, but the asm doesn't take care of it.

    Supported devices by the gputils 0.14.2:

    /gputils-0.14.2/gpasm$ ./gpasm -l
    eeprom8     eeprom16    gen         hcs1365     hcs1370     mcv08a      
    mcv14a      mcv18a      mcv28a      p10f200     p10f202     p10f204     
    p10f206     p10f220     p10f222     p12c508     p12c508a    p12f508     
    p12c509     p12c509a    p12cr509a   p12f509     p12f510     p12ce518    
    p12ce519    p12f519     p12f609     p12hv609    p12f615     p12hv615    
    p12f629     p12f635     p12c671     p12c672     p12ce673    p12ce674    
    p12f675     p12f683     p12f1822    p12lf1822   p12f1840    p12lf1840   
    p14000      p16cxx      p16f1455    p16lf1455   p16f1458    p16lf1458   
    p16f1459    p16lf1459   p16f1503    p16lf1503   p16f1507    p16lf1507   
    p16f1508    p16lf1508   p16f1509    p16lf1509   p16f1516    p16lf1516   
    p16f1517    p16lf1517   p16f1518    p16lf1518   p16f1519    p16lf1519   
    p16f1526    p16lf1526   p16f1527    p16lf1527   p16f1782    p16lf1782   
    p16f1783    p16lf1783   p16f1823    p16lf1823   p16f1824    p16lf1824   
    p16f1825    p16lf1825   p16f1826    p16lf1826   p16f1827    p16lf1827   
    p16f1828    p16lf1828   p16f1829    p16lf1829   p16f1847    p16lf1847   
    p16lf1902   p16lf1903   p16lf1904   p16lf1906   p16lf1907   p16f1933    
    p16lf1933   p16f1934    p16lf1934   p16f1936    p16lf1936   p16f1937    
    p16lf1937   p16f1938    p16lf1938   p16f1939    p16lf1939   p16f1946    
    p16lf1946   p16f1947    p16lf1947   p16c432     p16c433     p16c5x      
    p16c505     p16f505     p16f506     p16c52      p16f526     p16c54      
    p16c54a     p16c54b     p16c54c     p16cr54     p16cr54a    p16cr54b    
    p16cr54c    p16f54      p16hv540    p16c55      p16c55a     p16c554     
    p16c557     p16c558     p16c56      p16c56a     p16cr56a    p16c57      
    p16c57c     p16cr57a    p16cr57b    p16cr57c    p16f57      p16c58a     
    p16c58b     p16cr58a    p16cr58b    p16f59      p16c61      p16f610     
    p16hv610    p16f616     p16hv616    p16c62      p16c62a     p16c62b     
    p16cr62     p16c620     p16c620a    p16cr620a   p16c621     p16c621a    
    p16c622     p16c622a    p16ce623    p16ce624    p16ce625    p16f627     
    p16f627a    p16f628     p16f628a    p16c63      p16c63a     p16cr63     
    p16f630     p16f631     p16f636     p16f639     p16c64      p16c64a     
    p16cr64     p16c642     p16f648a    p16c65      p16c65a     p16c65b     
    p16cr65     p16c66      p16c662     p16c67      p16f676     p16f677     
    p16f684     p16f685     p16f687     p16f688     p16f689     p16f690     
    p16c71      p16c710     p16c711     p16c712     p16c715     p16c716     
    p16f716     p16c717     p16c72      p16c72a     p16cr72     p16f72      
    p16f720     p16lf720    p16f721     p16lf721    p16lf722    p16f723     
    p16lf723    p16f724     p16lf724    p16f726     p16lf726    p16f727     
    p16lf727    p16c73      p16c73a     p16c73b     p16f73      p16f737     
    p16c74      p16c74a     p16c74b     p16f74      p16c745     p16f747     
    p16c76      p16f76      p16c765     p16f767     p16c77      p16f77      
    p16c770     p16c771     p16c773     p16c774     p16f777     p16c781     
    p16c782     p16f785     p16hv785    p16f818     p16f819     p16cr83     
    p16f83      p16c84      p16cr84     p16f84      p16f84a     p16f87      
    p16f870     p16f871     p16f872     p16f873     p16f873a    p16f874     
    p16f874a    p16f876     p16f876a    p16f877     p16f877a    p16f88      
    p16f882     p16f883     p16f884     p16f886     p16f887     p16f913     
    p16f914     p16f916     p16f917     p16c923     p16c924     p16c925     
    p16c926     p16f946     p17cxx      p17c42      p17c42a     p17cr42     
    p17c43      p17cr43     p17c44      p17c752     p17c756     p17c756a    
    p17c762     p17c766     p18cxx      p18f1220    p18f1230    p18f1320    
    p18f13k22   p18lf13k22  p18f1330    p18f13k50   p18lf13k50  p18f14k22   
    p18lf14k22  p18f14k50   p18lf14k50  p18f2220    p18f2221    p18f2320    
    p18f23k20   p18f23k22   p18f2321    p18f2331    p18f2410    p18f24j10   
    p18f24j11   p18lf24j11  p18c242     p18f242     p18f2420    p18f24k20   
    p18f24k22   p18f2423    p18f2431    p18f2439    p18f2450    p18f24j50   
    p18lf24j50  p18f2455    p18f2458    p18f248     p18f2480    p18f2510    
    p18f25j10   p18f25j11   p18lf25j11  p18f2515    p18c252     p18f252     
    p18f2520    p18f25k20   p18f25k22   p18f2523    p18f2525    p18f2539    
    p18f2550    p18f25j50   p18lf25j50  p18f2553    p18f258     p18f2580    
    p18f2585    p18f2610    p18f26j11   p18lf26j11  p18f2620    p18f26k20   
    p18f26k22   p18f26j50   p18lf26j50  p18f2680    p18f2681    p18f2682    
    p18f2685    p18f4220    p18f4221    p18f4320    p18f43k20   p18f43k22   
    p18f4321    p18f4331    p18f4410    p18f44j10   p18f44j11   p18lf44j11  
    p18c442     p18f442     p18f4420    p18f44k20   p18f44k22   p18f4423    
    p18f4431    p18f4439    p18f4450    p18f44j50   p18lf44j50  p18f4455    
    p18f4458    p18f448     p18f4480    p18f4510    p18f45j10   p18f45j11   
    p18lf45j11  p18f4515    p18c452     p18f452     p18f4520    p18f45k20   
    p18f45k22   p18f4523    p18f4525    p18f4539    p18f4550    p18f45j50   
    p18lf45j50  p18f4553    p18f458     p18f4580    p18f4585    p18f4610    
    p18f46j11   p18lf46j11  p18f4620    p18f46k20   p18f46k22   p18f46j50   
    p18lf46j50  p18f4680    p18f4681    p18f4682    p18f4685    p18c601     
    p18f6310    p18f63j11   p18f6390    p18f63j90   p18f6393    p18f6410    
    p18f64j11   p18f64j15   p18f6490    p18f64j90   p18f6493    p18f65j10   
    p18f65j11   p18f65j15   p18f6520    p18f6525    p18f6527    p18f65j50   
    p18c658     p18f6585    p18f65j90   p18f66j10   p18f66j11   p18f66j15   
    p18f66j16   p18f6620    p18f6621    p18f6622    p18f6627    p18f6628    
    p18f66j50   p18f66j55   p18f66j60   p18f66j65   p18f6680    p18f66j90   
    p18f67j10   p18f67j11   p18f6720    p18f6722    p18f6723    p18f67j50   
    p18f67j60   p18f67j90   p18c801     p18f8310    p18f83j11   p18f8390    
    p18f83j90   p18f8393    p18f8410    p18f84j11   p18f84j15   p18f8490    
    p18f84j90   p18f8493    p18f85j10   p18f85j11   p18f85j15   p18f8520    
    p18f8525    p18f8527    p18f85j50   p18c858     p18f8585    p18f85j90   
    p18f86j10   p18f86j11   p18f86j15   p18f86j16   p18f8620    p18f8621    
    p18f8622    p18f8627    p18f8628    p18f86j50   p18f86j55   p18f86j60   
    p18f86j65   p18f8680    p18f86j90   p18f87j10   p18f87j11   p18f8720    
    p18f8722    p18f8723    p18f87j50   p18f87j60   p18f87j90   p18f96j60   
    p18f96j65   p18f97j60   ps500       ps810       rf509af     rf509ag     
    rf675f      rf675h      rf675k      sx18        sx20        sx28        
    sx48        sx52
    

    That is why you can't build the actual version of sdcc.

     
  • Alain Portal
    Alain Portal
    2012-10-22

    Getting the last gputils svn fixes my build problem.

    But now, with last gputils and sdcc svn, my piklab project don't compile any more :(