Topic: Using FreeRTOS-FAT as user filesystem

As the title suggests I'm trying to use the FreeRTOS-FAT file system as a user provided filesystem for a ssh/scp server built with wolfssl/ssh.

I'm struggling to source the WOPENDIR, WREADDIR, WCLOSEDIR functions as equivalents are not provided in FreeRTOS-FAT as far as I can tell.

Does anyone have some good suggestions on how to get around this issue? Are these functions required? I noticed there is a WOLFSSH_NO_DIR option, but I'm not sure what the implications are when using a filesystem, and if it's useful for solving this issue. 

Any help/tips would be very much appreciated.

Share

Re: Using FreeRTOS-FAT as user filesystem

I have been working with a project that is using FreeRTOS and FatFS, and we are using the functions f_opendir(), f_readdir(), and f_closedir() found in the file ff.c. I believe that project is using release R0.14 of FatFS.

Setting the flag NO_WOLFSSH_DIR will disable the SFTP commands used to open directories and get listings. You should be able to get and put, but I don't think ls will work.

Re: Using FreeRTOS-FAT as user filesystem

Hi John. Thanks for your response.

john wrote:

I have been working with a project that is using FreeRTOS and FatFS, and we are using the functions f_opendir(), f_readdir(), and f_closedir() found in the file ff.c. I believe that project is using release R0.14 of FatFS.

We are not using FatFS but a filesystem provided by FreeRTOS.

https://www.freertos.org/FreeRTOS-Plus/ … index.html

Setting the flag NO_WOLFSSH_DIR will disable the SFTP commands used to open directories and get listings. You should be able to get and put, but I don't think ls will work.

Sorry I'm not following you here. Do you know if this would affect SSH or SCP, and would it remove the requirement for the functions I cannot source?

Share

Re: Using FreeRTOS-FAT as user filesystem

Whoops. I understand now. I haven't looked at the FAT filesystem that comes with FreeRTOS, but I'm looking now. It follows the pattern that Win32 uses for examining directories, not POSIX. You use ff_findfirst() and ff_findnext() to query the file system for entries in the directory table.

The directory functions are used to get directory listings. The functions that open files for reading or writing take the path string they are given and use that. I think SCP should work with NO_WOLFSSH_DIR. It isn't going affect SSH shells.

Re: Using FreeRTOS-FAT as user filesystem

Thanks for the help, John. I now have our filesystem successfully working with ssh and scp by using the NO_WOLFSSH_DIR option.

Share