Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 8 months ago.
LPC824でSDカードが使えない
LPC824でSDカードに読み書きをしたいのですが、うまくマウントされないようです。
コードはほぼSDFileSystem Libraryの公式そのままでピンアサインのみ変更しています。
よろしくお願いします。
include the mbed library with this snippet
#include "mbed.h"
#include "SDFileSystem.h"
//Create an SDFileSystem object
SDFileSystem sd(dp8, dp9, dp10, dp11, "sd");
int main() {
printf("Hello World!\n");
mkdir("/sd/mydir", 0777);
FILE *fp = fopen("/sd/mydir/sdtest.txt", "w");
if(fp == NULL) {
error("Could not open file for write\n");
}
fprintf(fp, "Hello fun SD Card World!");
fclose(fp);
printf("Goodbye World!\n");
}
1 Answer
8 years, 8 months ago.
調べてみたところ、最新のライブラリとの組み合わせで動作しないようです。
実行時に Could not open file for write のエラーが表示されるようであれば、mbed ライブラリのリビジョンを137以前に戻していただけますか?
mbedライブラリの不具合のようなので、issueを登録しました。
https://github.com/ARMmbed/mbed-os/issues/4151