Netduino plus,SD卡无法使基本示例工作
您好,我想在 netduino plus 上尝试我的 SD 卡。 我昨天从这个网站下载了SDK。
我找不到文档,所以我找到了以下代码。 但是它给出了“CLR_E_VOLUME_NOT_FOUND”..我做错了什么? 我在网上阅读了一些有关安装和某个 dll (SecretLabs.NETMF.IO.dll ) 的内容,但我找不到该 dll。
有人可以帮助我开始吗?
public class Program
{
public static void Main()
{
var dir = Directory.GetCurrentDirectory();
var fileName = Path.Combine(dir, "test.txt");
Debug.Print(fileName);
byte[] testBytes = new byte[] { 1,2,3,4 };
File.WriteAllBytes(fileName, testBytes);
}
}
输出:
\test.txt
Exception System.IO.IOException - CLR_E_VOLUME_NOT_FOUND (1) Message: System.IO.Path::NormalizePath [IP: 0070] System.IO.Path::GetFullPath [IP: 001a] System.IO.FileStream::.ctor [IP: 0009] System.IO.File::WriteAllBytes [IP: 0012] NetduinoPlusApplication1.Program::Main [IP: 0025]System.IO.dll 中发生“System.IO.IOException”类型的第一次机会异常 System.IO.dll 中发生“System.IO.IOException”类型的未处理异常
Hi I want to try my SD card on de the netduino plus.
I downloaded the SDK from this website yesterday.
I could not find documentation so I figured out the following code.
However it gives "CLR_E_VOLUME_NOT_FOUND".. What do I do wrong ?
I read something online about mounting and a certain dll (SecretLabs.NETMF.IO.dll ) but I cannot find that dll.
Can anybody help me getting started ?
public class Program
{
public static void Main()
{
var dir = Directory.GetCurrentDirectory();
var fileName = Path.Combine(dir, "test.txt");
Debug.Print(fileName);
byte[] testBytes = new byte[] { 1,2,3,4 };
File.WriteAllBytes(fileName, testBytes);
}
}
Output :
\test.txt
Exception System.IO.IOException - CLR_E_VOLUME_NOT_FOUND (1)
Message:
System.IO.Path::NormalizePath [IP: 0070]
System.IO.Path::GetFullPath [IP: 001a]
System.IO.FileStream::.ctor [IP: 0009]
System.IO.File::WriteAllBytes [IP: 0012]
NetduinoPlusApplication1.Program::Main [IP: 0025]
A first chance exception of type 'System.IO.IOException' occurred in System.IO.dll
An unhandled exception of type 'System.IO.IOException' occurred in System.IO.dll
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 Netduino 论坛 请参阅此论坛帖子。
我需要写入
\SD\
文件夹。Mounting/dll
仅适用于带有附加 SD 卡屏蔽的普通 Netduino。三件事:
\SD\
,而不是\
SecretLabs.NETMF.IO
。 Netduino Plus 自动安装和拆卸 MicroSD 卡。I've been helped at the Netduino Forum, see this forum post.
I needed to write to the
\SD\
folder.Mounting/dll
was only necessary for the plain Netduino with an additional SD card shield.Three quick things:
\SD\
rather than\
SecretLabs.NETMF.IO
is only needed for manually mounting and dismounting--on the regular Netduino. The Netduino Plus automatically mounts and dismounts MicroSD Cards.查看 http://netduinohelpers.codeplex.com/ 项目中的 \Samples\SDCardTest 以获得完整示例它了解各种 Netduino 平台(例如,Netduino Mini 的 SD 卡芯片选择引脚与 Netduino 或 Netduino Plus 的不同)。从固件版本 4.1.1 Beta 1 开始,支持高容量 microSD 卡,并已成功测试高达 8GB。
Check out the \Samples\SDCardTest in the http://netduinohelpers.codeplex.com/ project for a complete example which is aware of the various Netduino platforms (for instance, the SD card chip select pin for the Netduino Mini is different than the one for the Netduino or the Netduino Plus). As of firmware version 4.1.1 Beta 1, High Capacity microSD cards are supported and have been tested successfully up to 8GB.