This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Keil FFS + RTX

Hello,

I want to use the Keil RTX and the FFS on a STR9.

My problem is:
Without RTX, my example code works.
With RTX it works not.

My Code:

    if(0 == finit())
    {
        char acBuffer[100] = {0};
        int rv;
        // Test-Code -Begin
        fFileStream = fopen("TEST7.TXT", "r");
        rv = fread(acBuffer, sizeof(char), 100, fFileStream);
        fclose(fFileStream);

        fFileStream = fopen("TEST7.TXT", "w");
        rv = fwrite("Hello World!", 1, 12, fFileStream);
        fclose(fFileStream);
        // Test-Code -End
    }


The first part reads out the file and can verify my write commands (the second part).

If I call this code before the RTOS starts, everything works perfect. But if I call this code within a task (At this point only one task is running) the fopen("...", "w") method returns a NULL pointer. A call with fopen("...", "a") returns me a valid pointer but by data bytes are not written. If I open the file in the next turn fread() returns the written size, but all of the read data are 0.

Even when I call the ffind() method, my program runs into the data abort handler.

What I have done:
- Heap size: 0x0000 1000
- Task Stack Size: 800 Bytes

What have I forgotten?

0