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-F280039C: After a reset, the CPU halts

Part Number: LAUNCHXL-F280039C
Other Parts Discussed in Thread: C2000WARE

Dear Colleagues,

Please support the following issue: once the CPU reset has occurred with an API call, the CPU halts.

Any of the following APIs were used (sysctl.h header):
- SysCtl_simulateReset(WDGH_HARD_RESET);
- SysCtl_simulateReset(WDGH_SOFT_RESET);
- SysCtl_resetDevice().

This happened both during the debug session and during normal FW execution. During a debug session, it looks like:

Evaluation board: LAUNCHXL-F280039C.
Code Composer Studio: Version: 12.2.0.00009.
C2000WARE: 4.02.00.00.


Thanks in advance, I will be glad for your support.

BR,
Kostiantyn Rudenko

  • Kostiyantin,

         By "normal FW execution", I presume you are referring to standalone execution without connection to CCS, correct?

  • Yes. In this case, the CCS is used only for flashing.

  • Kostiyantyn,

          I need to try this out on the silicon myself. Please give me a day or two.

    Please clarify what you mean by "CPU halts". For example, let's say your firmware toggles a GPIO pin 5 times and then simulates a reset. What happens after that? You don't see the toggles again? Can you please try the below?

    After device initialization, toggle a GPIO pin 5 times and then simulate a reset. Try this with both Watchdog enabled and disabled.

  • Yes, of course, thank you.
    CPU halts in our case - when the firmware on MCU stops sending debug information over the SCI communication, after the calling reset API, but it should do this. I use Putty as a terminal, but even reconnecting the terminal doesn't help, seems the this issue on the MCU side. 
    But I'll also check with GPIO blinking.

  • OK, it could be that the CPU is doing "something else". When a device is fed with a clock, it has to do "something". It cannot simply just freeze (unless the device is in IDLE/STANDBY/HALT modes). A device can freeze due to EMI, but that is not the case here. I presume the boot-mode select switch S3 is set to jump to Flash.

  • Kostiyantyn,

                    I tried this on silicon. I used the gpio_ex2_toggle example in the C:\ti\c2000\C2000Ware_4_03_00_00\driverlib\f28003x\examples\gpio directory, but modified the file slightly. What I noticed is that the debugger has to be disconnected (either physically or logically) for this method to work. i.e. once you program the code, you can disconnect the target in CCS. You will then see my code working correctly. You will see a delay of 5 seconds followed by 5 toggles of GPIO22 and see this sequence repeated over and over again. This is understandable since , if the debugger is connected, code cannot free-run as in the standalone case. Note that I only tried SysCtl_resetDevice();

    The compiler is returning an error for the below since WDGH_HARD_RESET and WDGH_SOFT_RESET are not defined. Are these definitions that you created? 

    - SysCtl_simulateReset(WDGH_HARD_RESET);

    - SysCtl_simulateReset(WDGH_SOFT_RESET);

    I tried the below and it didn't work. I am investigating this.

    SysCtl_simulateReset(SYSCTL_CAUSE_SIMRESET_CPU1RSN);
    SysCtl_simulateReset(SYSCTL_CAUSE_SIMRESET_XRSN);

  • Hello Hareesh,

    Yes, WDGH_HARD_RESET and WDGH_SOFT_RESET are my own defines with values 2 and 1 respectively. Sorry, I forgot to notify about it.
    In your case, did the code run successfully after a reboot, over and over again, only if the debugger was disconnected right after the flashing?

    Thanks.

  • did the code run successfully after a reboot, over and over again, only if the debugger was disconnected right after the flashing?

    It is working fine in both cases. You can try the attached examples.  I changed the following lines in sysctrl.h. Now I am able to get it to work for 3 types of reset.

    #define SYSCTL_CAUSE_SIMRESET_CPU1RSN    0x00000001U //!< SIMRESET_CPU1RSn
    #define SYSCTL_CAUSE_SIMRESET_XRSN       0x00000002U //!< SIMRESET_XRSn

    //#############################################################################
    //
    // FILE:    gpio_ex2_toggle.c
    //
    // TITLE:   Device GPIO Toggle
    //
    //! \addtogroup driver_example_list
    //! <h1> Device GPIO Toggle </h1>
    //!
    //! Configures the device GPIO through the sysconfig file. The GPIO pin is 
    //! toggled in the infinit loop.
    //
    //#############################################################################
    //
    //
    // $Copyright:
    // Copyright (C) 2023 Texas Instruments Incorporated - http://www.ti.com/
    //
    // Redistribution and use in source and binary forms, with or without 
    // modification, are permitted provided that the following conditions 
    // are met:
    // 
    //   Redistributions of source code must retain the above copyright 
    //   notice, this list of conditions and the following disclaimer.
    // 
    //   Redistributions in binary form must reproduce the above copyright
    //   notice, this list of conditions and the following disclaimer in the 
    //   documentation and/or other materials provided with the   
    //   distribution.
    // 
    //   Neither the name of Texas Instruments Incorporated nor the names of
    //   its contributors may be used to endorse or promote products derived
    //   from this software without specific prior written permission.
    // 
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    // $
    //#############################################################################
    
    //
    // Included Files
    //
    #include "driverlib.h"
    #include "device.h"
    #include "board.h"
    
    int i;
    
    //
    // Main
    //
    void main(void)
    {
        //
        // Initializes system control, device clock, and peripherals
        //
        Device_init();
    
        //
        // Initializes PIE and clear PIE registers. Disables CPU interrupts.
        // and clear all CPU interrupt flags.
        //
        Interrupt_initModule();
    
        //
        // Initialize the PIE vector table with pointers to the shell interrupt
        // Service Routines (ISR).
        //
        Interrupt_initVectorTable();
    
        //
        // Board Initialization
        //
        Board_init();
    
        //
        // Enables CPU interrupts
        //
        Interrupt_enableGlobal();
    
        DEVICE_DELAY_US(3000000);       // 3-second delay to indicate device is starting after a reset
    
        //
        // Loop.
        //
        for(i=0;i<20;i++)
        {
            GPIO_togglePin(myGPIOOutput0);
            DEVICE_DELAY_US(100000);
        }
    
        //SysCtl_simulateReset(SYSCTL_CAUSE_SIMRESET_CPU1RSN);
        SysCtl_simulateReset(SYSCTL_CAUSE_SIMRESET_XRSN);
        //SysCtl_resetDevice(); // Resets the device by writing a bad key in WDCR
    
        while(1){}
    }
    
    
    //
    // End of File
    //
    
    
    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/171/gpio_5F00_ex2_5F00_toggle.syscfg

  • Kostiyantyn,

                    I got some feedback from our software team. Turns out that the parameters for the SysCtl_simulateReset function are to be found in hw_sysctl.h file in C:\ti\c2000\C2000Ware_4_03_00_00\driverlib\f28003x\driverlib\inc directory:

    So the correct usage of those functions would be 

    SysCtl_simulateReset(SYSCTL_SIMRESET_CPU1RSN);
    SysCtl_simulateReset(SYSCTL_SIMRESET_XRSN);

    The sysctl_cause parameters are passed as arguments to the RESCCLR Register to clear the reset cause: 

    #define SYSCTL_CAUSE_SIMRESET_CPU1RSN    0x00000400U //!< SIMRESET_CPU1RSn

    #define SYSCTL_CAUSE_SIMRESET_XRSN       0x00000800U //!< SIMRESET_XRSn

    Updated testcase attached:

    //#############################################################################
    //
    // FILE:    gpio_ex2_toggle.c
    //
    // TITLE:   Device GPIO Toggle
    //
    //! \addtogroup driver_example_list
    //! <h1> Device GPIO Toggle </h1>
    //!
    //! Configures the device GPIO through the sysconfig file. The GPIO pin is 
    //! toggled in the infinit loop.
    //
    //#############################################################################
    //
    //
    // $Copyright:
    // Copyright (C) 2023 Texas Instruments Incorporated - http://www.ti.com/
    //
    // Redistribution and use in source and binary forms, with or without 
    // modification, are permitted provided that the following conditions 
    // are met:
    // 
    //   Redistributions of source code must retain the above copyright 
    //   notice, this list of conditions and the following disclaimer.
    // 
    //   Redistributions in binary form must reproduce the above copyright
    //   notice, this list of conditions and the following disclaimer in the 
    //   documentation and/or other materials provided with the   
    //   distribution.
    // 
    //   Neither the name of Texas Instruments Incorporated nor the names of
    //   its contributors may be used to endorse or promote products derived
    //   from this software without specific prior written permission.
    // 
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    // $
    //#############################################################################
    
    //
    // Included Files
    //
    #include "driverlib.h"
    #include "device.h"
    #include "board.h"
    
    int i;
    
    //
    // Main
    //
    void main(void)
    {
        //
        // Initializes system control, device clock, and peripherals
        //
        Device_init();
    
        //
        // Initializes PIE and clear PIE registers. Disables CPU interrupts.
        // and clear all CPU interrupt flags.
        //
        Interrupt_initModule();
    
        //
        // Initialize the PIE vector table with pointers to the shell interrupt
        // Service Routines (ISR).
        //
        Interrupt_initVectorTable();
    
        //
        // Board Initialization
        //
        Board_init();
    
        //
        // Enables CPU interrupts
        //
        Interrupt_enableGlobal();
    
        DEVICE_DELAY_US(3000000);       // 3-second delay to indicate device is starting after a reset
    
        //
        // Loop.
        //
        for(i=0;i<20;i++)
        {
            GPIO_togglePin(myGPIOOutput0);
            DEVICE_DELAY_US(100000);
        }
    
        SysCtl_simulateReset(SYSCTL_SIMRESET_CPU1RSN);
        SysCtl_simulateReset(SYSCTL_SIMRESET_XRSN);
        //SysCtl_resetDevice(); // Resets the device by writing a bad key in WDCR
    
        while(1){}
    }
    
    
    //
    // End of File
    //
    
    

  • Hello dear Hareesh,

    Thanks for your advice, and sorry for the long response. I've tried all the ways you mentioned above but unfortunately none of them work as expected. The CPU still halts after the reset, and the GPIO no longer blinks.
    Regarding S3 switch - yes, it's set to jump to Flash.

    Thanks.

  • gpio_ex2_toggle_4.2.zip
    This is my test project where I am trying to blink GPIO pin 26.
    CCS version  12.2.0.

    C200Ware 4.02.00

  • Kostiantyn,

          I tested the code before I sent it to you. I use C2000ware v4_03 and CCS 12.4. I looked at your testcase and it is nearly identical to what I sent you. Please try my code "as is" , after you install C2000ware v4.03.

  • Hello dear Hareesh,

    I installed CCS 12.04 and C2000Ware 4.03, tested your solution on this environment - but it didn't work. The only thing is that I changed the pin number from 22 to 26, because for some reason the oscilloscope is connected to this pin, and this is the only way I can track the behavior (attached below).

    gpio_ex2_toggle_12.04.zip

    CCS 12.04 + C2000Ware 4.03 or CCS 12.02 + C2000Ware 4.02 give the same result.

    Thanks.

  • Kostiantyn,

         I am not sure how I can help you further. I tested the code on the Launchpad and looks like you are using the LP as well. To test this code, you don't even need an oscilloscope, since I am toggling the L.E.D on the LP. I have inserted a pause of 3 seconds every time the device resets. This pause tells you that the device is going through the reset cycle.

  • Ok, I will investigate the issue further. But, thanks for the support anyway!