Please helpme with SDCC & Ktechlab or Piklab

navaismo
2006-11-20
2013-03-12
  • navaismo

    navaismo - 2006-11-20

    Hello guys, Im from Mexico (sorry for my english), well i newbie with SDCC; I tried to configure SDCC with Ktechlab and Piklab but already SDCC doesnt work with anyone.

    Y download the SDCC source & extracted and executed this comands:

    cp -r* /usr/local
    cp * /usr/local/bin

    sdcc -v

    well i tried to compile the same example for the 16F84,16F877 or the 18F452 in Ktechlab and Piklab, but doesnt compile in Ktechlab say this:

    [code]
    #include "p18f452.h"

    int count;

    void main(void) {

    TRISA = 0;
            count = 0;
            while(1) {
                    PORTA = count;
                    count ++;
            }

    }
    Building: /tmp/kde-root/ktechlabbvnDNa.hex
    sdcc --debug -S -mpic16 -p18f452 /usr/local/share/sdcc/include/pic16/count.c -o /tmp/kde-root/ktechlab9I4MEb.asm
    Processor: 18f452
    /usr/local/share/sdcc/include/pic16/count.c:1:21:
    p18f452.h: No such file or directory
    /usr/local/share/sdcc/include/pic16/count.c:7: error 20: Undefined identifier 'TRISA'
    /usr/local/share/sdcc/include/pic16/count.c:10: error 20: Undefined identifier 'PORTA'
    -:0: error 103: code not generated for 'main' due to previous errors
    *** Compilation failed ***
    [/code]

    in the Piklab display this:

    [code]
    #include "p18f452.h"

    int count;

    void main(void) {

    TRISA = 0;
            count = 0;
            while(1) {
                    PORTA = count;
                    count ++;
            }

    }

    sdcc -mpic16 -p18f452 -V --debug -I/usr/local/share/sdcc/include/pic16/ -c count.c
    Processor: 18f452
    count.c:1: p18f452.h: No such file or directory
    count.c:7: Undefined identifier 'TRISA'
    count.c:10: Undefined identifier 'PORTA'
    code not generated for 'main' due to previous errors
    + "/usr/local/bin/sdcpp" -nostdinc -Wall -std=c99 -DSDCC=1 -I"/usr/local/share/sdcc/include/pic16/" -Dpic18f452 -D__18f452 -DSTACK_MODEL_SMALL -DSDCC_MODEL_SMALL -DSDCC_pic16 -D__pic16 -I"/usr/local/bin/../share/sdcc/include/pic16" -I"/usr/local/share/sdcc/include/pic16" -I"/usr/local/share/sdcc/include/pic16/"  "count.c"
    *** Exited with status: 1 ***
    [/code]

    Any one can help me tu integrate the SDCC with Ktechlab or Piklab

    Thanks a lot
    Greetings from Mexico

     
    • Raphael Neider

      Raphael Neider - 2006-11-20

      As SDCC tells you, it cannot find the header file "p18f452.h".
      (1) it should be <p18f452.h>, unless you have a private copy in the current directory (next to count.c)
      (2) it should even be <pic18f452.h>, if you want to use the header file that comes along with SDCC

      Afterwards use

      sdcc -mpic16 -p18f452 -V --debug -I/usr/local/share/sdcc/include/pic16/ -c count.c

      to compile your source, the first call lacks the -I directive (may or may not be important).

      HTH,
      Raphael Neider

       
    • navaismo

      navaismo - 2006-11-21

      Oh Thanks a lot. I was saved the program in the include directory and say the same error ( I think beacuse i used quotes).
      But I'll go to try again.

      Another question... I dont see any header file for PIC16 Family. ¿i need to download a library?

      Thank you; I keep trying I want to leave de PBP in windows to Use C in linux.

      I'm one of those Linxholicos

       
    • navaismo

      navaismo - 2006-11-21

      Yes Tecodev you was right, now both(Piklab & Ktechlab) create the asm code, but both dont create the Hex file here are the errors...why?? snif...

      error in ktechlab:

      Building: /tmp/kde-root/ktechlabUqsYIb.hex
      sdcc --debug -S -mpic16 -p18f452 /usr/local/share/sdcc/include/pic16/count.c -o /tmp/kde-root/ktechlabsJiLXa.asm
      Processor: 18f452
      *** Compilation successful ***

      gpasm --object --output /tmp/kde-root/ktechlabVHQWga.o --hex-format inhx32 --warning 0 --ignore-case --force-list /tmp/kde-root/ktechlabsJiLXa.asm
      /tmp/kde-root/ktechlabsJiLXa.asm:10:Warning [230] directive ignored when debug info is disabled
      /tmp/kde-root/ktechlabsJiLXa.asm:188:Warning [230] directive ignored when debug info is disabled
      /tmp/kde-root/ktechlabsJiLXa.asm:191:Warning [230] directive ignored when debug info is disabled
      /tmp/kde-root/ktechlabsJiLXa.asm:197:Warning [230] directive ignored when debug info is disabled
      /tmp/kde-root/ktechlabsJiLXa.asm:201:Warning [230] directive ignored when debug info is disabled
      *** Assembly successful ***

      gplink --hex-format inhx32 --map --output /tmp/kde-root/ktechlabUqsYIb.hex /tmp/kde-root/ktechlabVHQWga.o
      message: using default linker script "/usr/share/gputils/lkr/18f452.lkr"
      error: missing definition for symbol "_PORTA", required by "/tmp/kde-root/ktechlabVHQWga.o"
      error: missing definition for symbol "_TRISA", required by "/tmp/kde-root/ktechlabVHQWga.o"
      *** Linking failed ***
      -----------------------------------------------------------------------------

      and the error in Piklab

      sdcc -mpic16 -p18f452 -V --debug -I/usr/local/share/sdcc/include/ -c pic16/count.c
      Processor: 18f452
      + "/usr/local/bin/sdcpp" -nostdinc -Wall -std=c99 -DSDCC=1 -I"/usr/local/share/sdcc/include/" -Dpic18f452 -D__18f452 -DSTACK_MODEL_SMALL -DSDCC_MODEL_SMALL -DSDCC_pic16 -D__pic16 -I"/usr/local/bin/../share/sdcc/include/pic16" -I"/usr/local/share/sdcc/include/pic16" -I"/usr/local/share/sdcc/include/"  "pic16/count.c"
      + "gpasm" -DSDCC_MODEL_SMALL -Dpic18f452 -D__18F452 -DSTACK_MODEL_SMALL -g -c "count.asm" -o "count.o"
      sdcc -mpic16 -p18f452 -V --debug -Wl-c -o count.hex pic16/count.o
      Processor: 18f452
      crt0i.o: No such file or directory
      + "gplink" -I"/usr/local/bin/../share/sdcc/lib/pic16" -I"/usr/local/share/sdcc/lib/pic16"  -c  -o count  crt0i.o pic16/count.o  pic18f452.lib libsdcc.lib
      *** Exited with status: 1 ***
      ---------------------

      Well i know i can compile without the IDE's but Id like to work with IDE's.

      Thank you

       
    • aisaza

      aisaza - 2006-12-06

      The sdcc in section 4.5.2 says:
      "For generating a device include file use the support perl script inc2h.pl kept in directory sdcc/scripts."

      In Piklab ->Project -> Project Options... -> Linker -> Include directories, set the path to your include libs something like
      (/usr/share/sdcc/lib/pic16/).

      In Configure Piklab in the Toolchains window verify that both "gpasm" found and "gplink" found are set, then that the Header directory (/usr/share/gputils/header/) and the Linker script directory (/usr/share/gputils/lkr/) are correctly set.

      Hope that helps.

      Alvaro Isaza

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks