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.

Building project from scratch for C2000 Launchpad using Code Composer Studio v6

Other Parts Discussed in Thread: TMS320F28027, UNIFLASH, CONTROLSUITE

Hi, using CCS v6 I have successfully debugged the examples for the C2000 Launchpad (Piccolo TMS320F28027) and even loading them to the flash.

Now I am trying to create and develop my own project for the same development board from scratch, but when I create a new project, I am missing a lot of links, configuration files and include options that are presented in the example projects. Also, when I try to build the project, CCS gives me an error related to the .cmd file.

What am I missing? Were the examples developed in a different version of CCS? If there is a good resource to create a project for my specific purpose, please let me know.

Thanks in advance for any help you could provide.

Best regards.

  • Hi,

    You can refer this doc:

    6064.C2000_launchpad_basics.pdf

    Regards,

    Gautam

  • Hi Gautam,

    Thanks a lot of the information, it helped me a lot.

    Btw, do you know if it is possible loading the code to the flash using CCS or it must be done via UniFlash?

    Best regards,
    Gus
  • It can be done using both the softwares.

    Here are the steps to run from flash:
    You need to add these two statements

    MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);
    InitFlash(); after InitPieVectTable();

    Add DSP2802x_MemCopy.c file to the project.

    Define extern variables above main() function.

    extern Uint16 RamfuncsLoadStart;
    extern Uint16 RamfuncsLoadEnd;
    extern Uint16 RamfuncsRunStart;

    Replace 28027_RAM_lnk.cmd with F28027.cmd
    Compile the code.
    Configure your GPIO's to boot to flash.

    Also, you can refer a direct example code present here:
    C:\ti\controlSUITE\device_support\f2802x\v129\DSP2802x_examples_ccsv4\flash_f28027

    Regards,
    Gautam
  • Hi Gautam,

    Thanks for the information, but I followed your directions and it is not working. My guess is the GPIOs to boot the flash are not properly configured. What is the GPIO configuration I have to set to boot the flash?
    I tried booting it using Uniflash, and although it does not give me any error, it does not work.

    Also, I tried to use the GPIO18 to observe the system clock, but it is not working. The configuration I set at the end of the main function is the following:
    GpioCtrlRegs.GPAMUX2.bit.GPIO18 = 3;
    SysCtrlRegs.XCLK.bit.XCLKOUTDIV = 0;
    Do you have any suggestion?

    Again, thank you very much for your help.

    Best regards,
    Gus
  • Here is the GPIO configuration:

    Configure to GetMode

    Regards,

    Gautam

  • Hi Gautam,

    I have followed your directions, but when I tried to program the flash, the project compiles and when I press the button to debug the code, the board can not be connected and the following error is shown:

    Error connecting to the target:
    (Error -1135 @ 0x0)
    The debug probe reported an error. Confirm debug probe configuration and connections, reset the debug probe, and retry the operation.
    (Emulation package 5.1.641.0)

    Any other suggestion? BTW, I am using the connection "Texas Instruments XDS100v2 USB Debug Probe", and I am using CCS v6.

    Thanks again for your time.
    Best regards,
    Gus
  • Gus, the emulator is not able to connect to mcu. Please check the board once. Check continuity; especially JTAG pins.

    Regards,
    Gautam
  • Hi Gautam,

    I check all the connection and it does not seem to be a problem related to that.
    Are the TMS320F28027 reprogrammable? ie, is it possible to reprogram the flash more than one time?

    I am trying to program the example ecap_capture_pwm, ad at the beginning of the main .c file it says:

    // $Boot_Table
    // While an emulator is connected to your device, the TRSTn pin = 1,
    // which sets the device into EMU_BOOT boot mode. In this mode, the
    // peripheral boot modes are as follows:
    //
    // Boot Mode: EMU_KEY EMU_BMODE
    // (0xD00) (0xD01)
    // ---------------------------------------
    // Wait !=0x55AA X
    // I/O 0x55AA 0x0000
    // SCI 0x55AA 0x0001
    // Wait 0x55AA 0x0002
    // Get_Mode 0x55AA 0x0003
    // SPI 0x55AA 0x0004
    // I2C 0x55AA 0x0005
    // OTP 0x55AA 0x0006
    // Wait 0x55AA 0x0007
    // Wait 0x55AA 0x0008
    // SARAM 0x55AA 0x000A <-- "Boot to SARAM"
    // Flash 0x55AA 0x000B
    // Wait 0x55AA Other
    //
    // Write EMU_KEY to 0xD00 and EMU_BMODE to 0xD01 via the debugger
    // according to the Boot Mode Table above. Build/Load project,
    // Reset the device, and Run example
    //
    // $End_Boot_Table

    From the directions that are provided, how can I set the variables EMU_KEY and EMU_BMODE? I am trying to understand more about the whole system, and it seems to me that changing those variables will help me to boot the flash (EMU_BMODE to 0x000B).

    Thanks again for your help.

    Best regards,
    Gus.
  • Gus, I'm really amazed! Yes the C2000 controllers have multiple times programmable Flash :)
    From the directions that are provided, how can I set the variables EMU_KEY and EMU_BMODE?

    This has already been taken care of. You don't have to fiddle with those.
    BTW the code runs from RAM but not from flash right?

    Regards,
    Gautam
  • Hi Gautam,

    After playing with the board for a while, I made the following changes with respect to your directions:

    1. The following functions are set in the beginning of the main function:
    MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);
    InitFlash();

    2. The switch S1 is set ON-ON-ON.

    With those changes it is possible to program the TMS320F28027 with CCS and with UniFlash, and when the board is powered again the code is run from the Flash. I have no idea why, but it works.

    Best regards,
    Gus
  • Excellent Gus! I guess then we can close the topic.

    Goodluck & Regards,
    Gautam