I want to add an update for everyone that may experience the same issue (and maybe also for Digi's Tech Support can be interesting).
My program boils down to (I'm working with USE_FAR_LIB_API and USE_FAR_STRING_LIB):
_ConfigStruct Config; //(_ConfigStruct is a 500 bytes structure with several fields)
unsigned int save_lens;
// Use a fixed string for configuration data
...[here I get the ptr to point inside the cfgBuffer]...
_f_strncpy(hstate.buffer,ptr,150); // <--- THIS is the important line
...[here Config struct is updated according to hstate.buffer]...
save_data=▮ // Marker is a constant 3 char data marker
writeUserBlockArray(0,(const void * const *) save_data,save_lens,2);
This program runs fine (with the same exact fixed data) for 3 to 15 loops then hangs with a system mode violation error
If I modify ONLY the _f_strncpy to use a char buffer instead of a char buffer inside a struct (as is in HttpState) everythings runs ok forever:
_f_strncpy(tmpbuffer,ptr,150); // <--- THIS is the important line
My guess is that the pointers arithmetic inside the FAR function in some case fails. I've not investigated further inside the libs.
Sorry for the long post, I hope it can be useful for someone.
Thaank you again for your help!