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.

LAUNCHXL-F28P55X: Incorrect strange value after reset

Part Number: LAUNCHXL-F28P55X

Tool/software:

I'm following the dual_axis_servo_drive guide.

"When the build is complete, click on debug button, reset CPU, restart, enable real time mode, and run."

After performing these steps, the variables have this strange value:

It doesn't always happen, but it happens often.

What's the problem?

  • Sorry for late reply. That is because some of the functions are part of the library hence CCS can not access the source code. I hope your code runs fine as expected.

    Vivek Singh

  • Hi and thank you for your reply.

    I noticed that if I deactivate the option "enable polite real time mode" the strange values no longer appear.

    I'm not sure what instructions and libraries you're talking about, but I'm trying your code you provide in dual_axis_servo_drive, I haven't modified/created anything

  • Hi,

    I'm not sure what instructions and libraries you're talking about, but I'm trying your code you provide in dual_axis_servo_drive, I haven't modified/created anything

    There are many precompiled libraries used in our example code. Like this delay function is precompiled hence when you halt in that function, since there is not source code available for this, it gives this warning. 

    Vivek Singh

  • Thank you.

    So what should I do to solve the problem?

    To date, the only 'solution' I have found is to disable 'polite real time mode' ... I don't know why or what its function is ...

  • Let me refer this to our CCS team and see if they have any suggestions. 

    Vivek Singh

  • Here is some info related to polite real time mode -

    • When real-time mode is enabled, it defaults to Polite real-time mode
    • In Polite mode, debugger will prevent the target from being halted while application is servicing a time-critical interrupt
    • If a debugger access requires target to be halted when servicing a time-critical interrupt, user will be asked whether Rude real-time mode should be enabled
    • In Rude mode, halt requests are serviced immediately, regardless of whether the processor is executing a time-critical ISR
  • I'm assuming the impacted variables are floats. If so, this looks very much related to the issue mentioned in the thread below:

     TMS320F280049C: CCS expression window wrong value 

    Looking at the f28p55x.gel file, I can see nearly all the memory ranges with access size of 2.

    See this related ticket: https://sir.ext.ti.com/jira/browse/EXT_EP-10722

    Note this line: Memory map is configured for AS2 instead of AS4. The C2000 GEL files could be changed to use AS4 to address this issue.  

    AS2 is forcing the debugger to make two 16-bit accesses to get the value of the 32-bit float value. When real-time mode enabled, the value is in an "in between" state. As Darian mentions in his post:

    This is happening because the debugger is not reading the two words atomically, and as such, if the write happens between the two reads, the value will be one of the two incorrect values.

    Thanks

    ki

  • If I set:

    and I activate real time debugging I get this error:

  • and I activate real time debugging I get this error:

    Enabling that option would interfere with real-time access.

  • Thank you for your reply.

    I didn't understand the procedure that I must follow.

    When I debug I press 'Run' and activate the continuous refresh in the expressions? (..so no real time option to activate)

    Nothing else?

  • Note that "halt the target before any debugger accesses" is intrusive - it will halt the target for every memory access. Hence if continuous refresh is enabled with that option enabled, the target is continually being halted for each refresh. This can greatly impact real-time performace.

    The workaround for correct real-time accesses is my comment above

    Memory map is configured for AS2 instead of AS4. The C2000 GEL files could be changed to use AS4 to address this issue.

    in the f28p55x.gel file likely being used by your device.

  • Which of these 3 should I modify?

    (only C28xx_CPU1 selected in the photo contains the underlined .gel file .. the other two have that field empty)

    How do I modify it?

    I've never done these things and I don't want to get anything wrong

  • Just the one for the F28x CPU. The one with an actual gel file

    How do I modify it?

    It is a text file. You can open in editor and replace the AS2 to AS4 for the memory region in question:

    For example, say I want to change it for LS0 RAM for Data page.

    On line 371 of f28p55x.gel (for CCS 12.8.1)

    Change:

        GEL_MapAddStr(0x00008000, 1, 0x800, "R|W|AS2", 0); /*   LS0 RAM (with PARITY) (4KBytes)                         */

    to 

        GEL_MapAddStr(0x00008000, 1, 0x800, "R|W|AS4", 0); /*   LS0 RAM (with PARITY) (4KBytes)                         */

  • Last question, where is that file located on the PC?

    I'm looking for it everywhere but I can't find it, by the way windows is not very 'good' at searching for files in the system

    Inside the .gel file I don't know what I can/should change from AS2 to AS4 ... so can I replace AS2 with AS4 anywhere? Or do I have to pay attention to something?

    Thank you so much!

  • Last question, where is that file located on the PC?

    It should be in:

    <CCS INSTALL DIR>\ccs\ccs_base\emulation\gel\f28p55x.gel

    Inside the .gel file I don't know what I can/should change from AS2 to AS4 ... so can I replace AS2 with AS4 anywhere? Or do I have to pay attention to something?

    I suppose you can change it all. But I would start with just the range for the memory region you are allocating the variables in question (you should be able to see the address for the variable in the expressions view)

  • Hi.

    I replaced in the .gel file AS2 with AS4 everywhere but the problem (strange values) remained

    I attach the project if you want to check it and the .gel file

    dual_axis_servo_drive_fcl_qep_f28p55x.rar

    f28p55x.gel

  • I attach the project if you want to check it and the .gel file

    I looked at the attached gel file. I don't see any instances of GEL_MapAddStr called with AS4. It is all AS2.

  • I re-downloaded the file I had attached in my previous post/reply and I see AS4 everywhere:

    I modified it using visual studio

  • Oh you are correct, my mistake! I was looking at the wrong file originally. Yes, you file looks good.

    Can you explain the "strange" values? What value do you see for a particular variable and what is the expected value?

    If you disable continuous refresh in the expressions view and look at the variables when CPU is halted, the value is always correct?

  • Disabling continuous refresh in the expressions view and when CPU is halted .."when the build is complete, I click on debug button, reset CPU, restart, enable real time mode, and run .. the variables are these:

    They do not seem correct to me..

  • Can you still answer:

    what is the expected value?

    Thanks

    ki

  • I should have all varaibles to zero

  • Thanks. I will look into this further. It is a local holiday here so I will need to take a look at this tomorrow. 

  • okey, no problem.

    Thanks!

  • Sorry for the delay. I have the device now and will take a look at this shortly.

  • I trying flashing and running your program. While running, I added some expressions in the Expressions view and enabled continuous refresh.

    I see:

    Does this look more like what you expect? What exact CCS version are you using? I tried with CCS 12.8.1.

    Also note that your project has maximum optimization enabled. Optimization can greatly impact source level debug.

    Thanks

    ki

  • From your screenshot I see that the option "enable silicon real time" and "polite real-time mode" are not enabled.

    The strange values of the variables are only there when I enable "polite real-time mode", regardless of the debugger's degree of optimisation (I've tried resetting it, but nothing changes). Can you try to debug and activate that option and share the screenshot?

    So, to summarise, if I try to follow what is written on the pdf guide "when the build is complete, I click on debug button, reset CPU, restart, enable real time mode, and run" the variables are displayed correctly IF AND ONLY IF I disable "polite real-time mode".

    I take this opportunity to ask you what level of optimisation should I use?

  • From your screenshot I see that the option "enable silicon real time" and "polite real-time mode" are not enabled.

    Ah yes, so I tried enabling that and I noticed that I think I saw the issue very briefly only if I enable real-time mode and continuous refresh from the beginning after program load. See the video below, look at the time from 0:43 - 0:46:

    It briefly shows the strange values for 3 seconds. Then it gets refreshed properly and I never see it again. I'm not sure why this happened for those 3 seconds. Could just be in a middle of a refresh?

    However, I believe you are claiming that the strange values always remains.

    I tried this in CCS 20.2.0 and I didn't see the strange values at all. Could you try using CCS 20.2.0?

  • That's right, the strange values remain and it doesn't refresh.

    I'm using usando CCS 12.8.1.00005

    But if I solved the problem by not activating the 'enable polite real-time mode' option, what 'functionality' of the programme would I be missing?

    (... because by deactivating it, the problem disappears)

    If such an option is 'mandatory/necessary' ... then I will try using CCS 20.2.0

  • But if I solved the problem by not activating the 'enable polite real-time mode' option, what 'functionality' of the programme would I be missing?

    Please see the below section in the User's Guide for more details:

    https://software-dl.ti.com/ccs/esd/documents/users_guide_ccs/ccs_debug-main.html#real-time-mode

    For F28x, enabling explicit real-time mode would allow for specified interrupts to be serviced even if the target is halted. 

    real-time memory/register accesses are always enabled regardless of the real-time mode setting.

  • So if I understand correctly, to date we have not found a solution for CCS 12.8.1 because the problem remains.

    It can be avoided by disabling 'polite real-time mode', i.e. the debugger does NOT respect the DBGM: if the CPU is in a sensitive zone, the debugger does NOT wait for it to leave that zone before accessing

    In practice it's not very clear to me this option from the guide either, I'd like a practical example showing the difference between that option being active and not ... I'll try searching more.

    I will also try to use CCS 20.2

     

    Thanks

  • So if I understand correctly, to date we have not found a solution for CCS 12.8.1 because the problem remains.

    It will be hard to troubleshoot this if we cannot reproduce the issue. The other issue is that the CCS Eclipse environment (which CCS 12.x is based on) has been greatly deprecated in support. Any bugs found with CCS 12.x will not be fixed.

    It can be avoided by disabling 'polite real-time mode', i.e. the debugger does NOT respect the DBGM: if the CPU is in a sensitive zone, the debugger does NOT wait for it to leave that zone before accessing

    I *think* that CCS now will ALWAYS respect DBGM when a real-time memory access is made - even if real-time mode is disabled. I will need to confirm this.

  • All right, thank you.

    For now by not activating the 'enable polite real-time mode' option the programme seems to be working properly, so I think I will continue with it before moving on to theia

  • I *think* that CCS now will ALWAYS respect DBGM when a real-time memory access is made - even if real-time mode is disabled. I will need to confirm this.

    I looked into this and found out that the REVERSE is true. If poltie real-time mode is not explicitly enabled, then all real-time memory accesses are RUDE by default. 

    Some deeper explanation to the difference between POLITE vs RUDE:

    Realtime applications set various bits to indicate if the application is in a critical section or not.  When in polite realtime mode, the debugger will check those bits and not access the target if those bits indicate the target’s in a critical section.  If it is, the debugger will keep waiting for it to leave the section, and will eventually time out.  In rude mode, the debugger will make the access regardless.  Note that in either case, the access effectively stalls the processor a few cycles, so it’s far less intrusive than regular stop mode (where the target would be halted to make the access), but if the target is in a really critical section, those few cycles could matter.  If realtime mode is not enabled, then all accesses are rude.