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.

TMS320F28388D: How do I debug a program running on CM4?

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

Hello,

I'm new to TI's C2000 technology and in particular to the CPU mentioned in the title.

We're building a multi-task, multi-core program on CPU1 and CM4.

To start with, I used the "simple" example of flashing LEDs D1, (via CPU1) and D2, (via CM4): (..C2000Ware_5_01_00_00\driverlib\f2838x\examples\c28x_cm\led)

I understand that both codes have to be loaded via the debugger (XDS100V2 on the MB063 controlboard).

At the moment, I'm facing three problems: 

1/ - If I modify CM4's code, I have to reload both projects in the board (first CM4's, then CPU1's) for CM4's modified program to run.
2/- If I set a breakpoint on the CM4 code, it is not executed.
3/ - When I suspend the debugger, only CPU1 stops, CM4 continues to run...

I'm certainly not using the right method for debugging, but I can't find a clear explanation of this principle...

Can you help me?

Thanks in advance.

Eric

  • Hello Eric,

    1/ - If I modify CM4's code, I have to reload both projects in the board (first CM4's, then CPU1's) for CM4's modified program to run.

    If you just connect to the target using the target configurations file (.ccxml), you should be able to just load CM4 and run it after restarting both CPUs. If you want to debug both cores, then yes I believe you will need to reload both projects.

    2/- If I set a breakpoint on the CM4 code, it is not executed.

    In the Debug window make sure you have the correct core selected (below is an example, as I don't have a F2838x device on-hand). Also, is your breakpoint somewhere in main where it should execute before any function calls?

    3/ - When I suspend the debugger, only CPU1 stops, CM4 continues to run...

    Yes, the cores are independent of each other as far as debugging is concerned, they are treated as such (there are ways of using DSS to run debug cores simultaneously I believe).

  • Hello Omer,

    thank you very much for your quick reply.

    I must admit that it's hard for me to understand. I've managed to download the code only in CM4 and set breakpoints.

    To do this, I disable all the other cores:

     

    The problem is that the LED, driven by CM4,  that should be flashing never lights up.

    Maybe because CPU1 isn't running? But if I run CPU1 first, I have to stop it to start CM4... And in that case, I can't debug CM4's code.
    (I'm using the only on-board debugger on the MB063 evaluation board).

    Is there any documentation that explains debugging principles in detail? I can only find the User Guide but no explanation of how to debug a multicore system.

    Thank you for your help.

    Eric.

  • Maybe because CPU1 isn't running? But if I run CPU1 first, I have to stop it to start CM4... And in that case, I can't debug CM4's code.
    (I'm using the only on-board debugger on the MB063 evaluation board).

    Yes, CPU1 is the primary CPU and needs to run first. You can debug the CM's code by loading a project to CPU1 and then loading a project to CM by doing Run > Load > Load the appropriate .out file that was compiled.

    Is there any documentation that explains debugging principles in detail? I can only find the User Guide but no explanation of how to debug a multicore system.

    I'm not aware of any such documentation that we have, I believe there is a discussion on creating an application report for something like this.

  • Hello and thanks again Omer,

    but it still doesn't work for me...

    I load CPU1; the loading is OK, but the second loading for CM returns the following error:

    then: 

    Best Regards,

    Eric.

  • Hello Eric,

    Did you modify the linker command file in any way (was this project from an example or made from scratch)? The memory address it's trying to write to for the program doesn't look quite right.

  • Hi Omer,

    i didn't modify the linker file.
    I imported the example "\C2000Ware_5_01_00_00\driverlib\f2838x\examples\c28x_cm\led".

    To be sure, I redid the procedure from the import in a other workspace than the one I was using. I found exactly the same problem...

    Regards,

    Eric

  • Hello Eric,

    When I import the example and run it, I'm able to run the program without issue and see the LEDs flash. Other than that, these are the steps I took:

    1. Import LED example
    2. Add USE_20MHZ_XTAL to Predefined Symbols in Project Properties (this was for me because I was using a ControlCARD that uses the 20 MHz crystal, this may or may not apply to you)
    3. Build both projects
    4. Start debug session on project for CPU1
    5. Connect to CM by selecting the core and right-clicking to select "Connect Target"
    6. Go to Run > Load and load the appropriate .out file for the CM
    7. Run both cores
  • Hi Omer,

    I finally managed to get my debug to work on the CM4... In fact, what I hadn't realized was that I had to use the debug window to select which CPU I wanted to act on to start or stop the program... : 

    Now I can act independently on the CPU I want, thanks to this window...

    Thanks for your patience :)

    Best Regards,

    Eric