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-F28379D: The flash code is not working after remove the board from the computer and plugin again.

Part Number: LAUNCHXL-F28379D

I flash the code onto the launchpad using CCS v 12.6 using mini USB cable . After remove the board from computer and then Plug the board to the power. But the code is not working. It's get erased. Why? Do I need to change any settings for this

  • Hi,

    There are a few things to check:

    1. Are you using a C2000 software example and is it built for Flash (i.e. flash build config and .cmd file being used)? 
    2. Is the boot mode switch on the LaunchPad configured for flash boot?

    Best,

    Kevin

  • 1. Yah I'm using the C2000 software example
    2. How to do that??

    In S1 switch, all are in High state. Then I change the build configurations to Flash in CCS software. After that I flash the code. The code is successfully uploaded. But I got weird output. While flashing in RAM mode, I got the correct output.

  • Hi,

    . Yah I'm using the C2000 software example

    What example specifically?

    In S1 switch, all are in High state.

    TRST should be set LOW for GetMode (standalone Flash boot).

    ut I got weird output. While flashing in RAM mode, I got the correct output.

    Please explain the weird behavior you see.

    Best,

    Kevin

  • I change the example 'sci_loopback_interrupts_cpu01" as per my requirements. I have attached the code.

    #include "F28x_Project.h"
    
    //
    // Defines
    //
    //#define CPU_FREQ        60E6
    //#define LSPCLK_FREQ     CPU_FREQ/4
    //#define SCI_FREQ        100E3
    //#define SCI_PRD         (LSPCLK_FREQ/(SCI_FREQ*8))-1
    
    //
    // Globals
    //
    //Uint16 sdataA[2];    // Send data for SCI-A
    //Uint16 rdataA[2];    // Received data for SCI-A
    //Uint16 rdata_pointA; // Used for checking the received data
    
    //
    // Function Prototypes
    //
    
    interrupt void sciaRxFifoIsr(void);
    void scia_fifo_init(void);
    
    void SciWrite(Uint16 a);
    //
    // Main
    //
    void main(void)
    {
       //Uint16 i;
    
    //
    // Step 1. Initialize System Control:
    // PLL, WatchDog, enable Peripheral Clocks
    // This example function is found in the F2837xD_SysCtrl.c file.
    //
       InitSysCtrl();
    
    //
    // Step 2. Initialize GPIO:
    // This example function is found in the F2837xD_Gpio.c file and
    // illustrates how to set the GPIO to it's default state.
    //
       InitGpio();
    
    //
    // For this example, only init the pins for the SCI-A port.
    //  GPIO_SetupPinMux() - Sets the GPxMUX1/2 and GPyMUX1/2 register bits
    //  GPIO_SetupPinOptions() - Sets the direction and configuration of the GPIOS
    // These functions are found in the F2837xD_Gpio.c file.
    //
         GPIO_SetupPinMux(43, GPIO_MUX_CPU1, 0xF);
         GPIO_SetupPinOptions(43, GPIO_INPUT, GPIO_PUSHPULL);
         GPIO_SetupPinMux(42, GPIO_MUX_CPU1, 0xF);
         GPIO_SetupPinOptions(42, GPIO_OUTPUT, GPIO_ASYNC);
    //
    // Step 3. Clear all interrupts and initialize PIE vector table:
    // Disable CPU interrupts
    //
       DINT;
    
    //
    // Initialize PIE control registers to their default state.
    // The default state is all PIE interrupts disabled and flags
    // are cleared.
    // This function is found in the F2837xD_PieCtrl.c file.
    //
       InitPieCtrl();
    
    //
    // Disable CPU interrupts and clear all CPU interrupt flags:
    //
       IER = 0x0000;
       IFR = 0x0000;
    
    //
    // Initialize the PIE vector table with pointers to the shell Interrupt
    // Service Routines (ISR).
    // This will populate the entire table, even if the interrupt
    // is not used in this example.  This is useful for debug purposes.
    // The shell ISR routines are found in F2837xD_DefaultIsr.c.
    // This function is found in F2837xD_PieVect.c.
    //
       InitPieVectTable();
    
    //
    // Interrupts that are used in this example are re-mapped to
    // ISR functions found within this file.
    //
       EALLOW;  // This is needed to write to EALLOW protected registers
       PieVectTable.SCIA_RX_INT = &sciaRxFifoIsr;
       EDIS;    // This is needed to disable write to EALLOW protected registers
    
    //
    // Step 4. Initialize the Device Peripherals:
    //
       scia_fifo_init();  // Init SCI-A
    
    //
    // Step 5. User specific code, enable interrupts:
    //
    // Init send data.  After each transmission this data
    // will be updated for the next transmission
    //
    
    
    //
    // Enable interrupts required for this example
    //
       PieCtrlRegs.PIECTRL.bit.ENPIE = 1;   // Enable the PIE block
       PieCtrlRegs.PIEIER9.bit.INTx1 = 1;   // PIE Group 9, INT1
       PieCtrlRegs.PIEIER9.bit.INTx2 = 1;   // PIE Group 9, INT2
       IER |= PIEACK_GROUP9;                        // Enable CPU INT
       EINT;
       SciWrite(0x33);
    //
    // Step 6. IDLE loop. Just sit and loop forever (optional):
    //
        for(;;);
    }
    
    //
    // error - Function to halt debugger on error
    //
    
    
    //
    // sciaTxFifoIsr - SCIA Transmit FIFO ISR
    //
    
    
    //
    // sciaRxFifoIsr - SCIA Receive FIFO ISR
    //
    interrupt void sciaRxFifoIsr(void)
    {
        Uint16 ReceivedChar = SciaRegs.SCIRXBUF.all;
    
        SciWrite(ReceivedChar);
    
    
    
        SciaRegs.SCIFFRX.bit.RXFFOVRCLR=1;   // Clear Overflow flag
        SciaRegs.SCIFFRX.bit.RXFFINTCLR=1;   // Clear Interrupt flag
    
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP9;
    }
    
    //
    // scia_fifo_init - Configure SCIA FIFO
    //
    void scia_fifo_init()
    {
       SciaRegs.SCICCR.all = 0x0007;      // 1 stop bit,  No loopback
                                          // No parity,8 char bits,
                                          // async mode, idle-line protocol
       SciaRegs.SCICTL1.all = 0x0003;     // enable TX, RX, internal SCICLK,
                                          // Disable RX ERR, SLEEP, TXWAKE
       //SciaRegs.SCICTL2.bit.TXINTENA = 1;
       SciaRegs.SCICTL2.bit.RXBKINTENA = 1;
       SciaRegs.SCIHBAUD.all = 0x0000;
       SciaRegs.SCILBAUD.all = 0x0036;
       //SciaRegs.SCICCR.bit.LOOPBKENA = 1; // Enable loop back
       //SciaRegs.SCIFFTX.all = 0xC022;
       SciaRegs.SCIFFRX.all = 0x0022;
       SciaRegs.SCIFFCT.all = 0x00;
    
       SciaRegs.SCICTL1.all = 0x0023;     // Relinquish SCI from Reset
       //SciaRegs.SCIFFTX.bit.TXFIFORESET = 1;
       SciaRegs.SCIFFRX.bit.RXFIFORESET = 1;
    }
    
    void SciWrite(Uint16 a){
    
        while(SciaRegs.SCICTL2.bit.TXRDY != 1) {}
        SciaRegs.SCITXBUF.all = a;
    }
    
    //
    // End of file
    //
    

    I change the S1 Switch key as per in the following. 1 and 2 are HIGH state, 3 is LOW state.

    After that I flash the code but I get the following error.

  • Hi,

    I thought you were trying to run in standalone mode from Flash. Why are you still trying to connect in CCS after flashing the program once?

    If TRST is low then you will not be able to connect with CCS, you need to be in emulation mode for that.

    Best,

    Kevin

  • I couldn't get you. I haven't successfully flash the program to launchpad. While flashing, I got that previous error. Can you explain me how to do standalone mode?

  • Hi Afkar,

    If you are getting that error, please try checking the JTAG debugger connection issues page in the 'Device Register' section and let me know if the information there is able to help you resolve this. 

    Best Regards,

    Allison