problem of space on pic16f689

Help
2008-07-21
2013-03-12
  • enrico betti

    enrico betti - 2008-07-21

    I'm using a pic16f689, that has 4kwords of rom (around 7 kbytes)
    When i try to compile the program i obtain this code size:

    ;       code size estimation:
    ;        1807+  491 =  2298 instructions ( 5578 byte)

    but after i receive a lot of messages that signals passing of code boundaries and an error:

    core2.asm:3795:Message [306] Crossing page boundary -- ensure page bits are set.

    message: using default linker script "/usr/share/gputils/lkr/16f689.lkr"
    error: no target memory available for section "code_core2"

    According to linker script the memory of the pic is divided in two pages: page0 of 2042 instructions and page 1 of 2048 instructions.

    CODEPAGE   NAME=page0      START=0x5      END=0x7FF
    CODEPAGE   NAME=page1      START=0x800    END=0xFFF

    This is a problem in sdcc or in gputils?
    There is a soluction for the problem? Something better that changing compiler and pic..

    Thank you.
    Enrico Betti.
    studioideasw@gmail.com

     
    • enrico betti

      enrico betti - 2008-07-21

      i rewrited much of the code in assembler reducing the size:

      ;    code size estimation:
      ;     1584+  421 =  2005 instructions ( 4852 byte)

      but i have ever the same problem:

      core2.asm:2937:Message [306] Crossing page boundary -- ensure page bits are set.
      (this on each goto past line 2937)

      message: using default linker script "/usr/share/gputils/lkr/16f689.lkr"
      error: no target memory available for section "code_core2"
      make: *** [all] Error 1

      this is a blocking problem for me. Some idea?

      Thanks

       
      • Raphael Neider

        Raphael Neider - 2008-07-26

        Try splitting your project into multiple source files (at least 2): All code from one source file is placed into the same section in order to reduce the call overhead (pagesel foo; call foo; pagesel $; becomes call foo within a source file).
        Either use
        sdcc -mpic14 -p16f689 -c file1.c
        sdcc -mpic14 -p16f689 file2.c file1.o
        or
        sdcc -mpic14 -p16f689 -c file1.c
        sdcc -mpic14 -p16f689 -c file2.c
        followed by a call of
        gplink file1.o file2.o
        ... plus many options from sdcc's call, visible via
        sdcc file2.c file1.o -V

        Hope that helps,
        Raphael

         
        • enrico betti

          enrico betti - 2008-07-28

          Ok, i tryed to compile in this way a bigger program, and the program compile well.
          I hope it'll run.
          Thank you.
          Enrico.

           

Log in to post a comment.

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

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks