Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
746B

  1. : _err _sdcDesel ABORT" SDerr" ;
  2. ( Tight definition ahead, pre-comment.
  3. Initialize a SD card. This should be called at least 1ms
  4. after the powering up of the card. We begin by waking up the
  5. SD card. After power up, a SD card has to receive at least
  6. 74 dummy clocks with CS and DI high. We send 80.
  7. Then send cmd0 for a maximum of 10 times, success is when
  8. we get 0x01. Then comes the CMD8. We send it with a 0x01aa
  9. argument and expect a 0x01aa argument back, along with a
  10. 0x01 R1 response. After that, we need to repeatedly run
  11. CMD55+CMD41 (0x40000000) until the card goes out of idle
  12. mode, that is, when it stops sending us 0x01 response and
  13. send us 0x00 instead. Any other response means that
  14. initialization failed. )