Sample program EFFS-BASIC

Discussion to talk about software related topics only.
Post Reply
SeeCwriter
Posts: 630
Joined: Mon May 12, 2008 10:55 am

Sample program EFFS-BASIC

Post by SeeCwriter »

I trying to run the EFFS-BASIC sample program on a NANO54415. I'm using v2.6.7 of NBEclipse. I have a 1Gb microSD chip plugged into the microSD socket.

The first library call fails:

rv = f_getfreespace( EXT_FLASH_DRV_NUM, &space );

with error F_ERR_TASKNOTFOUND.

I have no idea what that means.
SeeCwriter
Posts: 630
Joined: Mon May 12, 2008 10:55 am

Re: Sample program EFFS-BASIC

Post by SeeCwriter »

So, the first time through the program, it works. When I move the start of the while loop in usermain() from just spinning on a 1-second delay to the just before DisplayEffsSpaceStats(), so that it repeatedly runs through the SD card test once a second, it fails. Is that because I have to call f_enterFS() (which the comments say call once) and/or InitExtFlash() again with each loop?

Steve
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Sample program EFFS-BASIC

Post by rnixon »

Does the unmodified example work correctly?
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: Sample program EFFS-BASIC

Post by dciliske »

umm... you only need to call f_enterFS() once. However, you must do this AFTER the last call to OSChangePrio in the task. Also, there is a maximum number of tasks that can be registered at a time (I believe that the default is 5 or 10). InitExtFlash() should also only be called once.

If you're still having the issue, would you mind posting your relevant startup code?

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
ecasey
Posts: 164
Joined: Sat Mar 26, 2011 9:34 pm

Re: Sample program EFFS-BASIC

Post by ecasey »

If you simply moved the "do while()" to before "DisplayEffsSpaceStats()" in the "EFFS-BASIC" example program, then it should behave just as you said: on the first loop, it runs DisplayEffsSpaceStats(), and that works; it then unmounts the file drive with "UnmountExtFlash();" and closes the file system with "fs_close();". On the next time through the loop, there is no drive or file system to process and so you get the error.

Try copying "DisplayEffsSpaceStats();" and "DumpDir();" into the loop just before the OSTimeDly(...) line. That way the file system stays open.

Ed
Post Reply