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.

Problem in dda_mmcsdBios.c

Expert 2370 points
Other Parts Discussed in Thread: OMAPL138

Hi,

I am using OMAP-L138 EVM along with UI board to sample signals using A/D converter and my intention is to write sampled data to SD card having file system. I have working RTFS based MMCSD code to write data to SD card and BSL based UPP code to sample signals, respectively.

When I add BSL based code with RTFS based project, it compiles fine but doesn't work. I have debugged the code and found out that it doesn't execute the code given below in bold. I mean after executing this line, it doesn't come back and kept running somewhere I don't know and project never executes afterwards. When I run only RTFS based MMCSD code, this line executes and pointer comes back to another 'if' given just below the bold condition and project executes successfully. Therefore, I think, this line has some problem which doesn't let merged projects to work properly. 

if (TRUE != SEM_pend(gMmcsdCallbackSem, SYS_FOREVER))
{
MMCSD_ERR_DEBUG(("\r\n MMCSD: Sem gMmcsdCallbackSem "
"Take failed"));
}

if (gMmcsdDetectError != 0)
{
MMCSD_DRV_DEBUG(("\r\n MMCSD: Card init. failed"));
result = gMmcsdDetectError;

blkEventInfo.EventId = PSP_BLK_EVT_MEDREM;
blkEventInfo.EvtData = \
&gMmcsdDdaObj[instanceId].blkDrvInfo;

I have no idea what's wrong. Can anyone please help me debugging the cause of this problem ?

I appreciate your help.

Thanks.

BAS

  • What is this "BSL based code"?  Help me understand what the difference between having this BSL code and not having it.

    Judah

  • Board Support Library (BSL) code provided by LogicPD to exercise different peripherals. I am using the code for UPP to sample signals using A/D converter attached to the UI board.

    -Bashir

  • How is it being using in conjuction with the RTFS code?

    The code that you says doesn't comeback...well its a Semaphore pend call.  Which will block so the execution should go somewhere else.  The question is, where is it going and why does it not comeback here.  It could very well be that when you add the BSL code, the behaviour of your program changes.  Without additional information on what is happening, I cannot tell what's going on.  Did you look at KOV?  Maybe you are blowing your stack when the BSL code is added?

    What function is getting executed after the SEM_pend()?  Do you ever see a SEM_post()?  I would think without the BSL code, you should see a SEM_post() get executed.

    Judah

  • RTFS code make a file system to MMCSD card then creates file to write data over it. BSL code is being used to transfer sampled values from uPP.

    I know while adding both projects, behaviour of my program changes but I don't know why and how. I have very little knowledge about Semaphore but i will check tomorrow and get back to you with as much information as I can.

    I wil also attach whole project which might help to debug it.

    Thanks.

    -BAS

  • Judah,

    5315.evm6748_BAS.zip

    I couldn't figure out What could be wrong. Can you please have a look on my project attached here. I am already trying to solve this issue over a month now.

    Software packages I am using:

    edma3_lld_01_11_01_04

    rtfs_1_10_02_32

    bios_5_41_07_24

    pspdrivers_01_30_01

    I will highly appreciate your help.

    Thanks.

    BAS

  • BAS,

    I took a look at your project but nothing really jumped out at me.  I was trying to find the code where you said you had a problem but I didn't see that either.

    I think you need to step through your code and figure out what's the difference with BSL in your project and without BSL.

    1.  When you don't have the BSL code in your project, what happens when you execute the SEM_pend()?  Where does execution go?

    2. When you do have BSL, what happens in this case?

    3.  Is the problem easily reproducible and does it always fail at the same spot?

    4.  Is your executable something that I can run on an OMAPL138 board?  Is there something special I need to do?

    Judah

  • 4606.MMCSD_BAS.zip

    Judah,

    Sorry I couldn't get back to you earlier.

    I am attaching zip file where you can find 2 snapshot, one without BSL code and with BSL code. There you can see where the execution goes with or without BSL code. There is also note attached to each snap describing the nature of the snapshot. You can also see KNL, SEM and TSK status before and after the execution of SEM_pend.

    Now answer to your queries.

    3. Problem is always there when merging the code with BSL.

    4. You should be able to run RFTS and BSL code on OMAPL138 board. BSL code work even without UI board.

    First 6 snapshots of the file ''withBSL' shows how to get to the problem where you couldn't yourself. In the snapshot 4, you have to execute the code all the way to the end to find the function given below,

    result = PSP_mmcsdCheckCard(&cardType, instanceId);

    after executing that line you will get to snapshot 5, keep executing until line # 899 as shown in snapshot 6, there you can see SEM_pend. This statement never comes back in case of BSL merged code and comes back to if statement given at line # 905 in case of non-BSL code.

    I appreciate your help and I am really hopeful to have some good news from your side.

    Thanks.

    BAS

  • Judah, 

    Can you kindly help me with this ?

    Thanks.

    BAS