[En-Nut-Discussion] Ethernut 5: Problem with MMC mounting

Markus Dost markus.dost at dr-clauss.de
Thu Feb 23 11:20:01 CET 2012


Hi,

I want to use a SD-Card on my Ethernut5-Board and try to mount it with  
the following code:

#ifdef USE_MMCSD
     int mmc_volume;
     printf("\nRegister PHAT...");
     if (NutRegisterDevice(&devPhat0, 0, 0)){
     	puts("failed");
     }
     else {
     	puts("OK");
     	printf("Register %s...", DEV_MMCARD0_NAME);
     	if (NutRegisterDevice(&DEV_MMCARD0, 0, 0)){
     		puts("failed");
     	}
     	else {
     		puts("OK");
     		printf("Mounting MMC-/SD-Card...");
     		NutThreadYield(); //enable Interrupts
     		mmc_volume = _open(DEV_MMCARD0_NAME ":1/PHAT0", _O_RDWR |  
_O_BINARY);
     		if (mmc_volume == -1){
     			printf("failed: error %d\n", errno);
     		}
     		else {
     			puts("OK");
     		}
     	}
     }
#endif /* USE_MMCSD */

The registrations of the PHAT file system and the MMC-/SD-Card driver  
work. But the command _open() cannot access my card and fails with the  
error code 19 (ENODEV).

The Nut/OS-Version is 4.10.1 and the card is a Canon SDC-32M with 32 MB.

Does anybody have an idea what I've made wrong?

Best regards,
Markus



More information about the En-Nut-Discussion mailing list