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.

CCS/TMS320F28335: code_start difference between Watchdog Reset and power on

Part Number: TMS320F28335

Tool/software: Code Composer Studio

There is two project in F28335, one is bootloader and another one is App. When power on, first bootloader will run code from default code_start address(0x33FFF6). Then branch to App project code_start address(0x300008). Both code_start is as following(i.e. DSP2833x_CodeStartBranch.asm) and the watchdog is disabled.

code_start:     .if WD_DISABLE == 1         LB wd_disable       ;Branch to watchdog disable code     .else         LB _c_int00         ;Branch to start of boot.asm in RTS library     .endif

;end codestart section

I add code in App project to check watchdog WDFLAG bit as following(follow the errata document to resolve XINTF module bug)

EALLOW;
    if((SysCtrlRegs.WDCR & 0x0080) == 0)
    {
        SysCtrlRegs.WDCR = 0x0028;
        SysCtrlRegs.WDKEY = 0x0055;
        SysCtrlRegs.WDKEY = 0x00AA;
    }
    else
    {
        SysCtrlRegs.WDCR |= 0x0080;
    }
    EDIS;

However, after the watchdog reset,  the code "SysCtrlRegs.WDCR |= 0x0080" seems cannot disable watchdog. However, code_start should have disabled the watchdog. How to understand this problem? What the differene related with code_start between power on and watchdog reset? thanks.

  • Hi,

    WDCR register has WDCHK bit field which need to be written with value 1-0-1 to enable write to this register.

    So, to disable WD you need to write 0x68.

    SysCtrlRegs.WDCR |= 0x0068;


    Regards,

    Vivek Singh

  • Hi Vivek,

          Understand now, thanks for your reply. Then, I want to confirm, the code run and behavior difference between Power on and watchdog reset, only the WDFLAG bit?  I don't want watchdog reset cause any special impact. thanks very much.

  • Hi,

    Then, I want to confirm, the code run and behavior difference between Power on and watchdog reset, only the WDFLAG bit?   I don't want watchdog reset cause any special impact. thanks very much.

    Watchdog reset will not cause any special impact. It should be fine.

    Regards,

    Vivek Singh