[En-Nut-Discussion] Ethernut 5: Problem with MMC mounting
Markus Dost
markus.dost at dr-clauss.de
Fri Mar 2 08:26:45 CET 2012
Hi Harald,
I tried your suggestion and checked the power supply of the card. But
it is ok (3,3 V).
Do I have to include some special libraries? I use these (like in the
example http://www.ethernut.de/nutwiki/Writing_PHAT_Files):
#include <dev/board.h>
#include <fs/phatfs.h>
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
Best regards,
Markus
Am 23.02.2012 um 11:20 schrieb Markus Dost:
> 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
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
More information about the En-Nut-Discussion
mailing list