Home/Support/Support Forum/trouble while mounting fat partition using ucos2.lib with RCM4050
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

trouble while mounting fat partition using ucos2.lib with RCM4050

0 votes
Hi All,

I'm trying to use ucos2.lib for a simple http + ftp server.
All works fine if i do not use the rtos, but only by adding

#use uncos2.lib

to my files and the program crashes at

fat_AutoMount(FDDF_USE_DEFAULT);

Yes, only if i add the "#use uncos2.lib" macro! even if i not call any function of the rtos (like OSInit etc..)!

any idea about the cause of the problem?

Thank you
asked May 12, 2016 in Rabbit by ElettroAle New to the Community (3 points)
edited May 12, 2016 by ElettroAle

Please log in or register to answer this question.

2 Answers

+2 votes
 
Best answer
Have you followed the instructions in the documentation for using FAT and UC/OS II?

uC/OS-II USERS:
* The FAT API is not reentrant from multiple tasks. If you wish to
use the FAT from multiple uC/COS tasks, #define FAT_USE_UCOS_MUTEX.
* Mutex timeouts or other mutex errors will cause a run-time
error - ERR_FAT_MUTEX_ERROR. The default mutex timeout is 5 seconds
and can changed by #define'ing a different value
for FAT_MUTEX_TIMEOUT_SEC
* You MUST call fat_InitUCOSMutex after calling OSInit() and before
calling FAT API functions
* You must run the FAT in blocking mode (#define FAT_BLOCK)
* You must not call low-level, non-API FAT or write-through cache
functions. Only call FAT functions appended with 'fat_' and
with public function descriptions.

Regards,
Peter
answered May 13, 2016 by petermcs Veteran of the Digi Community (1,130 points)
selected May 17, 2016 by ElettroAle
0 votes
Thanks Peter, I had missed! Now the filsystem it's mounted properly.

Now I've a new trouble with FTP, (i don't know if i can ask about it in the same topic)

Using filezilla, the FTP server works very fine if i upload simple .txt files, however when i try to upload something like a pdf or a zip file, the transfer freezes at 100% and the transfer it's marked as not completed.

It may be due to the TCP buffer length? Or to the stack size of the task?
answered May 17, 2016 by ElettroAle New to the Community (3 points)
edited May 17, 2016 by ElettroAle
I'd start a new question as otherwise it gets confusing...
...