Why do the commands in my GEL functions seem to work intermittently?
Code Composer Studio (CCS) does not wait or pause for a GEL function to complete before permitting you to continue using CCS. For lengthy GEL functions, which may take 5 or 10 seconds to execute on a slower PC, this can cause problems when you try to perform actions which assume the GEL function has completed.
A "lengthy" GEL function should be considered one that contains over 50 GEL
commands; small GEL functions of a few lines execute in under a second and
should not cause a problem.
For example, if you execute a GEL function which initializes a set of registers and then start executing the program before the GEL function has completed initializing the registers the program may run erroneously.
This could seem to be a hardware problem, where the memory on the board is acting inconsistently because the appropriate registers used to access memory were not initialized, or a runtime problem, where program tasks do not work because a interrupt mask or other register used in tasking was not set correctly.
Bug report SDSsq12143 has been submitted to address this problem, but to work around the problem and determine that a GEL function has completed you can add a call to GEL_TextOut at the end of the GEL function to display a message in CCS to indicate that the GEL function has completed.
An example GEL function which displays a message when completed:
/* the body of your GEL function */
GEL_TextOut("GEL file testfunc is finished\n");