This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTFS and TASK priority

I am testing the rtfs mmcsd sample on c6748 .

I set the task priority to 4 in mmcsdSample.tcf.

Void task(Arg id_arg)
{

... ...
    result = getdriveid(BFS_DEVICE_TYPE_MMC, 1 , 0, driveId); //<-- return -1; why?
... ...

}

I even test the task priority from 1 to 15。only priority 1 and 2 work well。

somebody help me??

  • Jianguo,

    It sounds like a timeout error is occurring.  We can have someone look into this further, but why are you trying to lower the priority in the first place?

    Dave

  • Hi David,

    getdriveid function only worked when task priority is 1 or 2,

    so if task priority > 2,  I have to do like following.

    Void task(Arg id_arg)
    {

    ... ...
        int oldprio = TSK_setpri(TSK_self(), 1);//<-- or 2
        result = getdriveid(BFS_DEVICE_TYPE_MMC, 1 , 0, driveId); //<-- this works well
        TSK_setpri(TSK_self(), oldprio);

    ... ...

    }

    other RTFS functions worked ok.

  • Hi jianguo yu,

    The RTFS works with the PSP's Block Media driver.  There is a task called "Blkmedia_Task" which is responsible for some hardware set up and other initialization.  This task is intertwined with RTFS initialization as well.

    The Blkmedia_Task has a priority of 2.  I suspect that when you set your application task (the one that calls getdriveid()) to have a priority greater than 2, this is causing your application task to run *before* the Blkmedia_Task.  In result, the proper initialization hasn't completed and is causing getdriveid to fail.

    If you configure your application task to have a priority less than or equal to the priority of the Blockmedia_Task, you should be OK.

    Steve

  • Hi Steven,

    I see.

    thanks a lot.

    Jianguo