Menu

Compiler Error: First page of program memory is full, please reduce size....

2018-07-25
2018-09-04
  • jose moreno

    jose moreno - 2018-07-25

    Hello,

    I'm testing with GCB, i was testing what would it happend when my programm passed the first page of memory. On te PIC16F886, that has a programm memory of 8192 words.

    The test software its very simple just a lot of NOP instructions.!


    But i getting the following error, and i can't compile the program.

    Error: Subroutine Main is 2298 words, the size limit on the current chip is 2048 words
    Error: First page of program memory is full, please reduce size of Main and Interrupt routines

    The error says that the size limit of the current chip is 2048 words but the PIC16F886 has 8192 words of memory.

    I try to use other MCU but the same error happen.
    I try to use the #option lcall, but seems that this feature doesn't work anymore

    Any idea ? what it's happening?

     

    Last edit: jose moreno 2018-07-25
  • mmotte

    mmotte - 2018-07-25

    Jose,
    I have bumped into this wall before, too, with 16F886.

    The solution is to break your program up into subroutines. Evidently, the compiler puts your subroutines in higher program memory and uses the first 2048 for the "main" and more important subs. Don't make the subs too large either. Last winter, on the BME280 project, I was at over 7000 bytes of program.

    GL
    M

     
  • jose moreno

    jose moreno - 2018-07-25

    Hi mmotte

    I have tested the same program with the PIC16F877A and de PIC16F88, and the same error appears again.

    I was wondering if you call a subroutine from one page to another, the GCB Compiler will the all the pagesel stuff?

    Thanks

     
  • Anobium

    Anobium - 2018-07-25

    Yes, Great Cow BASIC will handle the pagesel stuff, fully automatically. Create sub and functions and the let the compiler handle pagesel for you.

     
  • stan cartwright

    stan cartwright - 2018-09-02

    What chips does this refer to? I got a 16f18855,32 express board and get this error just using gcb glcd includes.
    I've had no problems with a 18f25k22 or 328 uno/tiny so far.
    Is it a ram "layout" thing? Ram has been mentioned for other gcb anomalies like dim array as string.
    Is it using a chip with 2k ram going to be ok for big programs?
    I don't expect old pics to do much.

     
  • Trev

    Trev - 2018-09-02

    I got a 16f18855
    ...
    Is it using a chip with 2k ram going to be ok for big programs?

    That chip only has 1KB of static RAM, not 2KB.

    I don't expect old pics to do much.

    It's not what could be described as an "old" PIC !

     

    Last edit: Trev 2018-09-02
    • stan cartwright

      stan cartwright - 2018-09-04

      The ili9341 lib should not need much ram but I had troube with it with express board and gcb.
      It was not my intention to use 328 uno/nano boards.they just worked, never out of memory.

       
  • Trev

    Trev - 2018-09-04

    The ATMega328 has twice as much static RAM as the PIC16F18855 and more than twice as much flash memory. Pick a similarly specified PIC chip and you wouldn't have any memory issues either.

     

Log in to post a comment.