Shop OBEX P1 Docs P2 Docs Learn Events
Can't write to micro SD card after it's removed, replaced — Parallax Forums

Can't write to micro SD card after it's removed, replaced

Hi all,

I'm wondering if I can get help resolving the following issue. I'm debugging a portion of code that writes the date and time to a micro SD card (I'm using the propeller as an RTC). The date and time are sent after a pushbutton is pressed. I can successfully write data to the micro SD card upon every button press...that is, until I remove the micro SD card. When I re-insert it, I can't write any more data until I clear EEPROM and re-compile the code. Can someone tell me why and how to correct this problem?

Micro SD Card connector: http://www.digikey.com/product-detail/en/101-00660-68-6/101-00660-68-6-1-ND/2187099

Code Snapshot:
lkaXkEj.png

Comments

  • If you eject the card it needs to reinitialize the card itself definitely and usually remount the file system. Put in a test to see if the card has just been inserted and do these two things at that time.
  • Which object are you using?
  • Oops, sorry for not specifying. I'm using the PropBOE MicroSD object.
  • Yes, the object I'm using is the same PropBOE MicroSD object referenced in the link.
  • If you eject the card it needs to reinitialize the card itself definitely and usually remount the file system. Put in a test to see if the card has just been inserted and do these two things at that time.

    Peter,

    Not sure how to go about doing this in spin. Because I don't understand how my system knows that the micro SD card was removed, I can't really go about writing a test for it.

    Regarding the card needing to be reinitialized, if you look at my code it looks like I'm re-initializing every time the program counter enters the loop. If you mean to do something else, can you provide example code/statements to better illustrate your thought?
  • Chad1Chad1 Posts: 26
    edited 2016-05-15 22:22
    I discovered that all my problems go away when I remove the Parallax programmer USB dongle from the system after I write the code to EEPROM and before I execute the program. I had been testing with the USB dongle remaining plugged in. Not sure what's happening here but I thought I'd at least mention the discovery.
  • Chad1 wrote: »
    I discovered that all my problems go away when I remove the Parallax programmer USB dongle from the system after I write the code to EEPROM and before I execute the program. I had been testing with the USB dongle remaining plugged in. Not sure what's happening here but I thought I'd at least mention the discovery.

    Then it would help if you include all your code. Use the Propeller tool and archive the project and post the zip file.


Sign In or Register to comment.