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.

TMS320F28388D: Problem Running Dual Core Blinky Example

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE, TMDSCNCD28388D

Trying to run the dual-core blinky example from

C:\ti\C2000Ware_4_00_00_00\driverlib\f2838x\examples\c28x_dual\led

on the TMDSCNCD28388D control card with program loaded to RAM through Code Composer.

They set up CPU2 to flash LED2 (which is on this control card) by doing this:

// Configure CPU2 to control the LED GPIO
GPIO_setMasterCore(DEVICE_GPIO_PIN_LED2, GPIO_CORE_CPU2);

However, they flash only LED1 by running this code in a loop, and this works to flash LED1:

GPIO_writePin(DEVICE_GPIO_PIN_LED1, 0); // Turns on the LED.
DEVICE_DELAY_US(500000);
GPIO_writePin(DEVICE_GPIO_PIN_LED1, 1 ); // Turns off the LED.


So I tried to flash LED2 by turning it on and off at the same time as LED1 like this:

GPIO_writePin(DEVICE_GPIO_PIN_LED1, 0); // Turns LED1 (this works).
GPIO_writePin(DEVICE_GPIO_PIN_LED2, 0); // To try and turn on LED2. (Does not work.)
DEVICE_DELAY_US(500000);
GPIO_writePin(DEVICE_GPIO_PIN_LED1, 1 ); // Turns off LED1 (this works).
GPIO_writePin(DEVICE_GPIO_PIN_LED2, 1);  // To try and turn off LED2. (Does not work.)

LED1 flashes as expected, but LED2 just stays off.

Note that Project | Build Configurations | Set Active allows me to set only CPU1_RAM or CPU1_FLASH, no option for CPU2, so I set to CPU1_RAM.

What might I be doing wrong here or what am I missing?

Thanks.

  • Hello,

    Just to confirm, you are loading CPU2 with the compiled .out file from the led_ex1_c28x_dual_blinky_cpu2 project, correct? When you open the example file, there should be two versions of the project that open up, a cpu1 and cpu2 version. You need to compile both versions and then start running the program for CPU1. Once you have it started in debug mode (before running it any further in the program), you need to load the program for CPU2 onto the device. This should allow you to control LED2 on CPU2 (since LED2 is designated as controlled by CPU2). Let me know if you have trouble with this.

  • 1. Made project led_ex1_c28x_dual_blinky_cpu1 active.

    2. Did Project | Build Project and got the Console message
    Finished building target: "led_ex1_c28x_dual_blinky_cpu1.out"

    3. Made project led_ex1_c28x_dual_blinky_cpu2 active.

    4. Did Project | Build Project and got the Console message
    Finished building target: "led_ex1_c28x_dual_blinky_cpu2.out"

    5. Made project led_ex1_c28x_dual_blinky_cpu1 active. (Back to cpu1 project)

    6. Did Run | Debug and got dialog box stating:
    "The project led_ex1_c28x_dual_blinky_cpu1 is compatible with multiple CPUs in the target configuration.
    Please select the CPUs to load the program on. This selection will be associated with the active target configuration."

    ___ Texas Instruments XDS100v2 USB Debug Probe_0/C28xx_CPU1
    ___ Texas Instruments XDS100v2 USB Debug Probe_0/C28xx_CPU2

    So I selected the upper choice for CPU1.

    7. Did Run | Load | Load Program and got dialog box with 2 drop-downs:
    C:\Texas_Instruments_workspaces\workspace_ePlex\led_ex1_c28x_dual_blinky_cpu1\CPU1_RAM\led_ex1_c28x_dual_blinky_cpu1.out
    C:\Texas_Instruments_workspaces\workspace_ePlex\led_ex1_c28x_dual_blinky_cpu2\CPU2_RAM\led_ex1_c28x_dual_blinky_cpu2.out

    I selected the lower choice for CPU2, but it does not indicate where the cpu2.out file is being loaded -- CPU1 or CPU2?

    8. Clicked the green Resume (F8) arrow to start the debug run. Did not work. Neither LED lit.

    9. Next just did Run | Debug and got quick dialog box stating,
    Loading Program: C:\Texas_Instruments_wo...U1_RAM\led_ex1_c28x_dual_blinky_cpu1.out
    text: 0 of 8090 at 0xc000(Texas Instruments XDS100v2 USB Debug Probe_0/C28xx_CPU1)

    10. Clicked the green Resume (F8) arrow to start the debug run, and the CPU1 LED1 was flashing per the code in main in the led_ex1_c28x_dual_blinky_cpu1 project, as expected.

    But the LED2 (for CPU2) was just illuminated solid (not blinking), but the code for LED2 is the same as the code for LED1, so I would expect them to blink together the same.

    How do I get the CPU2 code to execute and flash LED2?   LED2 just stays illuminated without blinking.

    UPDATE:

    1. I went back to project led_ex1_c28x_dual_blinky_cpu2 and did Run | Debug and clicked the green Resume (F8) arrow to start the debug run for CPU2. The Code Composer window went white. Could not view Project Explorer or anything. So I exited Code Composer and cycled power on the Control Card (eval board).

    2. Started Code Composer again, activated project led_ex1_c28x_dual_blinky_cpu1, did Run | Debug and clicked the green Resume (F8) arrow and IT WORKED. Both LEDs flashed. I don't know what I did to get it working.



    3. Next I changed the blink rate for the CPU2 LED2 in project led_ex1_c28x_dual_blinky_cpu2 to 5x the blink rate for CPU1 LED1 just to verify that the above was not some coincidence. Next, I did Project | Build Project then Run | Debug and clicked the green Resume (F8) arrow to start the debug run. The Code Composer screen went blank (white)
      BUT IT RAN CORRECTLY: the CPU1 LED1 and CPU2 LED2 both blinked with CPU2 LED2 blinking at the 5x faster rate as expected.
     
      I don't understand what happened.

      What is the correct procedure for doing this?

      How can I combine both CPU1 and CPU2 code in the same project file and load them together at the same time, or do I need to keep CPU1 and CPU2 as separate projects and loads?  How is this done to program Flash?

    Thanks.

  • Hello,

    The steps you've taken seem okay. From step 7, have you also tried right-clicking CPU2 in the debug window (if this window isn't automatically shown, you can open it through View->Debug), and selecting Connect Target before loading the program for CPU2? Loading CPU1 and then doing this step should work, the only step after this would be to run both CPU programs. Additionally, if you are connected to CPU2 via Connect Target, when you go to Run->Load, you should be able to directly select your .out file for CPU2 from the dropdown (I haven't tested doing this with Load Program).

    The issue you have in your update to the post may be caused by the fact that typically you don't start running a program on CPU2, you run CPU1 and load the program onto CPU2. When you ran CPU1 after power cycling and restarting CCS, it may be that the program wasn't erased from the flash for CPU2, so it continued to run independent of CPU1. Let me know if you have any questions about this, and if you get the program to work.

  • Successfully burned the Flash for CPU1 from project led_ex1_c28x_dual_blinky_cpu1 and for CPU2 from project led_ex1_c28x_dual_blinky_cpu2, cycled power and it worked fine. Seems like Code Composer runs better using Flash ("burn and learn") than RAM for development of dual core application.

    Can CPU1 and CPU2 code be combined and compiled to .out files in one project; that is, CPU1 and CPU2 in the same project instead of having these separate projects?

    (Thanks very much for your help!)

  • As far as I understand it, no. The dual cores need to be programmed as 2 separate .out files.