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.

debug for notify example using ccs on DM8148



Hi Ti,

I am a newcomer for developing dsp. I am trying to use ccs to debug the dsp side codes of the notify example in syslink on DM8148. I am using ccs 5.4.0.  And its components'  versions are:

sys/bios 6.35.1.29

ipc 1.25.0.04

xdctools 3.25.0.48

And I am using syslink 2.0 which is one component of EZSDK 5.03.01.15. The versions of the other related components in EZSDK are:

bios: 6.32.05.54

ipc: 1.23.05.40

xdctools: 3.22.04.46

The versions of components used in ccs (windows) and EZSDK(for building syslink samples) are really not coincident.

First I create and build the notify project in ccs as http://processors.wiki.ti.com/index.php/Creating_CCS_Project_for_SysLink_samples says. But I do "not" set the build options as "-DSYSLINK_PLATFORM_TI81XX" because of the different versions of ccs between mine and the authors'. Also I do "not" set the configuration script arguments type as "{dmTimerFreq: 32768}" because the example would be stuck behind ipc_start() if so. And I changes the Timer.intFreq.lo as 20000000 in .cfg file. Because the project created by ccs needs the path to syslink, I copy the syslink 2.0 to windows environment and indicate its path. 

Based on the above settings, I build the project and get the .out file. But there are two warnings "#10063-D:entry-point symbol other than ' _c_int00 specified ' " and "#10247-D:creating output section '.plt' without a SECTIONS specification". It seems nothing matters. In order to verify the correctness of the .out file or my settings, I download the .out file into the platform's filesystem and run in the same way as the .xe674 file in syslink. The results are the same. I think my settings are correct, am I right? But the sizes of the .out file and the .xe674 file differ largely. Is it because the difference between windows and linux? Oh, I’m digressing here.

Then, I begin to debug the codes on dsp side as follows:

1. Startup DM8148 and the dsp core: ./slaveloader_debug startup DSP ./notify_ti81xx_dsp.xe674

2. Startup ccs, debug .ccxml, right click on dsp core and select "connect target". Although it prompts one error "No source available for '0x8b0168fc' ", but I ignore it. After I load the symbols, it should spin on Ipc_start(), but it halts on  ti_sdo_ipc_GateMP_start() in the GateMP.c file. 

Also I try to load program, the debugger can find the main(), it spins on Ipc_start(). Then I run the example on DM8148, sometimes it can halt on the breakpoint set in the task function, but sometimes it doesn't and the example can execute without errors. It seems to be not steady enough.

I have consulted many threads but got no way. I have tried my best. Is anyone willing to help me? Thanks!

  • Miao,

    The old SysLink 'samples' have been deprecated. I suggest you use the new 'examples'. Unfortunately, we did not start shipping the new examples until SysLink 2.10. I suggest you download the last release, SysLink 2.21.03.11, and use the examples from there. They should work fine with your working release. Look in the following folder.

    SysLink_2_21_03_11/examples/archive/TI814X_linux_elf_ezsdk

    You don't need to convert these examples into CCS projects in order debug them. You can build them outside of CCS, load the executables to your target file system, and run them. Once the DSP is up and running, you can use CCS to load the symbols and then simply connect to the DSP. At that point, you can start debugging.

    This is also true of the old SysLink samples, you don't need to make them into CCS projects.

    Make sure that your CCS Debug Configuration does not have any gel files associated with the DSP. You want CCS to connect without issuing any gel commands.

    I always load symbols before I connect, but it really does not matter. Either way works fine.

    You can use the Source Lookup Path option to make it easier for the debugger to find your source files.

    CCS > Window > Preferences
    C/C++ > Debug > Source Lookup Path
    Add > Path Mapping > OK
    Name: <add your favorite name>
    Add
    Compilation path: <the actual path the compiler used to build your source file>
    Local path: <the same path mapped to your PC>

    The two warnings you mention above are safe to ignore.

    The executable file size is dependent on the compilation options you use. But what's more important, is the actual program size which is loaded to the target. Look in the generated map file. These are also controlled by compilation options.

    When you connect to the DSP, it could be at any random point. If the DSP is idle, then it will be somewhere in the idle loop. Sometimes, you might catch it during the timer interrupt. Either way, set a break point at some application level, then run until you hit that break point.

    ~Ramsey

  • Hi Ramsey,

    Thanks for your reply. Your post has helped me so much. But I still can't get the correct result. Would you please help me to check what's wrong with my following procedure?

    1. I download the syslink 2_21_01_05 and build it with no error. DM8148 can run the messageq example successfully.

    2. Copy the built syslink_2_21_01_05 to "F:\miaoyu\syslink_2_21_01_05" and .xe674 file for being used by CCS.

    3. Startup the DSP and load .xe674 file.

    4. Open ccs, debug .ccxml, right click on dsp core and select "Open GEL Files View". In the GEL File(TMS320C674X) window there is nothing except "script" and "status". 

    5. Add a new "Path Mapping" to "Source Lookup Path" :

    Compilation path: \home\miaoyu\syslink_2_21_01_05

    Local path: F:\miaoyu\syslink_2_21_01_05

    Click OK. 

    6. Load symbols with the copied .xe674 file and connect the DSP core.

    I ignore the "random" point and set one break point in the main(). Execute the arm executable on the target and resume in CCS. But it does not halt on the break point and the sample execute has been finished without error.

    If I load program instead of symbols, everything is correct. The debugger can halt on the break point. 

    Is there anything wrong?

    Sincerely,

    Miao

  • Miao,

    In CCS, you also want to make sure there is no initialization script for the DSP. Double-click on your ccxml file. This will open your configuration script in the graphical editor. At the bottom of the window, you should see three tabs: Basic, Advanced, Source. Click the Advanced tab. Select the DSP in the connection browser. On the right side, you should see a properties page. Look for one called 'Initialization Script'. Make sure it is empty. Be sure the click the save button if you make any changes.

    In your step #3 above, are you using slaveloader to load and run the DSP? Something like the following command:

    slaveloader startup DSP server_dsp.xe674

    This will load and run the DSP. If you are using the SysLink example ex02_messageq, then the DSP will be spinning on Ipc_start. You own program might be doing something else.

    At this point, you can launch your CCS debug session, load the DSP symbols, and then connect to the DSP. Set a break point on Ipc_start() and then run. It should immediately hit the break point. This will keep happening because it calls Ipc_start() in a loop.

    For the ex02_example, when you run the HOST side program, the DSP will eventually go to Server_exec(). Set a break point there and delete the first one. Then run the DSP. It should keep running.

    Now you are ready to run the HOST program. Enter the following command:

    app_host DSP

    At this point the HOST program will attach to the DSP and send a message. You should see a few print statements. Then it waits for a reply message. At this point, you should see the DSP hit the break point in Server_exec().

    On the DSP, you should be able to step through the code. When the DSP sends a message back to the HOST, you should see another print statement.

    In your step #6 above, I think the problem is that you set a break point on the DSP at main(). But the DSP had already run past this point, so it will never hit this break point. Remember, that when you load and run the DSP, it will run normally, it does not stop in main().

    If you use CCS to load and run the DSP directly, then the SysLink driver on the HOST does not know the DSP has been loaded. The SysLink driver will not have the correct runtime state. When you try running the HOST program, it will fail with an error. You must use SysLink to load and run the DSP.

    ~Ramsey

  • Hi Ramsey,

    I can step through the code now! As you say, the problem is that I set a break point on the DSP in main(). I benefits very much from the second last paragraph. Thanks for your patience!

    But I have another question:

    After I load and run the Syslink example messageq on the target, it runs past the break point set in main() and spins on Ipc_start(). At this time, if I load program instead of symbols, the debugger will stop in main(). It seems DSP cancels the previous execution(spinning on the Ipc_start()) and goes to perform the executable loaded in ccs debug section. In this case I can also step through the code. Does loading the same executable twice in two different environments not cause some collisions? I can't find related explanations in chapter "Program load and Program Reload" of the "help content". Is there some documents for this?

    Sincerely,

    Miao 

  • Miao,

    When using SysLink and slaveloader to load the DSP from the HOST side, you should not reload the DSP again using CCS. You should just load symbols in CCS and then connect to the DSP.

    When using CCS to reload the DSP, it causes the initial runtime context to be lost. This will cause problems with the SysLink driver running on the HOST. In your test above, you are probably getting lucky. Since the DSP did not proceed very far, there was very little context to loose. However, if the DSP had run beyond the IPC attach phase, and then you reloaded the DSP, it would certainly not make it though IPC attach a second time because the SysLink driver on the HOST would not be doing the IPC attach a second time.

    Again, I think your are just gettign lucky with the CCS reload of the DSP. The recommended procedure is to load symbols and connect. There is no CCS documentation on this topic.

    ~Ramsey

  • Hi Ramsey,

    Thanks a lot. I can continue studying to develop DSP.

    Thanks and regards,

    Miao