Unable to compile long program

  • Zenon Bolino
    Zenon Bolino


    I am extending the size of a float array beyong 64 and I got this error.

    C:\Documents and Settings\Windows>sdcc -mpic16 -mplab--comp anal.c

    message: using default linker script "C:\Archivos de programa\gputils\lkr\18f252.lkr"
    warning: relocation of section "udata_anal_1" failed, relocating to a shared memory location
    error: linker script has no definition that matches the type of section "udata_anal_1"

    It works fine up to 64. Now, I am trying 90 but fails . The chip has 1536 bytes, so it should be able to handle this( 90 words * 4 = 360 , plus other variables might be 500 or 600 bytes).
    It looks the linker is not being able to allocate this extra memory because of the message .

    Part of the code looks like

    float q1[10];
    float q2[10];
    const float coefs [10] ={1.999440, 1.997762, 1.991054, 1.964296, 1.858462, 1.453882, 0.113775, -1.987055, 1.948388, 1.796217};
    char demo[10] = {6,5,4,6,2,1,2,1,4,1};
    float sample;
    float temp[90];
    char contador;
    float resu [10];
    void display(void);
    void ADC(void);

    Any idea what should I add to the linker script to handle my code ?

    This is the linker script .

    // $Id: 18f252.lkr 448 2006-08-19 02:52:41Z craigfranklin $
    // File: 18f252.lkr
    // Sample linker script for the PIC18F252 processor

    // Not intended for use with MPLAB C18.  For C18 projects,
    // use the linker scripts provided with that product.


    CODEPAGE   NAME=vectors    START=0x0            END=0x29           PROTECTED
    CODEPAGE   NAME=page       START=0x2A           END=0x7FFF
    CODEPAGE   NAME=idlocs     START=0x200000       END=0x200007       PROTECTED
    CODEPAGE   NAME=config     START=0x300000       END=0x30000D       PROTECTED
    CODEPAGE   NAME=devid      START=0x3FFFFE       END=0x3FFFFF       PROTECTED
    CODEPAGE   NAME=eedata     START=0xF00000       END=0xF000FF       PROTECTED

    ACCESSBANK NAME=accessram  START=0x0            END=0x7F
    DATABANK   NAME=gpr0       START=0x80           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
    ACCESSBANK NAME=accesssfr  START=0xF80          END=0xFFF          PROTECTED