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
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
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion
On 02.03.2012 08:26, Markus Dost wrote:
> Am 23.02.2012 um 11:20 schrieb Markus Dost:
>> I want to use a SD-Card on my Ethernut5-Board and try to mount it with
>> the following code:
Just for the records:
http://ethernut.svn.sourceforge.net/viewvc/ethernut?view=revision&revision=3992
fixes this for Nut/OS 5.0
http://ethernut.svn.sourceforge.net/viewvc/ethernut?view=revision&revision=3993
fixes this for Nut/OS 4.10
During testing we had still problems, which suddenly disappear and were not reproducible since. Mh...
Until a new bugfix release is available, replace
nut/arch/arm/dev/atmel/at91_mci.c
nut/conf/arch/arm.nut
nut/conf/ethernut50f.conf
in your source tree and rebuild.
Regards,
Harald
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion