No announcement yet.

Error: maximum program size exceeded

  • Filter
  • Time
  • Show
Clear All
new posts

  • Error: maximum program size exceeded

    I am a german Student for electrical Engineering. My development environment is Designer and i use:
    Gen4-uLCD-70DCT-CLB. I run the program from Flash.
    I create a project with 11 functions which use the data from each other. After setting the last two fuctions the program shows the error after compiling: Error: maximum program size of 32750 for device has been exceeded (code size required 32907). As a result program can't be load.
    Now I want to understand how this error can be fixed including how the program size works. For that could you please help me with the following questions:
    - What is relevant for the program size?
    - Causing function calls to problems?
    - Are many global variables a Problem? (I have declared all variables as global varibles , I need some in every function)
    - Is there an opportunity to unlock some more program size. (maybe a way to store whole program on sd card)
    - Is it possible to see what part of the program uses how much space for the program size? (Maybe a Routine or a loop)
    I am looking forward to an answer. If you have any questions please do not habitat to contact me.

    Thank you in Advance.


  • #2

    To answer your questions:
    1. Program size is dependent on the number of function used (and other possibilities to consider like static data, etc.)
    2. Hard to say precisely as function call failures can be caused by many factors, but most of the time the code (structure, flow, etc.) is the main cause
    3. No problem there as long as you efficiently use them and not cause a memory overflow (You could free up when unused, reuse variables, etc.)
    4. There are lots of ways, I will discuss some below.
    5. No easy way to do that but you can estimate the program flash size of your individual programs/function by compiling them in separate empty projects

    You can fit large programs into our processors by dividing it into sub programs or functions and then store them on the other flashbanks or in the uSD memory card.
    1. You can create multiple full applications and then load them on one of the Diablo16 flashbanks and then let your main program call them when needed. Below are some application notes that shows on how to use the additional flashbanks for programs:
    - ViSi – Read and Write Data on Diablo16 Flashbanks:

    2. You can store small functions or full applications into the uSD card and then let your main program call them when needed. Listed below are some application notes showing ways on how to implement this:
    - ViSi-Genie Magic Exit Genie:
    - ViSi: Run Child Program:
    - ViSi: Passing Arguments to Child Program:
    - ViSi: Receiving Return Value from Child Program:

    I hope this helps,
    Best Regards


    • Padd
      Padd commented
      Editing a comment
      Hello Jerson,
      Thank you for your answer.
      I only have one quick question:
      You only sent application notes for visi, but i am using Designer.
      Can i use them too or are there other notes for designer?
      Best Regards

  • #3

    Yes, the application notes are still applicable for Designer.

    Best Regards,