gplink-1.2.0 #995 (Sep 28 2013) returns errorcode 35584

  • regis

    I've just compiled pic16 port from last svn sources on my 64-bit Linux machine.
    SDCC : pic16 3.3.1 #8891 (Sep 28 2013) (Linux)
    gplink-1.2.0 #995 (Sep 28 2013)
    gpasm-1.2.0 #995 (Sep 28 2013)
    When I compile a simple example with :
    sdcc -mpic16 -p18f26j50 --use-non-free -V test.c
    I get this error message from gplink :

    • /dvpt/sdcc/linux64/bin/sdcpp -nostdinc -Wall -Dpic18f26j50 -D18f26j50 -DSDCC_PIC18F26J50 -DSTACK_MODEL_SMALL -DSTACK_MODEL_SMALL -obj-ext=.o -DSDCC_USE_NON_FREE -DSDCC_USE_NON_FREE -DSDCC=3_3_1 -DSDCC=331 -DSDCC_REVISION=8891 -DSDCC_REVISION=8891 -DSDCC_pic16 -DSDCC_pic16 -Dpic16 -DSTDC_NO_COMPLEX -DSTDC_NO_THREADS -DSTDC_NO_ATOMICS -DSTDC_NO_VLA -isystem /dvpt/sdcc/linux64/bin/../share/sdcc/include/pic16 -isystem /dvpt/sdcc/linux64/share/sdcc/include/pic16 -isystem /dvpt/sdcc/linux64/bin/../share/sdcc/include -isystem /dvpt/sdcc/linux64/share/sdcc/include -isystem /dvpt/sdcc/linux64/bin/../share/sdcc/non-free/include/pic16 -isystem /dvpt/sdcc/linux64/share/sdcc/non-free/include/pic16 -isystem /dvpt/sdcc/linux64/bin/../share/sdcc/non-free/include -isystem /dvpt/sdcc/linux64/share/sdcc/non-free/include test.c
    • /dvpt/sdcc/linux64/bin/gpasm -DSTACK_MODEL_SMALL -D__STACK_MODEL_SMALL -o test.o -c test.asm
    • /dvpt/sdcc/linux64/bin/gplink -I/dvpt/sdcc/linux64/bin/../share/sdcc/lib/pic16 -I/dvpt/sdcc/linux64/share/sdcc/lib/pic16 -I/dvpt/sdcc/linux64/bin/../share/sdcc/non-free/lib/pic16 -I/dvpt/sdcc/linux64/share/sdcc/non-free/lib/pic16 -w -r -o test test.o crt0i.o libdev18f26j50.lib libsdcc.lib
      message: using default linker script "/dvpt/sdcc/linux64/share/gputils/lkr/18f26j50_g.lkr"
      Segmentation fault
    • /dvpt/sdcc/linux64/bin/gplink -I/dvpt/sdcc/linux64/bin/../share/sdcc/lib/pic16 -I/dvpt/sdcc/linux64/share/sdcc/lib/pic16 -I/dvpt/sdcc/linux64/bin/../share/sdcc/non-free/lib/pic16 -I/dvpt/sdcc/linux64/share/sdcc/non-free/lib/pic16 -w -r -o test test.o crt0i.o libdev18f26j50.lib libsdcc.lib returned errorcode 35584

    The code I used (test.c) is :

    #include <pic18fregs.h>
    #pragma config OSC = HSPLL          // external oscillator, PLL enabled, HSPLL used by USB
    #pragma config PLLDIV = 2           // 8 MHZ external crystal divided by 2 gives required 4 MHz
    #pragma config CPUDIV = OSC1        // 48 MHz (No CPU system clock divide)
    #pragma config WDTEN = OFF          // WDT disabled (enabled by SWDTEN bit)
    #pragma config STVREN = ON          // stack overflow/underflow reset enabled
    #pragma config XINST = OFF          // Extended instruction set disabled
    #pragma config CP0 = OFF            // Program memory is not code-protected
    #pragma config IESO = OFF           // Two-Speed Start-up disabled
    #pragma config FCMEN = OFF          // Fail-Safe Clock Monitor disabled
    #pragma config LPT1OSC = OFF        // high power Timer1 mode
    #pragma config T1DIG = ON           // Sec Osc clock source may be selected
    #pragma config WDTPS = 256          // 1:256 (1 second)
    #pragma config DSWDTPS = 8192       // 1:8192 (8.5 seconds)
    #pragma config DSWDTEN = OFF        // Disabled
    #pragma config DSBOREN = OFF        // Zero-Power BOR disabled in Deep Sleep
    #pragma config RTCOSC = INTOSCREF   // RTCC uses INTOSC as clock
    #pragma config DSWDTOSC = INTOSCREF // DSWDT uses INTOSC as clock
    #pragma config MSSP7B_EN = MSK7     // 7 Bit address masking
    #pragma config IOL1WAY = OFF        // IOLOCK bit can be set and cleared
    #pragma config WPCFG = OFF          // Write/Erase last page protect Disabled
    #pragma config WPEND = PAGE_0       // Start protection at page 0
    #pragma config WPFP = PAGE_1        // Write Protect Program Flash Page 0
    #pragma config WPDIS = OFF          // WPFP[5:0], WPEND, and WPCFG bits ignored
    unsigned int i;
    void main(void)
        TRISCbits.TRISC2 = 0;
            for (i=1;i<1000;i++);
            for (i=1;i<1000;i++);

    Any idea what I did wrong ?
    Thanks for your help.

    Last edit: regis 2013-09-28
  • regis

    I tried with my own linker script :
    sdcc -mpic16 -p18f26j50 --use-non-free -V test.c -Wl,"-m -w -s my18f26j50.lkr"
    but I still get the same error :
    Segmentation fault
    gplink returned errorcode 35584

    my18f26j50.lkr :

    CODEPAGE   NAME=page       START=0x0           END=0xFFF7
    CODEPAGE   NAME=config     START=0xFFF8        END=0xFFFF     PROTECTED
    ACCESSBANK NAME=accessram  START=0x0           END=0x5F
    DATABANK   NAME=gpr0       START=0x60          END=0xFF
    DATABANK   NAME=gpr1       START=0x100         END=0x1FF
    DATABANK   NAME=gpr2       START=0x200         END=0x2FF
    DATABANK   NAME=gpr3       START=0x300         END=0x3FF
    DATABANK   NAME=gpr4       START=0x400         END=0x4FF
    DATABANK   NAME=gpr5       START=0x500         END=0x5FF
    DATABANK   NAME=gpr6       START=0x600         END=0x6FF
    DATABANK   NAME=gpr7       START=0x700         END=0x7FF
    DATABANK   NAME=gpr8       START=0x800         END=0x8FF
    DATABANK   NAME=gpr9       START=0x900         END=0x9FF
    DATABANK   NAME=gpr10      START=0xA00         END=0xAFF
    DATABANK   NAME=gpr11      START=0xB00         END=0xBFF
    DATABANK   NAME=gpr12      START=0xC00         END=0xCFF
    DATABANK   NAME=gpr13      START=0xD00         END=0xDFF
    DATABANK   NAME=gpr14      START=0xE00         END=0xEBF
    DATABANK   NAME=sfr14      START=0xEC0         END=0xEFF      PROTECTED
    DATABANK   NAME=sfr15      START=0xF00         END=0xF5F      PROTECTED
    ACCESSBANK NAME=accesssfr  START=0xF60         END=0xFFF      PROTECTED
    SECTION    NAME=usbram5    RAM=gpr5
  • regis

    It seems #pragma config WPDIS = OFF is responsible of the error.
    cf. :