Announcement

Collapse
No announcement yet.

file_Run problem

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

  • file_Run problem

    Hi,

    In order to run 3 applications on the display uLCD-32PT (GFX2), (and easier evolution of this 3 applications), I use a bootloader in flash, and 3 programs in uSD-Card. Each of these 3 applications can "file_Run" the 2 other applications via serial command.

    Below a very basic bootloader I used :

    #platform "uLCD-32PT_GFX2"
    //#STACK 500
    //#MODE RUNFLASH

    #inherit "_Quelques_Couleurs.fnc"

    func main ()
    gfx_Set (SCREEN_MODE, LANDSCAPE);
    txt_FGcolour (LIGHTGREEN);
    txt_BGcolour (BLACK);

    gfx_Cls ();
    print ("Memoire : ", mem_Heap (), "\n");
    print ("Lancement application\n");

    file_Run ("MAIN.4XE", 0); // code size 11 059 bytes
    //file_Run ("KBD10.4XE", 0); // code size 9 924 bytes
    //file_Run ("AZER.4XE", 0); // code size 7 941 bytes

    repeat
    forever

    endfunc

    "MAIN.4XE" is ok when download in RAM from the IDE, but don't run from the bootloader. This is my problem.

    The other programs, KBD10 and AZER can be loaded and run from the bootloader. KBD10 can launch AZER, AZER can launch KBD10 (via "file_Run"), but not MAIN.
    So, MAIN is big because of personnal fonts.
    I precise with precedent display uLCD32032-P1, it was OK...

    So, any solution for that ?
    If no, if I put MAIN in flash, and, if MAIN loads by "file_Run" an other program, how can I return to MAIN from the other process ?

    PS : I tried #STACK and #MODE in the bootloader without any success.

    Thanks a lot.
    Best regards.

    Joel


  • #2
    If you have a look at the demo progs in the workshop folder:-
    \4D Labs\PICASO GFX2\PICASO - RUN FROM DISK
    You will see the return call and return mechanism for sub progs.

    Also some code examples here for returning from a child prog.
    http://4d.websitetoolbox.com/post/Max-program-size-5584076

    You must also keep program size to a minimum if you wish to run a sub prog from RAM,
    When you launch a sub prog, there must be at least approx 650 bytes available for a file buffer etc, as well as the space needed for the new prog.

    Regards,
    Dave

    Comment


    • #3


      OK,

      Thanks Meldavia !



      You give me some food in my head to try to :

      - put my fonts in flash (I think I can access them from any program via parameters), because these fonts are used by all my other programs

      - share my bigger program into external functions




      So, I tried parameters with file_Run and file_Exec, with success (files joined).

      I noticed than a function called with file_Run finds correct return value, but not for file_Exec... Bug about file_Exec ?





      Now, I suppose if I use personal fonts with a program stored in flash, the font's datas are in flash too. So, could you help me to recover font datas stored in flash in a child process ?




      Thanks a lot, best regards

      Joel



      Attached files BootSimple.4dg (1.5 KB) Fonte.4dg (739 B)

      Comment


      • #4


        i want to open the jpeg that i now get back from the ucam its now sent back to a serial terminal in ascii symbols but i havnt got a program that changes it into a picture
        acroberts

        Comment


        • #5


          mgrob, why not post this in the ucam forum?



          Just read the manual it tells you everything you ned to know
          Mark

          Comment

          Working...
          X