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.

TMS320F280041: Works only in debug mode

Part Number: TMS320F280041
Other Parts Discussed in Thread: C2000WARE

Hello,

I'm connected to the TMS320F280041 on a custom board. For the connection I'm using Ti XDS100V2 debug probe.

I've made a "hello world" program, which sets some outputs. The microcontroller runs ok in debug mode with the debug probe connected. For this it uses CPU1_RAM configuration, with 280041_RAM_lnk.cmd

But it does not run in standalone mode (without the debug probe). The program builds ok in CPU1_FLASH configuration with 280041_FLASH_lnk.cmd . Also the flashing seems to go through without issues. But it seems that the microcontroller does not start after that.

Both GPIO24 and GPIO32 are on "1", so the microcontroller should be in Flash boot mode.

Any idea what am I missing ?

Thanks Andrej

  • Hi Andrej,

    One quick check would be see if you are disabling the watchdog in your application. When you are connected to debugger it gets disable by CCS setup file but in standalone it may be enable hence trigger a device reset. you can confirm this by scoping the XRSn pin on device and see if it's toggling in standalone mode.

    Regards,

    Vivek Singh

  • Hi Vivek,

    thanks for your answer. The issue remains.

    The watchdog should already be disabled: DisableDog() is called at the beginning of the program. Adding this line later in program doesn't not help either.

    I have tried also setting WD_DISABLE  .set  1  (in file f28004x_codestartbranch.asm), but doesn't help.

    The status of XRSn pin is shown on the attached photo. The XRSn has a 5k6 resistor is tied to VDDIO (3.3V) and a 22nF capacitor to the ground, as suggested in the datasheet.

    Thanks Andrej

  • Look like XRSn is toggling which is not good. have you already tried flash build code with CCS connected and does it work fine ? You can try following step with CCS connected and see if this works -

    1. After connecting to CCS, issue CPU reset from CCS. (assuming code is already loaded in flash (flash build), if not then load the code and then issue reset)
    2. Open memory browser in CCS and write 0xA500 at address 0xD01
    3. Click on "Run"

    See if this runs properly. If not then you can set the breakpoint at your project entry point and debug it by stepping through the code.

    Regards,

    Vivek Singh

  • I have tried the procedure:

    Active configuration CPU1_RAM:

    Click Debug and then Run. The program works ok, also if I click pause and read some variables.

    If I click restart, everything is ok.

    But if I click CPU reset I get the response:

    Break at address "0x3fc7a5" with no debug information available, or outside of program code.

    Active configuration CPU1_FLASH:

    Click Debug, the building and programming goes ok.

    The pointer is set to InitSysCTRL() like in previos case. But when I click Run, I get the following message:

    Break at address "0x3fbd92" with no debug information available, or outside of program code.

    Clicking CPU Reset gets me the following:

    Break at address "0x3fc7a5" with no debug information available, or outside of program code.

    If I execute the program step by step (F5), I get the break at address "0x3fbd92" after calling F28x_usDelay(2000);

    If I exclude F28x_usDelay(2000), I get the break later.

    The DisableDog is called at the beginning of InitSysCtrl() and the procedure is:

    void
    DisableDog(void)
    {
    volatile Uint16 temp;
    EALLOW;

    //
    // Grab the clock config so we don't clobber it
    //
    temp = WdRegs.WDCR.all & 0x0007;
    WdRegs.WDCR.all = 0x0068 | temp;
    EDIS;
    }

    Do you think the issue is related to watchdog ?

  • Hi,

    But if I click CPU reset I get the response:

    Break at address "0x3fc7a5" with no debug information available, or outside of program code.

    This is ok. At reset PC points to BOOTROM code and there is no source code for BOOTROM hence this message.

    Click Debug, the building and programming goes ok.

    The pointer is set to InitSysCTRL() like in previos case. But when I click Run, I get the following message:

    Is InitSysCTRL() is Ist function inside main ? Can you check the value in RESC register after it breaks at address 0x3fc7a5 ? 

    Regards,

    Vivek Singh

  • Hi,

    yes, the InitSysCtrl() is the first function inside main and is located in the file f28004x_sysctrl.c

    The result of RESC register is a the followiing:

    DCON and XRSn_pin_status are always 1

    After starting the debug, the WDRSn is 1. If I run the code to clear it, and then brake at address 0x3fc7a5, it stays on 0.

    But then again after recompiling and starting the debug  WDRS is again 1.

  • You don't need to recompile the code and load again. Once you load the code in flash, it'll stay there and you just need to follow the steps I mentioned and run again. Just put the breakpoint at main() entry point before running (don't click debug again).

    Regards,

    Vivek Singh

  • Hello, thanks for the answer.

    I did as you suggested. the result is WDRSn is 1 and both DCON and XRSn_pin_status are 1 .

    Regards

    Andrej

  • It means WD is triggering a reset. Does CPU halts at your code entry point and after that when you run again, WD reset happens ?

  • Hello,

    I have created a new project . I used the example from C:\ti\c2000\C2000Ware_4_00_00_00\device_support\f28004x\examples\gpio 

    Now it works.

    Thanks for your help.