-
Notifications
You must be signed in to change notification settings - Fork 497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for arduino zero #16
Comments
Try the beta. |
Any word on the beta working for the Zero ? |
I don't have a Zero. How does the beta fail on Zero? |
Hi, |
I cannot get the simple Longnames example working on a Zero. I know the hardware is ok because SD.h can read the SD card. I run the same code on a Mega and it works fine. Anything specific I have to do for a Zero? |
The LongFileName example works on my Zero. I only edited this line to use the correct chip select pin.
Here is the compile/load:
I copied the test files to an 16 GB microSD and ran the example. Here is the output:
|
I'm using this board which is a Zero compatible Nano board > https://wiki.protoneer.co.nz/NANO-ARM . Like I said I know SD card and files are ok because I SD.H can grab the files on the card. SdFat stops at begin() |
Can't help. There are hundreds of Arduino-like boards so I can't buy and test all. |
That's the problem... Mega == Work, Due == Work, Nano-ARM == not work... I have another SAMD21 en route from China so lets see that works. |
Add Nano to that list of working units... How frustrating. and weirdly SdInfo works using the default parameters. Where are you based Bill? I wonder if I can persuade the Nano-Arm guys to send you a board. |
SdInfo often works when other examples fail. The reason is SdInfo does not initialize the SD until a character is typed. This insures there is not a spurious restart related to the USB. A real Zero has an extra chip associated with the USB. Try adding the following to the LongFileName example.
Also try the QuickStart example. |
Ok this is what tried:
output from 128MB SD card output from 16GB SD card |
Bill. That was weird. I got it working.... I used SDformat to format the 128MB card. bear in mind that these cards worked no problem in Mega, Nano and Due... just not this NANO-ARM board... test the 16GB one next.. |
Enough testing for 1 night... |
Serial is accessed in sd.intitErrorHalt() and sd.errorHalt(). You can add an argument to use SerialUSB. This should provide additional info about the failure. Change the calls like this.
Also ls has an argument for Print so no files are listed in QuickStart.
The big difference between the ten year old version of SdFat used in SD.h and the current SdFat is the SPI clock rate. I used a very slow default rate in the first versions of SdFat since many SD modules had resistor level shifters for 5V to 3.3 V signal conversion and failed at higher speeds SD.h still has a 4 MHz default rate. The LongFileName example uses the max rate supported by the SPI library. This is probably 12 MHz for the Nano Zero. The SAMD implements SPI with the SERCOM interface so the signals may be marginal on the Nano Zero for some cards at 12 MHz. Try 4 MHz in the examples. Here is the change for LongFileName.
|
Bill its not your library that is the problem... is this board... the clue was in that it could read from small Sd cards but not larger ones and it gave me an idea. What if that was caused by not enough current getting to the SD module so I attached a separate power source and boom it worked... |
You got it. I missed this on the board website.
150 mA is way too little to power the SAMD and any other serious device. The Zero has a 1 amp LDO 3.3 V regulator so you can get about 500 mA from USB and even more with an external PS since it has an efficient 1 amp DC-DC step-down regulator for the external jack. I also waste lots of time with poorly designed ebay and other Chinese boards and breakouts. I now do more testing after being burned too often. |
Yeah I picked that board because it don't look like a badly built clone. I have a low powered OLED to replace the LCD and if I can find a low powered SD module I can make it work. Thanks for your help BTW... Much appreciated. I was almost at the point where I would have purchased one of these and shipped it to your home :) |
That won't be easy. Modern SD cards use high current for short times during flash access. That's so they can be fast. Average current is low but you need high peak current. |
seemingly there's no support for the arduino zero (arduino ide 1.6.5 r2), as i get alot of compile errors
SDFAT\SdSpiCard.cpp.o: In function
SdSpiCard::spiSend(unsigned char)': C:\Users\Ramon\Documents\Arduino\libraries\SDFAT/SdSpiCard.h:263: undefined reference to
SdSpi::send(unsigned char)'SDFAT\SdSpiCard.cpp.o: In function
SdSpiCard::spiInit(unsigned char)': C:\Users\Ramon\Documents\Arduino\libraries\SDFAT/SdSpiCard.h:254: undefined reference to
SdSpi::init(unsigned char)'SDFAT\SdSpiCard.cpp.o: In function
SdSpiCard::spiReceive()': C:\Users\Ramon\Documents\Arduino\libraries\SDFAT/SdSpiCard.h:257: undefined reference to
SdSpi::receive()'SDFAT\SdSpiCard.cpp.o: In function
SdSpiCard::spiReceive(unsigned char*, unsigned int)': C:\Users\Ramon\Documents\Arduino\libraries\SDFAT/SdSpiCard.h:260: undefined reference to
SdSpi::receive(unsigned char*, unsigned int)'SDFAT\SdSpiCard.cpp.o: In function
SdSpiCard::spiReceive()': C:\Users\Ramon\Documents\Arduino\libraries\SDFAT/SdSpiCard.h:257: undefined reference to
SdSpi::receive()'C:\Users\Ramon\Documents\Arduino\libraries\SDFAT/SdSpiCard.h:257: undefined reference to
SdSpi::receive()' C:\Users\Ramon\Documents\Arduino\libraries\SDFAT/SdSpiCard.h:257: undefined reference to
SdSpi::receive()'SDFAT\SdSpiCard.cpp.o: In function `SdSpiCard::spiSend(unsigned char)':
the list goes on, but i thought i'd save some reading.
The text was updated successfully, but these errors were encountered: