Hi,
In order to overtake the program size limit for a single program in FLASH, I am willing to store some programs on the SD card.
The "main program" (stored in the flashbank 0) would just be launcher.
This program will not have any UI. It will simply make a few actions (check for files on the SD card, ...), and launch a 1st "app" from the SD called Menu (.4XE / .4FN).
Menu will offer the user several buttons to choose which app he wants to use.
Menu will then launch the corresponding app selected by the user, from the SD (4XE or 4FN).
When the user is done with this app, a return button will exit and go back to Menu.

Since the apps are independant for each other, it does not really matter if the context is stored when launching an app.
It is ok for me to re-initialize my Menu app when I return from another app. The most important data will be store in a txt file on the SD, so it's just a matter of reading it.
So, at this point, both file_Run() or file_Exec() seem to do the job.
Here is where it gets tricky : all app need to have access to the serial/UART.
How should I process with that ? Can I initialise the UART buffers (RX and TX) in myLauncher, and then access then from any of my apps with some pointers ?
At the moment, re-init the UART everytime I open an app. Since I need to be able to send/receive big frame, I am using some large buffers as global variables (> 1000 byte).
I tried a few things with file_Exec(), file_Run(), mem_Free() and returns, but after several opening/closing app, the screen crashed because of stack overflow.
I believe that the memory is not completely freed when I return from an app. Therefore, everytime I re-open an app, some more RAM get allocated, until a stack overflow occurs.
In each of my app code, I have something like this :
I think I understand the concept of parent and child program, but I haven't been able to find the application note (there are no more filters on the website ?!). Therefore, there are probably some details that I am missing.
myLauncher is prety basic, and uses Designer
The other program are coded in Visi.
I am using the pro version.
In order to overtake the program size limit for a single program in FLASH, I am willing to store some programs on the SD card.
The "main program" (stored in the flashbank 0) would just be launcher.
This program will not have any UI. It will simply make a few actions (check for files on the SD card, ...), and launch a 1st "app" from the SD called Menu (.4XE / .4FN).
Menu will offer the user several buttons to choose which app he wants to use.
Menu will then launch the corresponding app selected by the user, from the SD (4XE or 4FN).
When the user is done with this app, a return button will exit and go back to Menu.
Since the apps are independant for each other, it does not really matter if the context is stored when launching an app.
It is ok for me to re-initialize my Menu app when I return from another app. The most important data will be store in a txt file on the SD, so it's just a matter of reading it.
So, at this point, both file_Run() or file_Exec() seem to do the job.
Here is where it gets tricky : all app need to have access to the serial/UART.
How should I process with that ? Can I initialise the UART buffers (RX and TX) in myLauncher, and then access then from any of my apps with some pointers ?
At the moment, re-init the UART everytime I open an app. Since I need to be able to send/receive big frame, I am using some large buffers as global variables (> 1000 byte).
I tried a few things with file_Exec(), file_Run(), mem_Free() and returns, but after several opening/closing app, the screen crashed because of stack overflow.
I believe that the memory is not completely freed when I return from an app. Therefore, everytime I re-open an app, some more RAM get allocated, until a stack overflow occurs.
In each of my app code, I have something like this :
Code:
// Global var
var TXRXbufffer[1000] ;
var RXbuff[1000];
func main()
COM2_RX_pin(PA10);
COM2_TX_pin(PA8);
com2_Reset();
com_SetBaud(COM2, 39700); // Parameter for the function is Baud/10
com2_Init(RXbuff, BACKGROUND_SERIAL_COM_BUFFER_SIZE,0);
com2_TXbuffer(TXRXbufffer,TX_COM_BUFFER_SIZE_ENCODED_FRAME, PA8);
repeat
// Some actions
// Different for each app
// Check if there is some data
get_serial_messages();
foreever
endfunc
Code:
func get_serial_messages()
var singleData ;
singleData := serin2();
if(singleData >= 0)
// Some processing
endif
endfunc
myLauncher is prety basic, and uses Designer
The other program are coded in Visi.
I am using the pro version.

Comment