Announcement

Collapse
No announcement yet.

Program crashes with "EVE" Stack Overflow when programmed to Flash

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Program crashes with "EVE" Stack Overflow when programmed to Flash

    Good afternoon, i have a simple program that displays a couple images and a button. If i program it to RAM its runs correctly, however if i program it to Flash i get an EVE Stack Overflow error. As a test i programmed the VISIFirstProject to the displays RAM and Flash and both work correctly.

    What functions are likely to cause this stack overflow error with my program?

    -Alex

  • #2
    Hi Alex,

    Do you have a program that we can test and run? Usually, Stack Overflow is caused by a recursive program or insufficient stack size.

    Perhaps, you have a function on the code, which calls a function, then calls another function, and so on, and never returns?

    If you have an insufficient stack, you can try to increase the stack size: e.g #STACK 4096.

    As a test i programmed the VISIFirstProject to the displays RAM and Flash and both work correctly.
    Can I ask if you are referring to the application note below:
    AN-00119 ViSi Getting Started - First Project for Picaso and Diablo16
    https://4dsystems.com.au/blog/4d-an-00119/

    Best Regards,
    Kevin

    Comment


    • #3
      Thanks Kevin, i have commented almost everything out of my program but the behavior persists. Program to RAM and the program below runs and prints:

      mounting...
      mounted

      Program it to FLASH and i get an error that says "failed to execute program" then the screen prints:

      mounting..
      mounted
      mounting...
      mounted
      mounting...
      mounted
      ...
      until the crash that reports EVE stack overflow.

      Code:
      #platform "Gen4-uLCD-70DCT-CLB"
      
      // Program Skeleton 1.3 generated 2019-09-14 12:40:50 PM
      
      #inherit "4DGL_16bitColours.fnc"
      
      #inherit "VisualConst.inc"
      
      #inherit "RemoteDigitizer7inConst.inc"
      
      #inherit "ledDigitsDisplay.inc"
      
      var touchState;
      var touchX;
      var touchY;
      var SODKnobState := 1;
      var com0Buffer[256];
      
      func main()
      
          putstr("Mounting...\n");
          if (!(file_Mount()))
              while(!(file_Mount()))
                  putstr("Drive not mounted...");
                  pause(200);
                  gfx_Cls();
                  pause(200);
              wend
          endif
          putstr("Mounted\n");
      
          hndl := file_LoadImageControl("REMOTE~2.dat", "REMOTE~2.gci", 1);
      
          gfx_Set(SCREEN_MODE,LANDSCAPE) ;
          gfx_Contrast(12);
          touch_Set(TOUCH_ENABLE);
          touch_DetectRegion(650,256,788,399); //limit detection to S-O-D knob
      
          com_SetBaud(COM0,960);
          com_Init(com0Buffer,256,0);
      
          repeat
          forever
      endfunc

      Comment


      • John Kevin
        John Kevin commented
        Editing a comment
        Hi,

        That is weird. Seeing the code you attached, I cannot see any reason for the program to act that way.
        Can you attach your project here? If not, you can also mail it to me at john dot asuncion at 4dsystems dot com dot au.

        One thing I notice is the name of the gci and the dat files. Can you check if that matches the files on your project folder and uSD card?

        Best Regards,
        Kevin
    Working...
    X