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.

TMS320F28386S: Unexpected behavior

Part Number: TMS320F28386S
Other Parts Discussed in Thread: C2000WARE

The code below runs as expected with the last line (SysCtl_resetDevice) disabled. when I disconnect and reconnect the board  the same code runs which I expected as I have the build config set to CPU1_LAUNCHXL_FLASH.

When I enable the last line the code runs right the first time but when I disconnect and reconnect the board another version of code runs and I do not have the serial programmer set up. From where is it running?

I am using CCS11 and C2000Ware_4_01_00_00 per dictate as the manager did not want to switch anything midstream.

Thanks,

John

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


#include "driverlib.h"
#include "device.h"


#pragma RETAIN(otp_z1_data)
#pragma DATA_SECTION(otp_z1_data,"dcsm_zsel_z1");
const long otp_z1_data = 0x5AFFFF39;
#pragma RETAIN(otp_z1_data_2)
#pragma DATA_SECTION(otp_z1_data_2,"dcsm_zsel_z1_2");
const long otp_z1_data_2 = 0xFFFF0103;

void main(void)
{
    Device_init();

    Device_initGPIO();
    GPIO_setPadConfig(DEVICE_GPIO_PIN_LED2, GPIO_PIN_TYPE_STD);
    GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED2, GPIO_DIR_MODE_OUT);

    Interrupt_initModule();
    Interrupt_initVectorTable();
    EINT;
    ERTM;

    int i;

    for(i = 0; i < 3; i++)
    {
        GPIO_writePin(DEVICE_GPIO_PIN_LED2, 1);
        DEVICE_DELAY_US(500000);
        GPIO_writePin(DEVICE_GPIO_PIN_LED2, 0);
        DEVICE_DELAY_US(500000);
    }

    //GPIO_setPadConfig(57, GPIO_PIN_TYPE_STD);
    //GPIO_setDirectionMode(57, GPIO_DIR_MODE_IN);

    //i = GPIO_readPin(57);

    //SysCtl_resetDevice();
}


  • Hi John,

    i tried reproducing the issue, but i was able to get the code run fine and it was coming back to main even after i disconnected and reconnected from board (when SysCtl_resetDevice was enabled). The LED was blinking continuously when i tried. Could you tell me, what you meant from 'another version of code runs'?  Was the LED blinking continuously from your side, when you enabled the SysCtl_resetDevice  function and you did a disconnect and reconnect the board?

    Thanks,

    Aswin 

  • Thanks for replying.

    DOH, just call me Homer. The joke is on me. It was happening with the last line enabled and it was resetting so fast there was no apparent gap in the groups of 3 flashes. I added three  red blinks with a 2 second gap between red and green blinks and it became apparent that it was the same code running.

    Duh me. It is amazing how much a few hours of sleep helps.

    Sorry to waste your time...

    John