Thank you. Some more information.. if I use original code which works with one card, I run into the infinite loop with a different card. When this happens SDIF registers have
CMD.START-CMD: 1
RINTSTS.RXDR: 1
RINTSTS.HTO: 1 (data starvation by host timeout)
RINTSTS.HLE: 1 (hardware locked write error)
I don't see anywhere that HTO or HLE interrupts are enabled, that may be on of the reason of infinite loop when waiting for START-CMD to clear. Errors are not expected in SDIF_SendCommand.