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.

TMS320F280049: ERAD module used for stack overflow detection - conflict between application and debugger

Part Number: TMS320F280049


Hello support,

my goal is to detect the stack overflow condition using ERAD.

I have read the examples and they are quite clear, but I need some more info about the ERAD resources sharing between CPU and Debug System.

TRM states at par. 11.4:

"The last option is to have no owner. In this mode, both the application
code and the debugger have the capabillity to access the module at the same time. It is critical for the software,
both on the application side and the debugger side, to resolve any conflicts. In this mode, it is possible for the
debugger to use some of the EBC units and the SEC units, while the application software uses the remaining
units."

I know that part 280049 supports 8 BPs.

Under precondition that GLOBAL OWNER = No Owner,

Question 1: if I use ERAD BP1 for stack OVF detection, can the debugger use the 7 remaining for HW BP ?

Question 2: in case answer to Q1 is yes, if I set a HW BP in CCS how can I be sure that CCS does not attempt to use really BP1 ?

Question 3: when I set an HW BP "right clicking" in the Breakpoint tab of CCS, does CCS modify the GLOBAL OWNER setting ?

  • Hello Davide,

    I am looking into this and will get back to you shortly.

  • Hello Davide,

    Code Composer should use ERAD resources as needed/on demand. So if you set a hardware breakpoint, CCS will take ownership of the ERAD, and then use the first available EBC to set the breakpoint you requested. If your application has already configured and enabled EBC, CCS will move on to the next until it finds an available EBC.

    To configure a hardware breakpoint for application use, follow these steps:

    1. Use the ERAD_getOwnership() function to determine if the debugger owns the EBC. If so, call ERAD_setOwnership(ERAD_OWNER_NOOWNER) to release the ERAD. In the NOOWNER mode, both application and debugger have access to EBC resources, but the application is responsible for avoiding conflicts.
    2. Use the ERAD_getBusCompStatus(ERAD_HWBPx_BASE) function to check if a particular breakpoint is in use. If this function does not return ERAD_STATE_IDLE, then HWBPx has already been previously configured by either the debugger or the application.
    3. Configure the available HWBP as desired.
    4. Call ERAD_enableModules() to enable the breakpoint(s) you have just configured. The arguments to this function are ERAD_INST_BUSCOMPx for EBCs/breakpoints and ERAD_INST_COUNTERx for system event counter modules; you can OR multiple modules together to be enabled at once.

    I am not sure of the answer to your last question. However, regardless of whether CCS takes ownership or leaves the NOOWNER setting, you should always check ownership and make sure you set NOOWNER before changing ERAD configuration. I do believe that if you set owner to APPLICATION then CCS is blocked from using the ERAD to set hardware breakpoints, so avoid using this setting.

    Best regards,
    Ibukun