trouble while mounting fat partition using ucos2.lib with RCM4050

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

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

2 Likes

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?

I’d start a new question as otherwise it gets confusing…