Hi All
I believe that I identified an error in the demo configuration as follows:
In config.h (processors not using sub-file operation) the definition of the final FLASH sector in the file system is:
#define LAST_FILE_BLOCK (unsigned short)((FILE_SYSTEM_SIZE)/FILE_GRANULARITY) // last block in our file system
However, when the internal file system is using multiple FLASH sectors for files (configuration dependent but can be used) this results in an invalid check, which means that trying to access a file which is beyond the end of the file system can result in an exception being generated (attempt to read from outside of the file system/FLASH area). Therefore I am proposing the following correction which has worked correctly in this test case:
#define LAST_FILE_BLOCK (unsigned short)((FILE_SYSTEM_SIZE)/SINGLE_FILE_SIZE) // last file block in our file system
Secondly I noticed that the favicon.ico was not being returned if the web browser requested it and the board was in the 'validation' phase. This was in fact the reason for the identification of the first problem, which would otherwise certainly have not been noticed (the browser will display the last one returned anyway). To solve this I removed the user file initialisation (code below) out of the fnValidatedInit() routine to the main initialisation code. This seems more logical to me.
#if defined INTERNAL_USER_FILES // {37}{55}
#if defined EMBEDDED_USER_FILES
if (fnActivateEmbeddedUserFiles("1", USER_FILE_IN_INTERNAL_FLASH) == 0) { // if valid embedded user file space is found activate it, else use code embedded version
fnEnterUserFiles((USER_FILE *)user_files); // user_files defined in app_user_files.h
}
#else
fnEnterUserFiles((USER_FILE *)user_files); // user_files defined in app_user_files.h
#endif
#endif
Regards
Mark