|
Hello everybody,
I have a project that consist of a bootloader and the real application and run on a SAM9M10. Both, the bootloader (boot.bin) and the application are stored on the SD card connected to HSMCI0.
When I power up the board the ROM bootloader loads the bootloader from the SDcard and start the bootloader. The bootloader initialize the external DDR2 RAM and load de application in it. When the checksums are verified it jumps to the program in the DDR2 ram. So far so good, but, when the application want to initialize the SD card an error occur.
At this moment both, the bootloader and the application, use the FATFS file system and drivers from the example project. Because of the successful load of the application it seems no hardware problem. When I disconnect the SD card and connecting it again every thing seems to work fine.
In my application I first check if the SD card is connected MEDSdcard_Detect(&medias[ID_DRV], MCI_ID) after that I call MEDSdcard_Initialize(&medias[ID_DRV], MCI_ID), this function fails. Inside that function SD_Init(sdDrv, (SdDriver *)mciDrv) is called, this is the source of the error.
The ROM bootloader also use the HSMCI for loading the bootloader. After that the functions above seems to work fine. Does anyone have a suggestion how to force the SD card again in such an condition that it is able to initialize again?
Lukas
|