Page 1 of 1

SD Card and WDT Interactions

PostPosted: Mon Feb 13, 2012 3:01 pm
by AaronInSpace
Background info:
uC = MSP430F1612 in CSK
IDE = RA v.2
WDT Enabled
LPM disabled
100 Hz Timer A OSTimer (32KHz crystal as source with 328 as timer interval)

Question:
I am back to working on the WDT and find that any of my functions which work with the SD card seem to cause WDT resets. This is probably because of the length of time it takes to work on the SD card. Is there some low-level function I have access to in which I can clear the WDT?

Re: SD Card and WDT Interactions

PostPosted: Tue Feb 14, 2012 8:49 am
by Andrew
Yes, you have access to all the SPI read and writes ...

Re: SD Card and WDT Interactions

PostPosted: Tue Feb 14, 2012 2:31 pm
by AaronInSpace
So would you suggest I modify "effs_thin_mmc_drv_us0.c" to enable the WDT if the SD card interactions cause the WDT to be unhappy then?

I tried modding spi_tx1() which seemed central to all SPI reads or writes, by adding clearing in the while loops in it. This just caused resets where there hadn't been any before.

What would you tell a customer who wanted to use your SD card code and also wanted the WDT enabled?

Thanks for your time Andy!!!!

Re: SD Card and WDT Interactions

PostPosted: Tue Feb 14, 2012 6:09 pm
by Andrew
AaronInSpace wrote:I tried modding spi_tx1() which seemed central to all SPI reads or writes, by adding clearing in the while loops in it. This just caused resets where there hadn't been any before.
Then I would suggest figuring out why adding WDT clearing calls is causing your code to reset.

It would likely be best to profile your code's calls to the EFFS-THIN stuff, and see what is the longest timeout, and how it relates to the longest interval of SPI reads or writes when accessing the SD Card.

Re: SD Card and WDT Interactions

PostPosted: Thu Feb 16, 2012 2:33 pm
by AaronInSpace
Ok, will do. Thanks. Am I the only person to have a problem with WDT and SD card interactions? I feel like I'm in uncharted territory for some reason but I'm probably not.
Is it expected that if you want the WDT enabled, that you must modify the EFFS thin code to clear the WDT?

Re: SD Card and WDT Interactions

PostPosted: Thu Feb 16, 2012 3:18 pm
by Andrew
I can tell you that indeed, the potentially long "silent times" associated with accessing an SD Card for reads and writes can make implementing a WDT difficult :)