Pumpkin, Inc.

Pumpkin User Forums

SD Card and WDT Interactions

If you have a general question or comment regarding the CubeSat kit, post it here.

SD Card and WDT Interactions

Postby AaronInSpace » Mon Feb 13, 2012 3:01 pm

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?
AaronInSpace
 
Posts: 8
Joined: Wed Jul 06, 2011 2:04 pm

Re: SD Card and WDT Interactions

Postby Andrew » Tue Feb 14, 2012 8:49 am

Yes, you have access to all the SPI read and writes ...
Andrew
Site Admin
 
Posts: 68
Joined: Mon Nov 30, 2009 6:43 pm

Re: SD Card and WDT Interactions

Postby AaronInSpace » Tue Feb 14, 2012 2:31 pm

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!!!!
AaronInSpace
 
Posts: 8
Joined: Wed Jul 06, 2011 2:04 pm

Re: SD Card and WDT Interactions

Postby Andrew » Tue Feb 14, 2012 6:09 pm

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.
Andrew
Site Admin
 
Posts: 68
Joined: Mon Nov 30, 2009 6:43 pm

Re: SD Card and WDT Interactions

Postby AaronInSpace » Thu Feb 16, 2012 2:33 pm

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?
AaronInSpace
 
Posts: 8
Joined: Wed Jul 06, 2011 2:04 pm

Re: SD Card and WDT Interactions

Postby Andrew » Thu Feb 16, 2012 3:18 pm

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 :)
Andrew
Site Admin
 
Posts: 68
Joined: Mon Nov 30, 2009 6:43 pm


Return to CubeSat General

Who is online

Users browsing this forum: No registered users and 1 guest

cron