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.

TMDS64EVM: AM6442

Part Number: TMDS64EVM


Hardware: TMDS64EVM - Software: Code Composer Studio 12.5.0.00007.  

Having trouble reading global variables in expressions when the r5f is running in debug. As an example, I have imported an example project epwm_duty_cycle_sync_am64x-evm_r5fss0-0_nortos_ti-arm-clang from the examples listed in mcu_plus_sdk_am64x_09_00_00_35

During execution, epwm signals are produced as documented in the README.html in the project.  However, I cannot read global variables in the Expressions section during run mode. The value is could not read 0x........ emulation state prevented access.   However, I can read the variables when the r5f is halted/paused. Is there a way to read the variables during run mode (real-time)?

  • Hello Shane,

    As far as I am aware, what you are asking for is not supported. Let's think about the implications.

    That R5F can run up to 800MHz. So a variable value could theoretically be updated every 1.25ns. There is just no way a debug software would be able to communicate with the processor and update the value in the debugger at that rate, and even if it could, there is no way a human eye could keep up with the interface updating that quickly.

    Ok, so true "real time" variable reading is not possible. But is there a way to read the variable value exactly at a specific point in time?

    Absolutely! That's called a breakpoint. Set a breakpoint at the exact place in the code where you want to see the variable values. Your code will run normally until it hits the breakpoint, and then it will pause, allowing you to read the value. If you're not sure how to set a breakpoint, I can point you to additional resources.

    Regards,

    Nick

  • Hello Nick

    I acknowledge that given the clock speed of the R5F there would be limitations of what you can get out of the debugger.

    I can set S/W BP and that works fine.  It stops with a value, and I can run again with an updated value with the yellow highlighting.  If you can point me to those additional resources with regard to breakpoints, it would be much appreciated. 

    Looking at the help contents in CCS, I travelled down to Code Composer Studio User's Guide/Debug/Advanced debugging topics/Real-time mode.  The heading had 7.5.8. Real-time Mode.  It states, " ARM Cortex based devices support do not support full real-time mode. But they do support real-time (non-intrusive) memory accesses."  Then there is an introductory presentation pdf link about the topic.  In that pdf it states, "DAP is part of the ARM emulation logic and enables the debugger to access memory of the device without requiring the processor to enter the debug state."  I think this is what I am after.  How do I that in CCS? Is there any documentation on how to access the memory whilst not in debug state?

  • Hello Shane,

    Understood. We are getting out of my area of expertise, so I'm sending your thread to the CCS team to comment more. You may get bounced around a bit if they need to send you back to the MCU+ SDK experts on my team - feel free to ping the thread if you do not get a response by Monday.

    Regards,

    Nick

  • Hi Shane,

    The R5 for the AM2x/6x devices had some issues with real-time memory accesses that prevented them from working out of the box. It is possible to get this to work. See my response regarding a similar request in another thread:

    https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/1290899/codecomposer-code-composer-studio-forum---graph-tools-selection-of-cpu-source/4915266#4915266

    That one is regarding AM26x but it should also apply to AM64x also.

    Please note that the newly released 12.6.0 should ship with the correct XML files so no XML tweaks should be required.

    On your device I'm not sure if there is TCM memory and if that is the memory region you want real-time access for. If so, then there are other considerations to keep in mind. Please let me know if you are.

  • Hi Ki

    Real-time memory access now works for the SRAM.

    I installed CCS 12.6.0 to avoid doing any xml tweaks, but for the AM64x this did not pan out.

    • You still need to do a minor tweak to AM64x.xml  located in "<CCS 12.6.0 INSTALL DIR>\ccs\ccs_base\common\targetdb\devices". The file is the same as what is in the CCS 12.5.0 install. So I changed Value="1" to Value="0" in lines 660,980,1300, and 1620 of this xml file.  
    • After starting CCS and launching a debug session, I loaded the program as normal.
    • Found "ARM Advanced Features" in the Debugger Options and disabled the "Data Cache Enabled".
    • After running I was getting real-time updates for the SRAM.

    Now how do I get real-time access in the TCM address range to update the same way as the SRAM?  I tried to see what happens by assigning one of the variables in this example, gLoopCount,  to address 0x41010000.  While running, gLoopCount did not update the value, however updates when the program halts.  I had planned on using the TCM for the R5 eventually.

  • Now how do I get real-time access in the TCM address range to update the same way as the SRAM?

    There are a few extra steps involved. I will update this thread with them.

    Thanks

    ki

  • Sorry for the delay.

    For real-time memory access for TCM memory regions, there are two key differences:

    1) No need to disable data cache since it is not applicable for TCM

    2) You need to know where the various TCM memory blocks are mapped into the System address space.

    For example, RF5 core 0 ATCM on an AM243x is 0x0 and this maps to system memory 0x78000000.

    Hence to get real-time memory access for a global variable in TCM, you need to do the additional steps:

    1) Get the address of the global variable

    2) Right click in the Debug View and choose to "show all cores"

    3) Select the "CS_DAP_0" in the debug view

    3) Open a Memory Browser view, configure it to show the "System_View" and then pin it to the current debug context  (CS_DAP_0) and enable continuous refresh.

    4) Then in the Debug View, select the R5 core and see the address for the global variable in TCM that you wish to see update in real-time. Add that value to the base TCM address in System address space.

    For example, on AM243x, if the address of my global variable in ATCM is 0x620, then add that to the base ATCM system memory of 0x78000000. This would then be 0x78000620. 

    5) Enter above address in the Memory Browser view pinned to the CS_DAP_0

    6) Run the target. You should see the above Memory Browser view contents update while the target is running.

    Note that we will be making a lot of usability improvements in a future release where all of this is handled for you under the hood so that you can just add a variable to the Expressions view like you would usually do and CCS would handle all the address mapping for you under the hood so that you can view that variable in real-time without having to do all the steps mentioned above.

    Thanks

    ki