EFFS SD Card Writing problem.

Discussion to talk about hardware related topics only.
Post Reply
amurphysmu
Posts: 1
Joined: Fri May 16, 2008 7:59 am

EFFS SD Card Writing problem.

Post by amurphysmu »

I have some custom hardware with a SD card slot on it. I've
connected the SD card in the same way that it is connected on the
Netburner Devlopment Boards.

I've created a project using the EFFS-FTP example code to test, and
can read data from the SD card, but can't seem to write data to it.

This is what is happening on boot:

Waiting 2sec to start 'A' to abort
Configured IP = 192.168.2.10
Configured Mask = 255.255.255.0
MAC Address= 00:03:f4:02:d6:2d

===== Starting HydroTestFixture Program =====
FAT mount to SD/MMC successful
SD/MMC drive change successful
Current time: Wed Jun 14 11:35:00 2006

Formatted time string: 11:35:00 AM

Retrieving external flash usage...
Flash card memory usage (bytes):
252837888 total, 252493824 free, 344064 used, 0 bad
Found File [TESTFILE.TXT] : 75 Bytes
Found File [HISTORY.TXT] : 655 Bytes
Found File [RED] : 14445 Bytes
Found File [BLUE] : 13818 Bytes
Found File [INTRO] : 32835 Bytes
Found File [NOTE] : 24058 Bytes
Found File [ACT] : 17102 Bytes
Found File [CALL] : 25704 Bytes
Found File [DE] : 17763 Bytes
Found File [DONE] : 29048 Bytes
Found File [INT] : 35317 Bytes
Found File [TEST.TXT] : 28 Bytes

Creating test file: TestFile.txt

*** Error opening file "TestFile.txt", fp = 0
Started FTP Server
You can use Internet Explorer to drag and drop files to
url "ftp://192.168.2.10"

Long file names are not supported- only 8.3 format

It seems like that card is somehow read only since the TestFile.txt
file can't be written to the card. The SD card is not locked. Any
ideas??
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: EFFS SD Card Writing problem.

Post by rnixon »

If you run your project on the NetBurner development board (not your own hardware) does your project work?
lpeason
Posts: 1
Joined: Mon Jun 16, 2008 1:18 pm

Re: EFFS SD Card Writing problem.

Post by lpeason »

I too encountered this problem. I've been using the EFFS SD Card on our custom hardware and on the development boards without any problem. As soon as I upgraded to NNDK 2.1 RC4a the call to get_wp() always returned TRUE. I commented out that call and I was able to read the card, but unable to write it.
kevinburtness
Posts: 6
Joined: Thu May 29, 2008 8:12 am

Re: EFFS SD Card Writing problem.

Post by kevinburtness »

Using a MOD5282 with a netburner carrier board I have been trying to initialize and mount an SD card and keep getting
the same return code of 37. Initially I call the get_cd() and get_wp() functions and get nominal results. When I call f_mountfat() and f_chdrive(), I get the 37 return code.

It looks like return code 37 represents "F_ERR_TASKNOTFOUND".

Has anyone run into this? Any suggestions?

The lines of code in question are:

mountResult = f_mountfat(MMC_DRV_NUM, mmc_initfunc, F_MMC_DRIVE0);
mountResult = f_chdrive( MMC_DRV_NUM );

In both cases I get a result of 37.

Thanks,

Kevin
seulater
Posts: 445
Joined: Fri Apr 25, 2008 5:26 am

Re: EFFS SD Card Writing problem.

Post by seulater »

I am using the code below on my 5282 and the cards work fine for me.

Code: Select all

//*******************************************************    
//	 Initalize & Mount Card 
//*******************************************************
	
	do{	
	
		// Card detection check
   		if ( get_cd() == 0 )
   		{
			LCD_Cls();
			printlcdauto("NO MMC CARD",LINE_3);
	
			while ( get_cd() == 0 )
			{
				printlcdauto("Insert Card",LINE_5);
				OSTimeDly( TICKS_PER_SECOND / 2 );
				printlcdauto("           ",LINE_5);
				OSTimeDly( TICKS_PER_SECOND /2 );				
			}

			LCD_Cls();
			printlcdauto("CARD DETECTED",LINE_3);
			printlcdauto("FINISHING BOOT.",LINE_5);
   		}

		OSTimeDly( TICKS_PER_SECOND );	
		// Card Write Protect check
		if ( get_wp() !=0x00 )
		{
			LCD_Cls();
			printlcdauto("MMC WP IS ON",LINE_3);	
	
			while ( get_wp() )
			{
				printlcdauto("Disable WP",LINE_5);
				OSTimeDly( TICKS_PER_SECOND / 2 );
				printlcdauto("           ",LINE_5);
				OSTimeDly( TICKS_PER_SECOND /2 );				
   			}	

			LCD_Cls();
			printlcdauto("WP NOW ENABLED.",LINE_3);
			printlcdauto("FINISHING BOOT.",LINE_5);
		}
		
		
	}while( ( get_cd() == 0 ) || ( get_wp() !=0x00 ) );

   /* The following call to f_enterFS() must be called in every task that accesses
      the file system.  This must only be called once in each task and must be done before 
      any other file system functions are used.  Up to 10 tasks can be assigned to use
      the file system. Any task may also be removed from accessing the file system with a 
      call to the function f_releaseFS(). */
	f_enterFS(); 
   	// We now must also enter the file system for the FTP task
	OSChangePrio( FTP_PRIO );

   	f_enterFS(); 
	OSChangePrio( MAIN_PRIO );
   
   	error = InitExtFlash();  // Initialize the CFC or SD/MMC external flash drive

	if( error == MMC_ERROR )				// this init must be done before the tasks start!!!
	{
		LCD_Cls();
		printlcdauto("STORAGE MEDIA BAD",LINE_4);
		OSTimeDly( TICKS_PER_SECOND * 3 );
		CriticalError(MMC_ERROR);
	}
	

	DisplayEffsSpaceStats();  // Display file space usage
	OSTimeDly( TICKS_PER_SECOND * 5 );
Post Reply