Problems with Reading and Writing Files Using FreeRTOS-FAT_SL

paultsai111 wrote on Thursday, July 28, 2016:

Hi FreeRTOS Forum Members:

Here is one question about testing the FreeRTOS Codes,

The main problem is when calling the f_getcwd() ,

the Evaulation Board Output Terminal will show the fatal exceptions(28)

Before testing the output, all of the codes compile well with no problems.

So can anybody give me some hint or advices about this questions?

rtel wrote on Thursday, July 28, 2016:

Grep’ing the source code for “28” I see it defined as “F_ERR_ALLOCATION”.

Other than that, place a break point on your call to f_getcwd(), then
step through the code from there, until you find the code that is
generating the error.

paultsai111 wrote on Thursday, July 28, 2016:

After inserting the break point printf(“string\n”) into the f_getcwd()(the same as fn_get_cwd()) , the output terminal does not enter this f_getcwd() and shows any breakpoint informations. I guess one thing is that This read / write code too big, so the mcu system can not afford this . Another guess is that I changed one type of variables. The yellow marked parts is that I changed from “BaseType_t” to “int”.
I do not know why should defined this BaseType_t, because I think it is only a number. When Compiling, it shows you havn’t defined. So for me, I used Xtensla 32 bit CPU for my board. Should I defined the
BaseType_t as shown below ?
Note: The modified souce code of Sample Read Write Demo Code from as shown in the attached files.!
#define BaseType_t 32;

davedoors wrote on Thursday, July 28, 2016:

BaseType_t is defined in every port layer, so probably 30 or more different definitions in the FreeRTOS source, did you look at any of those? I guess not because you would see its not a number.

It must be defined anyway, otherwise FreeRTOS would not compile.

paultsai111 wrote on Thursday, July 28, 2016:

Ya, After Finding the freertos portmacro.h, there are severval port definitions, and I also include , and compile with no problem, However, the same problem always encouter . fatal exception(28) is always shown on my com terminals. SPIFF File System Read /Write that ESP9266 WiFi SOC Chip provided is used as an example for us to be shown. I do not know what exactly FreeRTOS use which kind of File System Operation to do. But I guess, due to the limitation of Memory Size, The ESP8266 can not afford this kind of data read /write operation that FreeRTOS provided.So, Maybe oneday you can provdi Xtensia CPU in ESP8266 suitable Codes for Use