Pumpkin, Inc.

Pumpkin User Forums

Interesting SD Sample Code Error

For issues specific to TI's MSP430 line of ultra-low-power microcontrollers, including compilers (e.g. Quadravox AQ430), IDEs (e.g. IAR Embedded Workbench) and development tools (e.g. TI MSP-FET430 Flash Emulation Tool).

Interesting SD Sample Code Error

Postby bfreyberg » Tue Mar 09, 2010 10:12 pm

An interesting error with the CubeSatKit\Example\MSP430\MSP430x1xx\CubeSatKit_Dev_Board\SD test.

Periodically, a new line will overwrite a previous entry. The only discernable pattern is that the overwrite is always on a line exactly 10 iterations previous. It normally happens on an order of every 100 iterations. This is on an msp430f1611.
Example below:
Code: Select all
Iterations: 0000000037  Current ticks: 0000003832.
Iterations: 0000000038  Current ticks: 0000003932.
Iterations: 0000000039  Current ticks: 0000004032.
Iterations: 0000000040  Current ticks: 0000004132.
IteratioIterations: 0000000051  Current ticks: 0000005232.
ns: 0000000042  Current ticks: 0000004332.
Iterations: 0000000043  Current ticks: 0000004432.
Iterations: 0000000044  Current ticks: 0000004532.
Iterations: 0000000045  Current ticks: 0000004632.
Iterations: 0000000046  Current ticks: 0000004732.
Iterations: 0000000047  Current ticks: 0000004832.
Iterations: 0000000048  Current ticks: 0000004932.
Iterations: 0000000049  Current ticks: 0000005032.
Iterations: 0000000050  Current ticks: 0000005132.
                                                    Iterations: 0000000052  Current ticks: 0000005332.
Iterations: 0000000053  Current ticks: 0000005432.
Iterations: 0000000054  Current ticks: 0000005532.
Iterations: 0000000055  Current ticks: 0000005632.
Iterations: 0000000056  Current ticks: 0000005732.
....
Iterations: 0000000165  Current ticks: 0000016632.
Iterations: 0000000166  Current ticks: 0000016732.
Iterations: 0000000167  Current ticks: 0000016832.
Iterations: 0000000168  Current ticks: 0000016932.
IteratioIterations: 0000000179  Current ticks: 0000018033.
ns: 0000000170  Current ticks: 0000017132.
Iterations: 0000000171  Current ticks: 0000017232.
Iterations: 0000000172  Current ticks: 0000017332.
Iterations: 0000000173  Current ticks: 0000017432.
Iterations: 0000000174  Current ticks: 0000017532.
Iterations: 0000000175  Current ticks: 0000017632.
Iterations: 0000000176  Current ticks: 0000017732.
Iterations: 0000000177  Current ticks: 0000017832.
Iterations: 0000000178  Current ticks: 0000017932.
                                                    Iterations: 0000000180  Current ticks: 0000018132.
Iterations: 0000000181  Current ticks: 0000018232.
Iterations: 0000000182  Current ticks: 0000018332.
Iterations: 0000000183  Current ticks: 0000018432.


In a debugging effort I modified the bulk of task_sd_append.c to make sure the buffer doesn't overrun, file is properly closed, the file seeks to the end, and that the file position is always greater than the last appendage (I put breakpoints on these, but they're never triggered.) I've tried effs_thin 1-3.

Code: Select all
    // Attempt to open the file, in append mode.
    file = f_open(STR_FILE_NAME, "a+");
   
   
    // If successful, append a new line to the file and report to user.
    if (file) {
     f_seek ( file , 0 , SEEK_END );
      file_pos_old = file_pos;
      file_pos = f_tell(file);
      if(file_pos < file_pos_old)
        _NOP();

      // Place banner at start of each new run.
      if (count_appends == 0)
        sprintf(strTmp, STR_CRLF STR_APP_NAME STR_CRLF STR_VERSION STR_CRLF STR_TO_APPEND, count_appends, OSGetTicks());
      // Always log counter and current ticks.
      else {
        sprintf(strTmp, STR_TO_APPEND, count_appends, OSGetTicks());
      }
      if (length = f_write(strTmp, 1, strlen(strTmp), file)) {
        sprintf(strTmp, STR_TASK_SD_APPEND "Appended %d bytes to " STR_FILE_NAME ".", length);
        if(length != 0x34)
          _NOP();
        //user_debug_msg(strTmp);
        count_appends++;
      }
      else {
        errors++;
        sprintf(strTmp,"error");
        //user_debug_msg(STR_TASK_SD_APPEND "f_write failed to write to " STR_FILE_NAME ".");
      }
      f_close(file);
    }
    // O/wise flag as an error.
    else {
            errors++;
     // user_debug_msg(STR_TASK_SD_APPEND "Cannot open " STR_FILE_NAME ".");
    }



Anyone with idea's or suggestions?
bfreyberg
 
Posts: 1
Joined: Tue Mar 09, 2010 9:59 pm

Re: Interesting SD Sample Code Error

Postby aek » Mon Apr 19, 2010 10:46 am

Interesting indeed ...

Now that EFFS-THIN is also available for the PIC24 and dsPIC33 platforms inside of the CubeSat Kit, I will do a long-term test across the three platforms (them and MSP430) to see if the problem is MSP430-specific, or endemic to all three.

My initial feel is that it is tied to the MSP430, as I have been running SD\SD1 for days on the dsPIC33 and I see no anomalous behavior ...
-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Interesting SD Sample Code Error

Postby aek » Mon Apr 19, 2010 12:03 pm

Well, it's clearly still happening ... below is the code coming out of a CSK /dsPIC33:

I will look into this ASAP.

Code: Select all
CubeSat Kit SD\SD1 Application
v1.0.1 built on Apr 18 2010 at 21:36:47.
Iterations: 0000000000  Current ticks: 0000012578.
Iterations: 0000000001  Current ticks: 0000012753.
Iterations: 0000000002  Current ticks: 0000012953.
Iterations: 0000000003  Current ticks: 0000013153.
Iterations: 0000000004  Current ticks: 0000013353.
Iterations: 0000000005  Current ticks: 0000013553.
Iterations: 0000000006  Current ticks: 0000013753.
Iterations: 0000000007  Current ticks: 0000013953.
Iterations: 0000000008  Current ticks: 0000014153.
Iterations: 0000000009  Current ticks: 0000014353.
Iterations: 0000000010  Current ticks: 0000014553.
Iterations: 0000000011  Current ticks: 0000014753.
Iterations: 0000000012  Current ticks: 0000014953.
Iterations: 0000000013  Current ticks: 0000015153.
Iterations: 0000000014  Current ticks: 0000015353.
Iterations: 0000000015  Current ticks: 0000015554.
Iterations: 0000000016  Current ticks: 0000015754.
Iterations: 0000000017  Current ticks: 0000015954.
Iterations: 0000000018  Current ticks: 0000016154.
Iterations: 0000000019  Current ticks: 0000016354.
Iterations: 0000000020  Current ticks: 0000016554.
Iterations: 0000000021  Current ticks: 0000016754.
Iterations: 0000000022  Current ticks: 0000016954.
Iterations: 0000000023  Current ticks: 0000017154.
Iterations: 0000000024  Current ticks: 0000017354.
Iterations: 0000000025  Current ticks: 0000017554.
Iterations: 0000000026  Current ticks: 0000017754.
Iterations: 0000000027  Current ticks: 0000017954.
Iterations: 0000000028  Current ticks: 0000018154.
Iterations: 0000000029  Current ticks: 0000018354.
Iterations: 0000000030  Current ticks: 0000018554.
Iterations: 0000000031  Current ticks: 0000018754.
Iterations: 0000000032  Current ticks: 0000018954.
Iterations: 0000000033  Current ticks: 0000019154.
Iterations: 0000000034  Current ticks: 0000019354.
Iterations: 0000000035  Current ticks: 0000019554.
Iterations: 0000000036  Current ticks: 0000019754.
Iterations: 0000000037  Current ticks: 0000019954.
Iterations: 0000000038  Current ticks: 0000020154.
Iterations: 0000000039  Current ticks: 0000020354.
Iterations: 0000000040  Current ticks: 0000020554.
Iterations: 0000000041  Current ticks: 0000020754.
Iterations: 0000000042  Current ticks: 0000020954.
Iterations: 0000000043  Current ticks: 0000021154.
Iterations: 0000000044  Current ticks: 0000021354.
Iterations: 0000000045  Current ticks: 0000021554.
Iterations: 0000000046  Current ticks: 0000021754.
Iterations: 0000000047  Current ticks: 0000021954.
Iterations: 0000000048  Current ticks: 0000022154.
Iterations: 0000000049  Current ticks: 0000022354.
Iterations: 0000000050  Current ticks: 0000022554.
Iterations: 0000000051  Current ticks: 0000022754.
Iterations: 0000000052  Current ticks: 0000022954.
Iterations: 0000000053  Current ticks: 0000023154.
Iterations: 0000000054  Current ticks: 0000023354.
Iterations: 0000000055  Current ticks: 0000023554.
Iterations: 0000000056  Current ticks: 0000023757.
Iterations: 0000000057  Current ticks: 0000023957.
Iterations: 0000000058  Current ticks: 0000024157.
Iterations: 0000000059  Current ticks: 0000024357.
Iterations: 0000000060  Current ticks: 0000024557.
Iterations: 0000000061  Current ticks: 0000024757.
Iterations: 0000000062  Current ticks: 0000024957.
Iterations: 0000000063  Current ticks: 0000025157.
Iterations: 0000000064  Current ticks: 0000025365.
Iterations: 0000000065  Current ticks: 0000025565.
Iterations: 0000000066  Current ticks: 0000025765.
Iterations: 0000000067  Current ticks: 0000025965.
Iterations: 0000000068  Current ticks: 0000026165.
Iterations: 0000000069  Current ticks: 0000026365.
Iterations: 0000000070  Current ticks: 0000026565.
Iterations: 0000000071  Current ticks: 0000026765.
Iterations: 0000000072  Current ticks: 0000026965.
Iterations: 0000000073  Current ticks: 0000027165.
Iterations: 0000000074  Current ticks: 0000027375.
Iterations: 0000000075  Current ticks: 0000027575.
Iterations: 0000000076  Current ticks: 0000027775.
Iterations: 0000000077  Current ticks: 0000027975.
Iterations: 0000000078  Current ticks: 0000028175.
Iterations: 0000000079  Current ticks: 0000028375.
Iterations: 0000000080  Current ticks: 0000028575.
Iterations: 0000000081  Current ticks: 0000028775.
Iterations: 0000000082  Current ticks: 0000028975.
Iterations: 0000000083  Current ticks: 0000029175.
Iterations: 0000000084  Current ticks: 0000029375.
Iterations: 0000000085  Current ticks: 0000029588.
Iterations: 0000000086  Current ticks: 0000029788.
IteratioIterations: 0000000097  Current ticks: 0000031988.
ns: 0000000088  Current ticks: 0000030188.
Iterations: 0000000089  Current ticks: 0000030388.
Iterations: 0000000090  Current ticks: 0000030588.
Iterations: 0000000091  Current ticks: 0000030788.
Iterations: 0000000092  Current ticks: 0000030988.
Iterations: 0000000093  Current ticks: 0000031188.
Iterations: 0000000094  Current ticks: 0000031388.
Iterations: 0000000095  Current ticks: 0000031588.
Iterations: 0000000096  Current ticks: 0000031788.
ticks: 0000004333.
 Iterations: 0000000021  CurrentIterations: 0000000098  Current ticks: 0000032188.
Iterations: 0000000099  Current ticks: 0000032388.
Iterations: 0000000100  Current ticks: 0000032588.
Iterations: 0000000101  Current ticks: 0000032788.
Iterations: 0000000102  Current ticks: 0000032988.
Iterations: 0000000103  Current ticks: 0000033188.
Iterations: 0000000104  Current ticks: 0000033388.
Iterations: 0000000105  Current ticks: 0000033588.
Iterations: 0000000106  Current ticks: 0000033788.
Iterations: 0000000107  Current ticks: 0000033988.
Iterations: 0000000108  Current ticks: 0000034188.
Iterations: 0000000109  Current ticks: 0000034388.
Iterations: 0000000110  Current ticks: 0000034588.
Iterations: 0000000111  Current ticks: 0000034788.
Iterations: 0000000112  Current ticks: 0000034988.
Iterations: 0000000113  Current ticks: 0000035188.
Iterations: 0000000114  Current ticks: 0000035388.
Iterations: 0000000115  Current ticks: 0000035588.
Iterations: 0000000116  Current ticks: 0000035788.
Iterations: 0000000117  Current ticks: 0000035988.
Iterations: 0000000118  Current ticks: 0000036188.
Iterations: 0000000119  Current ticks: 0000036388.
Iterations: 0000000120  Current ticks: 0000036588.
Iterations: 0000000121  Current ticks: 0000036788.
Iterations: 0000000122  Current ticks: 0000036988.
Iterations: 0000000123  Current ticks: 0000037188.
Iterations: 0000000124  Current ticks: 0000037388.
Iterations: 0000000125  Current ticks: 0000037588.
Iterations: 0000000126  Current ticks: 0000037788.
Iterations: 0000000127  Current ticks: 0000037988.
Iterations: 0000000128  Current ticks: 0000038188.
Iterations: 0000000129  Current ticks: 0000038388.
Iterations: 0000000130  Current ticks: 0000038588.
Iterations: 0000000131  Current ticks: 0000038788.
Iterations: 0000000132  Current ticks: 0000038988.
Iterations: 0000000133  Current ticks: 0000039188.
Iterations: 0000000134  Current ticks: 0000039388.
Iterations: 0000000135  Current ticks: 0000039588.
Iterations: 0000000136  Current ticks: 0000039788.
Iterations: 0000000137  Current ticks: 0000039988.
Iterations: 0000000138  Current ticks: 0000040188.
Iterations: 0000000139  Current ticks: 0000040388.
Iterations: 0000000140  Current ticks: 0000040588.
Iterations: 0000000141  Current ticks: 0000040794.
Iterations: 0000000142  Current ticks: 0000040994.
Iterations: 0000000143  Current ticks: 0000041194.
Iterations: 0000000144  Current ticks: 0000041394.
Iterations: 0000000145  Current ticks: 0000041594.
Iterations: 0000000146  Current ticks: 0000041794.
Iterations: 0000000147  Current ticks: 0000041994.
Iterations: 0000000148  Current ticks: 0000042194.
Iterations: 0000000149  Current ticks: 0000042394.
Iterations: 0000000150  Current ticks: 0000042594.
Iterations: 0000000151  Current ticks: 0000042794.
Iterations: 0000000152  Current ticks: 0000042994.
Iterations: 0000000153  Current ticks: 0000043194.
Iterations: 0000000154  Current ticks: 0000043394.
Iterations: 0000000155  Current ticks: 0000043594.
Iterations: 0000000156  Current ticks: 0000043794.
Iterations: 0000000157  Current ticks: 0000043996.
Iterations: 0000000158  Current ticks: 0000044196.
Iterations: 0000000159  Current ticks: 0000044396.
Iterations: 0000000160  Current ticks: 0000044596.
Iterations: 0000000161  Current ticks: 0000044796.
Iterations: 0000000162  Current ticks: 0000044996.
Iterations: 0000000163  Current ticks: 0000045196.
Iterations: 0000000164  Current ticks: 0000045396.
Iterations: 0000000165  Current ticks: 0000045596.
Iterations: 0000000166  Current ticks: 0000045796.
Iterations: 0000000167  Current ticks: 0000045996.
Iterations: 0000000168  Current ticks: 0000046196.
Iterations: 0000000169  Current ticks: 0000046396.
Iterations: 0000000170  Current ticks: 0000046596.
Iterations: 0000000171  Current ticks: 0000046796.
Iterations: 0000000172  Current ticks: 0000046996.
Iterations: 0000000173  Current ticks: 0000047196.
Iterations: 0000000174  Current ticks: 0000047396.
Iterations: 0000000175  Current ticks: 0000047596.
Iterations: 0000000176  Current ticks: 0000047796.
Iterations: 0000000177  Current ticks: 0000047996.
Iterations: 0000000178  Current ticks: 0000048196.
Iterations: 0000000179  Current ticks: 0000048396.
Iterations: 0000000180  Current ticks: 0000048596.
Iterations: 0000000181  Current ticks: 0000048796.
Iterations: 0000000182  Current ticks: 0000048996.
Iterations: 0000000183  Current ticks: 0000049196.
Iterations: 0000000184  Current ticks: 0000049396.
Iterations: 0000000185  Current ticks: 0000049596.
Iterations: 0000000186  Current ticks: 0000049796.
Iterations: 0000000187  Current ticks: 0000049996.
Iterations: 0000000188  Current ticks: 0000050196.
Iterations: 0000000189  Current ticks: 0000050405.
Iterations: 0000000190  Current ticks: 0000050605.
Iterations: 0000000191  Current ticks: 0000050805.
Iterations: 0000000192  Current ticks: 0000051005.
Iterations: 0000000193  Current ticks: 0000051205.
Iterations: 0000000194  Current ticks: 0000051405.
Iterations: 0000000195  Current ticks: 0000051605.
Iterations: 0000000196  Current ticks: 0000051805.
Iterations: 0000000197  Current ticks: 0000052005.
Iterations: 0000000198  Current ticks: 0000052205.
Iterations: 0000000199  Current ticks: 0000052405.
Iterations: 0000000200  Current ticks: 0000052605.
Iterations: 0000000201  Current ticks: 0000052805.
Iterations: 0000000202  Current ticks: 0000053005.
Iterations: 0000000203  Current ticks: 0000053205.
Iterations: 0000000204  Current ticks: 0000053405.
Iterations: 0000000205  Current ticks: 0000053605.
Iterations: 0000000206  Current ticks: 0000053805.
Iterations: 0000000207  Current ticks: 0000054005.
Iterations: 0000000208  Current ticks: 0000054205.
Iterations: 0000000209  Current ticks: 0000054405.
Iterations: 0000000210  Current ticks: 0000054605.
Iterations: 0000000211  Current ticks: 0000054805.
Iterations: 0000000212  Current ticks: 0000055005.
Iterations: 0000000213  Current ticks: 0000055205.
Iterations: 0000000214  Current ticks: 0000055405.
IteratioIterations: 0000000225  Current ticks: 0000057606.
ns: 0000000216  Current ticks: 0000055805.
Iterations: 0000000217  Current ticks: 0000056006.
Iterations: 0000000218  Current ticks: 0000056206.
Iterations: 0000000219  Current ticks: 0000056406.
Iterations: 0000000220  Current ticks: 0000056606.
Iterations: 0000000221  Current ticks: 0000056806.
Iterations: 0000000222  Current ticks: 0000057006.
Iterations: 0000000223  Current ticks: 0000057206.
Iterations: 0000000224  Current ticks: 0000057406.
: 0000000021  Current ticks: 0000004333.
 IterationIterations: 0000000226  Current ticks: 0000057820.
Iterations: 0000000227  Current ticks: 0000058020.
Iterations: 0000000228  Current ticks: 0000058220.
Iterations: 0000000229  Current ticks: 0000058420.
Iterations: 0000000230  Current ticks: 0000058620.
Iterations: 0000000231  Current ticks: 0000058820.
Iterations: 0000000232  Current ticks: 0000059020.
Iterations: 0000000233  Current ticks: 0000059220.
Iterations: 0000000234  Current ticks: 0000059420.
Iterations: 0000000235  Current ticks: 0000059620.
Iterations: 0000000236  Current ticks: 0000059820.
Iterations: 0000000237  Current ticks: 0000060020.
Iterations: 0000000238  Current ticks: 0000060220.
Iterations: 0000000239  Current ticks: 0000060420.
Iterations: 0000000240  Current ticks: 0000060620.
Iterations: 0000000241  Current ticks: 0000060820.
Iterations: 0000000242  Current ticks: 0000061020.
Iterations: 0000000243  Current ticks: 0000061220.
Iterations: 0000000244  Current ticks: 0000061420.
Iterations: 0000000245  Current ticks: 0000061620.
Iterations: 0000000246  Current ticks: 0000061820.
Iterations: 0000000247  Current ticks: 0000062020.
Iterations: 0000000248  Current ticks: 0000062220.
Iterations: 0000000249  Current ticks: 0000062420.
Iterations: 0000000250  Current ticks: 0000062620.
Iterations: 0000000251  Current ticks: 0000062820.
Iterations: 0000000252  Current ticks: 0000063020.
Iterations: 0000000253  Current ticks: 0000063231.
Iterations: 0000000254  Current ticks: 0000063431.
Iterations: 0000000255  Current ticks: 0000063631.
Iterations: 0000000256  Current ticks: 0000063831.
Iterations: 0000000257  Current ticks: 0000064031.
Iterations: 0000000258  Current ticks: 0000064231.
Iterations: 0000000259  Current ticks: 0000064431.
Iterations: 0000000260  Current ticks: 0000064631.
Iterations: 0000000261  Current ticks: 0000064831.
Iterations: 0000000262  Current ticks: 0000065031.
Iterations: 0000000263  Current ticks: 0000065231.
Iterations: 0000000264  Current ticks: 0000065431.
Iterations: 0000000265  Current ticks: 0000065631.
Iterations: 0000000266  Current ticks: 0000065831.
Iterations: 0000000267  Current ticks: 0000066031.
Iterations: 0000000268  Current ticks: 0000066231.
Iterations: 0000000269  Current ticks: 0000066431.
Iterations: 0000000270  Current ticks: 0000066631.
Iterations: 0000000271  Current ticks: 0000066831.
Iterations: 0000000272  Current ticks: 0000067035.
Iterations: 0000000273  Current ticks: 0000067235.
Iterations: 0000000274  Current ticks: 0000067435.
Iterations: 0000000275  Current ticks: 0000067635.
Iterations: 0000000276  Current ticks: 0000067835.
Iterations: 0000000277  Current ticks: 0000068036.
Iterations: 0000000278  Current ticks: 0000068236.
Iterations: 0000000279  Current ticks: 0000068436.
Iterations: 0000000280  Current ticks: 0000068636.
Iterations: 0000000281  Current ticks: 0000068836.
Iterations: 0000000282  Current ticks: 0000069036.
Iterations: 0000000283  Current ticks: 0000069236.
Iterations: 0000000284  Current ticks: 0000069436.
Iterations: 0000000285  Current ticks: 0000069636.
Iterations: 0000000286  Current ticks: 0000069836.
Iterations: 0000000287  Current ticks: 0000070036.
Iterations: 0000000288  Current ticks: 0000070236.
Iterations: 0000000289  Current ticks: 0000070441.
Iterations: 0000000290  Current ticks: 0000070641.
Iterations: 0000000291  Current ticks: 0000070841.
Iterations: 0000000292  Current ticks: 0000071041.
Iterations: 0000000293  Current ticks: 0000071241.
Iterations: 0000000294  Current ticks: 0000071441.
Iterations: 0000000295  Current ticks: 0000071641.
Iterations: 0000000296  Current ticks: 0000071841.
Iterations: 0000000297  Current ticks: 0000072041.
Iterations: 0000000298  Current ticks: 0000072241.
Iterations: 0000000299  Current ticks: 0000072441.
Iterations: 0000000300  Current ticks: 0000072643.
Iterations: 0000000301  Current ticks: 0000072843.
Iterations: 0000000302  Current ticks: 0000073043.
Iterations: 0000000303  Current ticks: 0000073243.
Iterations: 0000000304  Current ticks: 0000073443.
Iterations: 0000000305  Current ticks: 0000073643.
Iterations: 0000000306  Current ticks: 0000073843.
Iterations: 0000000307  Current ticks: 0000074043.
Iterations: 0000000308  Current ticks: 0000074243.
Iterations: 0000000309  Current ticks: 0000074443.
Iterations: 0000000310  Current ticks: 0000074643.
Iterations: 0000000311  Current ticks: 0000074843.
Iterations: 0000000312  Current ticks: 0000075043.
Iterations: 0000000313  Current ticks: 0000075243.
Iterations: 0000000314  Current ticks: 0000075443.
Iterations: 0000000315  Current ticks: 0000075643.
Iterations: 0000000316  Current ticks: 0000075843.
Iterations: 0000000317  Current ticks: 0000076043.
Iterations: 0000000318  Current ticks: 0000076243.
Iterations: 0000000319  Current ticks: 0000076450.
Iterations: 0000000320  Current ticks: 0000076650.
Iterations: 0000000321  Current ticks: 0000076850.
Iterations: 0000000322  Current ticks: 0000077050.
Iterations: 0000000323  Current ticks: 0000077250.
Iterations: 0000000324  Current ticks: 0000077450.
Iterations: 0000000325  Current ticks: 0000077650.
Iterations: 0000000326  Current ticks: 0000077850.
Iterations: 0000000327  Current ticks: 0000078050.
Iterations: 0000000328  Current ticks: 0000078250.
Iterations: 0000000329  Current ticks: 0000078450.
Iterations: 0000000330  Current ticks: 0000078650.
Iterations: 0000000331  Current ticks: 0000078850.
Iterations: 0000000332  Current ticks: 0000079050.
Iterations: 0000000333  Current ticks: 0000079250.
Iterations: 0000000334  Current ticks: 0000079450.
Iterations: 0000000335  Current ticks: 0000079650.
Iterations: 0000000336  Current ticks: 0000079856.
Iterations: 0000000337  Current ticks: 0000080056.
Iterations: 0000000338  Current ticks: 0000080256.
Iterations: 0000000339  Current ticks: 0000080456.
Iterations: 0000000340  Current ticks: 0000080656.
Iterations: 0000000341  Current ticks: 0000080856.
Iterations: 0000000342  Current ticks: 0000081056.
IteratioIterations: 0000000353  Current ticks: 0000083256.
ns: 0000000344  Current ticks: 0000081456.
Iterations: 0000000345  Current ticks: 0000081656.
Iterations: 0000000346  Current ticks: 0000081856.
Iterations: 0000000347  Current ticks: 0000082056.
Iterations: 0000000348  Current ticks: 0000082256.
Iterations: 0000000349  Current ticks: 0000082456.
Iterations: 0000000350  Current ticks: 0000082656.
Iterations: 0000000351  Current ticks: 0000082856.
Iterations: 0000000352  Current ticks: 0000083056.
00004333.
 Iterations: 0000000021  Current ticks: 0Iterations: 0000000354  Current ticks: 0000083456.
Iterations: 0000000355  Current ticks: 0000083656.
Iterations: 0000000356  Current ticks: 0000083856.
Iterations: 0000000357  Current ticks: 0000084056.
Iterations: 0000000358  Current ticks: 0000084256.
Iterations: 0000000359  Current ticks: 0000084457.
Iterations: 0000000360  Current ticks: 0000084657.
-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Interesting SD Sample Code Error

Postby aek » Sat Apr 24, 2010 10:41 pm

I provided test code and results to hcc-embedded, and they confirmed it is a bug in EFFS-THIN. I received the repair files from hcc-embedded, and now all three CSK distributions that support EFFS-THIN (/MSP430, /PIC24 and /dsPIC33) have updated releases that fix this problem, e.g.
Code: Select all
Pumpkin CubeSat Kit /MSP430 (PPM A1|A2|A3) CubeSat Kit SD\SD1 Application.

v1.1.0 built on Apr 24 2010 at 23:16:58.

Iterations: 0000000000  Current ticks: 0000000175.

Iterations: 0000000001  Current ticks: 0000000374.

Iterations: 0000000002  Current ticks: 0000000574.

Iterations: 0000000003  Current ticks: 0000000774.

Iterations: 0000000004  Current ticks: 0000000974.

Iterations: 0000000005  Current ticks: 0000001174.

Iterations: 0000000006  Current ticks: 0000001374.

Iterations: 0000000007  Current ticks: 0000001574.

Iterations: 0000000008  Current ticks: 0000001774.

Iterations: 0000000009  Current ticks: 0000001974.

Iterations: 0000000010  Current ticks: 0000002174.

Iterations: 0000000011  Current ticks: 0000002374.

Iterations: 0000000012  Current ticks: 0000002574.

Iterations: 0000000013  Current ticks: 0000002775.

Iterations: 0000000014  Current ticks: 0000002974.

Iterations: 0000000015  Current ticks: 0000003174.

Iterations: 0000000016  Current ticks: 0000003407.

Iterations: 0000000017  Current ticks: 0000003606.

Iterations: 0000000018  Current ticks: 0000003806.

Iterations: 0000000019  Current ticks: 0000004006.

Iterations: 0000000020  Current ticks: 0000004214.

Iterations: 0000000021  Current ticks: 0000004412.

Iterations: 0000000022  Current ticks: 0000004621.

Iterations: 0000000023  Current ticks: 0000004819.

Iterations: 0000000024  Current ticks: 0000005019.

Iterations: 0000000025  Current ticks: 0000005219.

Iterations: 0000000026  Current ticks: 0000005419.

Iterations: 0000000027  Current ticks: 0000005619.

Iterations: 0000000028  Current ticks: 0000005819.

Iterations: 0000000029  Current ticks: 0000006019.

Iterations: 0000000030  Current ticks: 0000006231.

Iterations: 0000000031  Current ticks: 0000006429.

Iterations: 0000000032  Current ticks: 0000006629.

Iterations: 0000000033  Current ticks: 0000006829.

Iterations: 0000000034  Current ticks: 0000007029.

Iterations: 0000000035  Current ticks: 0000007229.

Iterations: 0000000036  Current ticks: 0000007436.

Iterations: 0000000037  Current ticks: 0000007634.

Iterations: 0000000038  Current ticks: 0000007834.

Iterations: 0000000039  Current ticks: 0000008034.

Iterations: 0000000040  Current ticks: 0000008234.

Iterations: 0000000041  Current ticks: 0000008434.

Iterations: 0000000042  Current ticks: 0000008657.

Iterations: 0000000043  Current ticks: 0000008856.

Iterations: 0000000044  Current ticks: 0000009056.

Iterations: 0000000045  Current ticks: 0000009275.

Iterations: 0000000046  Current ticks: 0000009474.

Iterations: 0000000047  Current ticks: 0000009674.

Iterations: 0000000048  Current ticks: 0000009874.

Iterations: 0000000049  Current ticks: 0000010074.

Iterations: 0000000050  Current ticks: 0000010309.

Iterations: 0000000051  Current ticks: 0000010508.

Iterations: 0000000052  Current ticks: 0000010709.

Iterations: 0000000053  Current ticks: 0000010908.

Iterations: 0000000054  Current ticks: 0000011108.

Iterations: 0000000055  Current ticks: 0000011308.

Iterations: 0000000056  Current ticks: 0000011508.

Iterations: 0000000057  Current ticks: 0000011738.

Iterations: 0000000058  Current ticks: 0000011937.

Iterations: 0000000059  Current ticks: 0000012137.

Iterations: 0000000060  Current ticks: 0000012337.

Iterations: 0000000061  Current ticks: 0000012537.

Iterations: 0000000062  Current ticks: 0000012756.

Iterations: 0000000063  Current ticks: 0000012955.

Iterations: 0000000064  Current ticks: 0000013155.

Iterations: 0000000065  Current ticks: 0000013371.

Iterations: 0000000066  Current ticks: 0000013570.

Iterations: 0000000067  Current ticks: 0000013770.

Iterations: 0000000068  Current ticks: 0000013970.

Iterations: 0000000069  Current ticks: 0000014170.

Iterations: 0000000070  Current ticks: 0000014370.

Iterations: 0000000071  Current ticks: 0000014570.

Iterations: 0000000072  Current ticks: 0000014770.

Iterations: 0000000073  Current ticks: 0000014970.

Iterations: 0000000074  Current ticks: 0000015170.

Iterations: 0000000075  Current ticks: 0000015370.

Iterations: 0000000076  Current ticks: 0000015570.

Iterations: 0000000077  Current ticks: 0000015770.

Iterations: 0000000078  Current ticks: 0000015970.

Iterations: 0000000079  Current ticks: 0000016170.

Iterations: 0000000080  Current ticks: 0000016381.

Iterations: 0000000081  Current ticks: 0000016580.

Iterations: 0000000082  Current ticks: 0000016780.

Iterations: 0000000083  Current ticks: 0000016980.

Iterations: 0000000084  Current ticks: 0000017180.

Iterations: 0000000085  Current ticks: 0000017380.

Iterations: 0000000086  Current ticks: 0000017580.

Iterations: 0000000087  Current ticks: 0000017780.

Iterations: 0000000088  Current ticks: 0000017980.

Iterations: 0000000089  Current ticks: 0000018180.

Iterations: 0000000090  Current ticks: 0000018380.

Iterations: 0000000091  Current ticks: 0000018580.

Iterations: 0000000092  Current ticks: 0000018780.

Iterations: 0000000093  Current ticks: 0000018980.

Iterations: 0000000094  Current ticks: 0000019180.

Iterations: 0000000095  Current ticks: 0000019398.

Iterations: 0000000096  Current ticks: 0000019597.

Iterations: 0000000097  Current ticks: 0000019797.

Iterations: 0000000098  Current ticks: 0000019997.

Iterations: 0000000099  Current ticks: 0000020197.

Iterations: 0000000100  Current ticks: 0000020397.

Iterations: 0000000101  Current ticks: 0000020633.

Iterations: 0000000102  Current ticks: 0000020832.

Iterations: 0000000103  Current ticks: 0000021032.

Iterations: 0000000104  Current ticks: 0000021232.

Iterations: 0000000105  Current ticks: 0000021432.

Iterations: 0000000106  Current ticks: 0000021632.

Iterations: 0000000107  Current ticks: 0000021832.

Iterations: 0000000108  Current ticks: 0000022032.

Iterations: 0000000109  Current ticks: 0000022232.

Iterations: 0000000110  Current ticks: 0000022432.

Iterations: 0000000111  Current ticks: 0000022632.

Iterations: 0000000112  Current ticks: 0000022832.

Iterations: 0000000113  Current ticks: 0000023032.

Iterations: 0000000114  Current ticks: 0000023232.

Iterations: 0000000115  Current ticks: 0000023452.

Iterations: 0000000116  Current ticks: 0000023651.

Iterations: 0000000117  Current ticks: 0000023851.

Iterations: 0000000118  Current ticks: 0000024051.

Iterations: 0000000119  Current ticks: 0000024251.

Iterations: 0000000120  Current ticks: 0000024451.

Iterations: 0000000121  Current ticks: 0000024651.

Iterations: 0000000122  Current ticks: 0000024851.

Iterations: 0000000123  Current ticks: 0000025051.

Iterations: 0000000124  Current ticks: 0000025258.

Iterations: 0000000125  Current ticks: 0000025457.

Iterations: 0000000126  Current ticks: 0000025657.

Iterations: 0000000127  Current ticks: 0000025889.

Iterations: 0000000128  Current ticks: 0000026088.

Iterations: 0000000129  Current ticks: 0000026288.

Iterations: 0000000130  Current ticks: 0000026488.

Iterations: 0000000131  Current ticks: 0000026688.

Iterations: 0000000132  Current ticks: 0000026888.

Iterations: 0000000133  Current ticks: 0000027088.

Iterations: 0000000134  Current ticks: 0000027288.

Iterations: 0000000135  Current ticks: 0000027488.

Iterations: 0000000136  Current ticks: 0000027688.

Iterations: 0000000137  Current ticks: 0000027888.

Iterations: 0000000138  Current ticks: 0000028088.

Iterations: 0000000139  Current ticks: 0000028288.

Iterations: 0000000140  Current ticks: 0000028488.

Iterations: 0000000141  Current ticks: 0000028688.

Iterations: 0000000142  Current ticks: 0000028888.

Iterations: 0000000143  Current ticks: 0000029088.

Iterations: 0000000144  Current ticks: 0000029288.

Iterations: 0000000145  Current ticks: 0000029488.

Iterations: 0000000146  Current ticks: 0000029688.

Iterations: 0000000147  Current ticks: 0000029890.

Iterations: 0000000148  Current ticks: 0000030089.

Iterations: 0000000149  Current ticks: 0000030289.

Iterations: 0000000150  Current ticks: 0000030489.

Iterations: 0000000151  Current ticks: 0000030689.

Iterations: 0000000152  Current ticks: 0000030889.

Iterations: 0000000153  Current ticks: 0000031089.

Iterations: 0000000154  Current ticks: 0000031289.

Iterations: 0000000155  Current ticks: 0000031489.

Iterations: 0000000156  Current ticks: 0000031689.

Iterations: 0000000157  Current ticks: 0000031910.

Iterations: 0000000158  Current ticks: 0000032109.

Iterations: 0000000159  Current ticks: 0000032309.

Iterations: 0000000160  Current ticks: 0000032509.

Iterations: 0000000161  Current ticks: 0000032709.

Iterations: 0000000162  Current ticks: 0000032937.

Iterations: 0000000163  Current ticks: 0000033136.

Iterations: 0000000164  Current ticks: 0000033336.

Iterations: 0000000165  Current ticks: 0000033536.

Iterations: 0000000166  Current ticks: 0000033736.

Iterations: 0000000167  Current ticks: 0000033936.

Iterations: 0000000168  Current ticks: 0000034136.

Iterations: 0000000169  Current ticks: 0000034336.

Iterations: 0000000170  Current ticks: 0000034536.

Iterations: 0000000171  Current ticks: 0000034736.

Iterations: 0000000172  Current ticks: 0000034942.

Iterations: 0000000173  Current ticks: 0000035141.

Iterations: 0000000174  Current ticks: 0000035341.

Iterations: 0000000175  Current ticks: 0000035541.

Iterations: 0000000176  Current ticks: 0000035762.

Iterations: 0000000177  Current ticks: 0000035961.

Iterations: 0000000178  Current ticks: 0000036161.

Iterations: 0000000179  Current ticks: 0000036361.

Iterations: 0000000180  Current ticks: 0000036561.

Iterations: 0000000181  Current ticks: 0000036761.

Iterations: 0000000182  Current ticks: 0000036961.

Iterations: 0000000183  Current ticks: 0000037161.

Iterations: 0000000184  Current ticks: 0000037361.

Iterations: 0000000185  Current ticks: 0000037561.

Iterations: 0000000186  Current ticks: 0000037761.

Iterations: 0000000187  Current ticks: 0000037961.

Iterations: 0000000188  Current ticks: 0000038164.

Iterations: 0000000189  Current ticks: 0000038363.

Iterations: 0000000190  Current ticks: 0000038563.

Iterations: 0000000191  Current ticks: 0000038786.

Iterations: 0000000192  Current ticks: 0000038985.

Iterations: 0000000193  Current ticks: 0000039185.

Iterations: 0000000194  Current ticks: 0000039385.

Iterations: 0000000195  Current ticks: 0000039585.

Iterations: 0000000196  Current ticks: 0000039785.

Iterations: 0000000197  Current ticks: 0000039985.

Iterations: 0000000198  Current ticks: 0000040185.

Iterations: 0000000199  Current ticks: 0000040385.

Iterations: 0000000200  Current ticks: 0000040585.

Iterations: 0000000201  Current ticks: 0000040785.

Iterations: 0000000202  Current ticks: 0000040985.

Iterations: 0000000203  Current ticks: 0000041185.

Iterations: 0000000204  Current ticks: 0000041385.

Iterations: 0000000205  Current ticks: 0000041585.

Iterations: 0000000206  Current ticks: 0000041785.

Iterations: 0000000207  Current ticks: 0000041985.

Iterations: 0000000208  Current ticks: 0000042185.

Iterations: 0000000209  Current ticks: 0000042385.

Iterations: 0000000210  Current ticks: 0000042585.

Iterations: 0000000211  Current ticks: 0000042800.

Iterations: 0000000212  Current ticks: 0000042999.

Iterations: 0000000213  Current ticks: 0000043199.

Iterations: 0000000214  Current ticks: 0000043399.

Iterations: 0000000215  Current ticks: 0000043599.

Iterations: 0000000216  Current ticks: 0000043799.

Iterations: 0000000217  Current ticks: 0000044006.

Iterations: 0000000218  Current ticks: 0000044205.

Iterations: 0000000219  Current ticks: 0000044405.

Iterations: 0000000220  Current ticks: 0000044605.

Iterations: 0000000221  Current ticks: 0000044805.

Iterations: 0000000222  Current ticks: 0000045005.

Iterations: 0000000223  Current ticks: 0000045205.

Iterations: 0000000224  Current ticks: 0000045405.

Iterations: 0000000225  Current ticks: 0000045605.

Iterations: 0000000226  Current ticks: 0000045805.

Iterations: 0000000227  Current ticks: 0000046005.

Iterations: 0000000228  Current ticks: 0000046205.

Iterations: 0000000229  Current ticks: 0000046405.

Iterations: 0000000230  Current ticks: 0000046605.

Iterations: 0000000231  Current ticks: 0000046805.

Iterations: 0000000232  Current ticks: 0000047024.

Iterations: 0000000233  Current ticks: 0000047223.

Iterations: 0000000234  Current ticks: 0000047423.

Iterations: 0000000235  Current ticks: 0000047623.

Iterations: 0000000236  Current ticks: 0000047824.

Iterations: 0000000237  Current ticks: 0000048023.

Iterations: 0000000238  Current ticks: 0000048223.
-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Interesting SD Sample Code Error

Postby aek » Sat May 01, 2010 6:00 am

New releases of the CubeSat Kit EFFS-THIN software have been posted online -- they incorporate the fixes that hcc-embedded added to v1.92 to address this issue ... all users should upgrade to this version.
-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Interesting SD Sample Code Error

Postby linkinpark32123 » Thu Dec 16, 2010 11:34 am

I have a question regarding the sd sample code online. I am using

int hour, min, sec in my main.c code and extend them so that other code can use them.

i make a
#define STR_CLOCK "%02i:%02i:02i"

sprintf(strTmp, STR_CLOCK, hour, min, sec)

inside the body of the task_sd_append file from the sample code online. Every time i run the code it locks up. I was doing some research online and it was saying that if sprintf overflows its buffer it will lock up. I didnt change the strTmp[256] in int main from the original sample code, though i did try and increase to 512 to see if that would fix my problem.

if i change the code to so that only two variables are included:

#define STR_CLOCK "%02i:%02i"

sprintf(strTmp, STR_CLOCK, min, sec)

it will run and i see the clock changing. Also i tried to print the hours first then the min and sec separately. They each print when the other is commented out but if both are run together than it still locks up.

How can i fix this problem?
linkinpark32123
 
Posts: 6
Joined: Thu Dec 16, 2010 11:12 am

Re: Interesting SD Sample Code Error

Postby aek » Thu Dec 16, 2010 11:48 am

Dunno .. we print _much_longer strings without problems.

You shoud look at strTmp[] in the debugger and see what's happening -- you may be using a different strTmp than you think.

Also, sprintf() uses the stack to pass parameters ... if your stack is not big enough, this could also be a problem.

Make sure you're not using an incompatible optimizations (especially with Rowley ).
-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to TI's MSP430

Who is online

Users browsing this forum: No registered users and 2 guests

cron