arduino-libraries / SD

SD Library for Arduino
http://arduino.cc/
GNU General Public License v3.0
182 stars 155 forks source link

Initialization failure on Mega [imported] #17

Open agdl opened 8 years ago

agdl commented 8 years ago

From @cmaglie on November 15, 2012 18:50

This is Issue 796 moved from a Google Code project. Added by 2012-01-17T22:33:27.000Z by practica...@gmail.com. Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Defect, Priority-Medium

Original description

What steps will reproduce the problem?

  1. load demo code for the W5100 that uses the SDcard (Blinkled from simplewebserver)
  2. Power OFF/ remove USB connector from Mega board
  3. Re-apply power

What is the expected output? What do you see instead? The demo should work from cold start, but the SDcode hangs internally after supplying one file. However If a warm start (press reset button on mega) is issued then there is no problem.

There is also no problem if you 'upload' a file to the SDcard before downloading a file, then it functions correctly after a cold start.

What version of the Arduino software are you using? On what operating system? Which Arduino board are you using? 1.0IDE OSX mega V2

Please provide any additional information below.

The SD and ethernet libraries need to be cleaner, leaving the SPI state 'clean' after exiting and not assuming they are the sole owners, the SDcode should also NOT be disabling system interrupts whilst it is performing actions.

Copied from original issue: arduino/Arduino#796