Page 1 of 1
Sample program EFFS-BASIC
Posted: Fri Jul 25, 2014 2:31 pm
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.
Re: Sample program EFFS-BASIC
Posted: Fri Jul 25, 2014 2:52 pm
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
Re: Sample program EFFS-BASIC
Posted: Fri Jul 25, 2014 3:50 pm
by rnixon
Does the unmodified example work correctly?
Re: Sample program EFFS-BASIC
Posted: Fri Jul 25, 2014 3:56 pm
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
Re: Sample program EFFS-BASIC
Posted: Sun Jul 27, 2014 4:56 pm
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