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.

Debugging the MessageQ Application, Built in Linux EZSDK, Debugged in Windows CCS 4

Guru 10685 points


Continued thread from:

http://e2e.ti.com/support/dsp/integra_dsparm/f/625/p/109185/400422.aspx#400422

MugdhaK said:

The picture of the debug window you showed is good ... it means that the DSP is up and blocked on something (in Idle task). It does show that symbols have been properly loaded, otherwise you would not have seen what you've shown here. If you want to debug something in your application after this, you may want to now open your application source file in CCS, put a breakpoint in your application (that comes after whatever you've been waiting on is unblocked), and proceed further from Linux-side -- run whatever you need to run to start communicating with the DSP.

You should see the breakpoint getting hit. If your symbols are loaded correctly, you will be able to set a breakpoint. Otherwise the breakpoint setting itself will fail.

If you want to debug before you reach the idle task, you'll have to stop somewhere ealier in your application. The way we do it is to add the following in main (say after Ipc_start) or in our application task, essentially wherever we want to debug from.

{

volatile int haltIt = 1;

while (haltIt);

}

Then when I connect to DSP and load symbols, if I've set my source lookup correctly, this file will open in CCS, and I will see that I'm spinning here. I just go ahead and change the value of 'haltIt' to 0 in watch window and then step through. At that point, I can set break-points anywhere I want, or even step through all the way if I so wish.

Making haltIt volatile ensures that if you're in release build with symbols, the compiler won't optimize out all the code after this, and also using a variable ensures that you can safely move ahead by changing the value in watch window (instead of directly using while (1)).

Regards,
Mugdha

 

Hi Mugdha,

I didn't set any breakpoints but I successfully set my path for the context of the debug session and clicking on any of the threads caused the appropriate source file to be automatically loaded.

Now, the problem is when I run messageqapp.exe from the command line on Linux I get (yes I did already use procmgrapp.exe to load the DSP binary):

# ./messageqapp.exe

MessageQApp sample application
MessageQApp_startup entered
Loading and starting procId [0] with [(null)]
Entered ProcMgrApp_startup
ProcMgr_attach status: [0x0]
After attach: ProcMgr_getState
    state [0x1]
Segmentation fault

To be honest, I get this whether I'm debugging or just running the program as usual. I'd like to point out that the program runs fine if I just do "/messageqapp.exe 0 messageq_ti81xx_dsp.xe674".

Any ideas what's going wrong? Is it just a fault with procmgrapp perhaps?

Thanks,

Ralph

  • Ralph,

    I'm getting confused between the two e-mail threads. Are you on .56 or .68 SysLink?

    Since the program runs fine with the full set of parameters to messageqapp.exe, I think this was likely a sample application issue for the other usage. Since you will actually end up writing your own application, you could still proceed with your own application development with this ...

    Regards,
    Mugdha

  • Hi, I'm using syslink_02_00_00_56. (The previous EZSDK 5.00.00.56 for the Integra)

    Lee is using 68 (from the newest SDK).

    Ralph

  • Ralph said:

    Hi, I'm using syslink_02_00_00_56. (The previous EZSDK 5.00.00.56 for the Integra)

    Ok, good. Then yes, I can confirm that this is a bug in the MessageQ sample application. If no arguments are provided to messageqapp.exe, it should not go and try to call ProcMgrApp again for startup etc. since the file path etc. are not provided. But this check was missing in the MessageQ app source file. It was fixed later and .68 release does not have this issue.

    So the only method that will work is the one that worked for you, with the messageqapp directly being provided the procId and file path.

    Note that this is just a sample application issue and does not affect SysLink API functionality. If you want to use procmgrapp for load/start and messageqapp in this way, you'll need to go and comment the calls to ProcMgrApp_startup and ProcMgrApp_shutdown in file syslink/samples/hlos/messageQ/MessageQApp.c.

    Regards,
    Mugdha

  • Okay, well if the bug is just in the MessageQ application I'll edit its source and rebuild it.

    Thanks for the info.

    Ralph