Hi Neil
Since I can't reproduce the problem and also it looks to be restricted to certain SD cards the best that I can do is explain what could be reasons for it to get stuck in a certain state during (re-)formatting - that is, in state STATE_FORMATTING_DISK_8.
What is happening during this state is that each sector belonging to the FAT is being deleted (written to 512 x 0x00). There are usually 2 FATs so the amount of sectors to be cleared is equal to the number of sectors in the FAT * the number of copies of the FAT.
[A 4G card has typically approx. 15'700 sectors to be deleted in its (typically)2 FATs - see the "info" command for overview of characteristics of the card]
The operation is a "background" operation which means that the system is not blocked when it is taking place. The mass storage task will delete one sector at a time and then the task will be re-scheduled so that it can delete the next one as soon as possible. During the progress there are some *** printed to the debug output so that an idea of the progress can be had. If the reformating doesn't complete I would expect this output to stop and the amount of progress actually made be visible (eg. 20%, 50, 75% of the total). By comparing the case with multiple cards that fail you can see whether it is always at the same point or whether it is more random.
The next question is whether the task is still trying or whether it has given up. In fact I wouldn't expect the task to give up unless there is also a write failure of some sort, which would be accompanied with an error such as "Write error\r\n" or possible "TIMEOUT!!!\r\n"
If there is no such error message (assuming they haven't been disabled) I would expect that the task will be in the active state and writing sectors or waiting for the SD card to inform that it is no longer busy after the previous write. Note that the D card will often be busys for a short time after each sector write so the task quits temporarily and tries again later. This means that the second question is, if no error messages were seen, whether the task is still regularly checking the state of the SD card but can't continue because the SD card always returns that it is busy (forever).
The final possibility is that there were no errors and the SD card is not busy but that the mass storage task has stopped polling/writing the card. This final possibiity would be more likely a SW error since it wouldn't be normal to stop before the process is complete. It is however unlikely that this woud be encountered only by certain SD cards and not by others.
Is it possible to identify which category of problem exists from this?
Regards
Mark