Hi and thanks for your reply.
I can replicate the 'mount failed' error at will but the root cause is now a different failure to what I was originally seeing.
What I did was import the sdcard_fatfs_freertos demo app. On the second tab of the import option, I moved the BOARD_SDRAM option to next to top. I also added two build options to initialise the SDRAM. There were XIP_BOOT_HEADER_DCD_ENABLE=1 and SKIP_SYSCLK_INIT. Finally, I changed line 273 of sdcard_fatfs_freertos.c to read if (f_mount(&g_fileSystem, driverNumberBuffer, 1U)), ie change the option flag to 1 at the end to force the mount straight away rather than delay it.
When I built and ran the demo under the debugger, I got the mount failed error. If I moved the BOARD_SDRAM memory option back to its original place near the bottom, it ran correctly. With the SDRAM setup, the error was in the SD_SelectBusTiming routine in fsl_sd.c. However, with my original test, this function worked and I got a further error in the disc read function as per my original message. I haven't checked this out yet but will if necessary.
The original problem came to light when I added the sdcard_fatfs_freertos code to my existing app. I am using a lot of RAM for an OPC UA Server so had to use SDRAM and not SRAM_DTC. I have got around the problem temporarily by changing the declaration of g_filesystem from static FATFS g_fileSystem; to FATFS *g_fileSystem = (FATFS *) 0x20000000; to force it to use SRAM_DTC memory. This is not ideal but works until I can work out why the SDRAM option fails.
Any further advice would be appreciated, thanks.