Product : ISaGRAF IDK 3.3

Date    : 14-June-2000

File    : Executing TIC from FLASH.html

Subject : Following procedure explains how to move downloaded code

    (space #1) from RAM to FLASH and free space #1 RAM memory before the

     allocation of space #2

Keywords:  TIC - memory - space 2 - Flash



Doing that, the code will be saved to flash before it is checked by ISaGRAF kernel. You have the risk to store a corrupted code into FLASH. In such a case, if a corrupted code leads to a fatal (GPF style) error in kernel, this error will be reproduced each time the system is restarted (boot).

1- Change the implementation of sys_link_spc:

please implement the following algorithm so that, for space #1, the link is done from the FLASH


if space is 1

    link to FLASH memory instead of RAM


    no change...

2- Remove implementation of sys_save_spc and sys_load_spc

(no more need of saving because it is always saved in FLASH)

3- Change the topmost algorithm in function isa_wait of TAST0MAI.C, so that, after each download, space #1 is copied to flash and removed from memory. You need to implement a new service in the system layer to copy RAM to FLASH and free memory:

char *isa_wait(uchar slave)


    char *add;

    add = (char *)0;

    while(SYST->start != START_APL)


        if (!isa_com()) sys_waittim(NO_APPLI_SLEEP);

        if (SYST->start == START_APL)


              /* here: add a function call to system layer

              to save space 1 (if exist) to flash and remove space 1 from RAM memory


              add = isa_link(slave);

              if (!add) SYST->start = START_INIT;





Please keep us informed about your experience. If successful, we will add a standard hook in TAST0MAI.C so that you won't have to change it again on future releases of the target software.


Copyright © 1996-2009 ICS Triplex ISaGRAF Inc. All rights reserved.