I was previously using MQX4.0 and my SDCard functions were all working fine.
We are trying to move to 4.2 and are finding a few issues we need to solve.
I need to be able to find a file on a SDCard, and the code used to work perfectly, but now it fails to find the file.
I'm able to create and write a separate file just fine after discovering not to flush the filesystem after writing.
Has the find file routine changed as well?
MQX_FILE_PTR fs_ptr = NULL;
char filepath[] = "b:\\file*.s19";
MFS_SEARCH_DATA search_data;
MFS_SEARCH_PARAM search;
fs_ptr = _io_get_fs_by_name("b:");
search.ATTRIBUTE = MFS_SEARCH_EXCLUSIVE;
search.WILDCARD = (char_ptr)&filepath;
search.SEARCH_DATA_PTR = &search_data;
if( ioctl( fs_ptr, IO_IOCTL_FIND_FIRST_FILE, (uint32_t *) & search ) == MFS_NO_ERROR )
{
DBG_INFO( "Upgrade files found, waiting 30s for upgrade request" );
}
else
{
DBG_INFO( "No upgrade files found" );
}