I have 4 different AWB files (same layout with various EQs) stored in serial flash on a SHARC-21479 based board. I would like to load one of these AWB files from flash during boot depending on a combination of 2 GPIO pin states.
To accomplish this task, can I use the awe_fwPacketExecuteFile function in PlatformAPI.h and pass a pointer to the specified filename which I would like to load? Also, do I need to mark all of these files as "Boot" files in the Flash Manager on AWE Server?
Thanks,
Patrick S
3:31am
Hi Patrick,
No you can't use awe_fwPacketExecuteFile function to start system from flash file system. This API is defined for FAT file system. To accomplish your task, use awe_fwExecuteFile(AWEInstance *pAWE, UINT32 *mFilename) function, where *pAWE is the pointer to the AWEInstance (defined in platform.c file) and mFileName is the name of the file in 32-bit formatted. Here is the Matlab example to convert file name from char to int:
intName = typecast([uint8(round('fileName.awb')) zeros(1, 4 - mod(length(uint8(round('fileName.awb'))), 4))], 'int32');
Please note that no need to make the file as "Boot" type in the Flash Manager, because you are going to control which file to execute with your own logic. Instead of calling awe_fwInit(), use your logic and call the awe_fwExecuteFile() function to start the system.
Hope this helps.
Best Regards,
MM