Hi Erich,
The project with FatFsMemSDHC is not using the KSDK but I couldn't get it to work. One problem I worked around was caused by using a microSD on my board so it needs to use DAT3 as the CD pin which doesn't seem to be supported. I turned off the card detect option in the component but then the code always returns FALSE for the card detect and stops trying to access the card before anything is initialised. I changed the FATM1_CardPresent function to always return TRUE and that got me further (but my change gets overwritten every time I generated the code in PEx). So with that I now see "File System mounted" in the shell output.
The point at which I gave up is when using 'FAT1 dir' in the shell I get the following returned:
ERROR: getcwd failed: (1) A hard error occurred in the low level disk I/O layer
*** Failed or unknown command: FAT1 dir
It appears the card function SDHC1_GetCardInfo times out. At one point I didn't have the TMOUT1_AddTick call in the FRTOS1_vApplicationTickHook (eventually I found this requirement after searching the internet) and it locked up permanently so it's not just a case of too short a timeout.
Another issue that took me a while to work out was with the shell. The help shows passing the address of the ParseCommand function but I eventually discovered it is now an array of ParseCommand functions. Again I had to search the code to find the fat and shell callbacks to insert in the table which was not specified in any help.
I also tried to use the FreeRTOS_Tasks to add my tasks but no code is generated so I'm not sure of the purpose of this?
My shell task is currently as follows:
unsigned char cmd_buf[48];
memset( cmd_buf, 0, sizeof(cmd_buf) );
FAT1_FATFS fs;
memset( &fs, 0, sizeof(FAT1_FATFS) );
bool cardMounted = 0;
FAT1_Init();
FAT1_MountFileSystem( &fs, "0:", CLS1_GetStdio() );
(void)CLS1_ParseWithCommandTable((unsigned char*)CLS1_CMD_HELP, CLS1_GetStdio(), CmdParserTable); /* print help and prints as well the prompt */
for(;;)
{
FAT1_CheckCardPresence( &cardMounted, "0:", &fs, CLS1_GetStdio() );
(void)CLS1_ReadAndParseWithCommandTable(cmd_buf, sizeof(cmd_buf), CLS1_GetStdio(), CmdParserTable);
FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
}
If you have any suggestions on something I have missed out I would appreciate it.
Re: FatFs in KSDK. I have now found that but with no documentation or example code that I can find it will take a while for me to work out how to add it to my KDSK project.
Best regards,
Adrian.