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.

TMS320F28379D: Regarding GPIO run by CPU2

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

I am working on a project in which need to use both CPU of above MCU. while I have configure the pin GPIO 57 owner by CPU2. 

it run ok as output pin , but when i change the pin direction and check the pin as input , it is not working. Always it gives 1 .  and I checked the actual value on pin is low. 

I also check this using CPU1 where it works fine both input and output were ok.

What would be the possible reason to not work as input whiled owned by CPU2. 

I also providing you the code for reference. 

#define                               TEST4_GPIO_CFG                           GPIO_57_GPIO57
#define                               TEST4_GPIO_PIN                              57U

CPU1 GPIO configuration  : 

 GPIO_writePin(TEST4_GPIO_PIN, 0);
 GPIO_setPinConfig(TEST4_GPIO_CFG);
 GPIO_setDirectionMode(TEST4_GPIO_PIN, GPIO_DIR_MODE_IN);
 GPIO_setPadConfig(TEST4_GPIO_PIN, GPIO_PIN_TYPE_STD);
 GPIO_setQualificationMode(TEST4_GPIO_PIN, GPIO_QUAL_ASYNC);
 GPIO_setMasterCore(TEST4_GPIO_PIN, GPIO_CORE_CPU2);

CPU2 checking the GPIO for high / Low

for(;;)
{
//
// Turn on LED
//

Read_57 = GPIO_readPin(57);
//
// Delay for a bit.
//
DEVICE_DELAY_US(500000);
//
// Turn off LED
//

//
// Delay for a bit.
//
DEVICE_DELAY_US(500000);
}

/*

where the Read_57  is a 32 bit variable that giving me always 0x01.

*/

Please make me correct if I am wrong.

Ashutosh Bhatt

  • What is CPU1 doing after the initialization is done?

  • CPU1 goes into infinite while loop simply.

    while(1)

    {}

    do you expect some thing else ??

    Ashutosh Bhatt

  • No I was just making sure it's not resetting/doing anything else that would reverse this.

    Nima

  • I just have taken the example from driverlib named ..C:\ti\c2000\C2000Ware_3_03_00_00\driverlib\f2837xd\examples\dual\led. 

    And add a extra pin GPIO57 as input for CPU2. 

    When did as the pin output it works ok but when make the pin as input , not working. If you favor me that just make a pin as input in your setup and share me the file or project. for core 2 . it would be very helpful to me. 

    I know that issue is very silly but I am not able to find that where I am going wrong. Even I am sharing you the code file for both CPU. 

    Ashutosh 

    //#############################################################################
    //
    // FILE:   led_ex1_blinky_cpu1.c
    //
    // TITLE:  LED Blinky Example
    //
    //! \addtogroup driver_dual_example_list
    //! <h1> LED Blinky Example</h1>
    //!
    //! This example demonstrates how to blink a LED using CPU1 and blink another
    //! LED using CPU2 (led_ex1_blinky_cpu2.c).
    //!
    //! \b External \b Connections \n
    //!  - None.
    //!
    //! \b Watch \b Variables \n
    //!  - None.
    //!
    //
    //#############################################################################
    // $TI Release: F2837xD Support Library v3.11.00.00 $
    // $Release Date: Sun Oct  4 15:55:24 IST 2020 $
    // $Copyright:
    // Copyright (C) 2013-2020 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"
    
    //
    // Main
    //
    void main(void)
    {
        //
        // Initialize device clock and peripherals
        //
        Device_init();
    
    #ifdef _STANDALONE
    #ifdef _FLASH
        //
        // Send boot command to allow the CPU2 application to begin execution
        //
        Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);
    #else
        //
        // Send boot command to allow the CPU2 application to begin execution
        //
        Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_RAM);
    
    #endif // _FLASH
    #endif // _STANDALONE
    
        //
        // Initialize GPIO and configure the GPIO pin as a push-pull output
        //
        Device_initGPIO();
        GPIO_setPadConfig(DEVICE_GPIO_PIN_LED1, GPIO_PIN_TYPE_STD);
        GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED1, GPIO_DIR_MODE_OUT);
        GPIO_setPadConfig(DEVICE_GPIO_PIN_LED2, GPIO_PIN_TYPE_STD);
        GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED2, GPIO_DIR_MODE_OUT);
    
        //
        // Configure CPU2 to control the LED GPIO
        //
        GPIO_setMasterCore(DEVICE_GPIO_PIN_LED2, GPIO_CORE_CPU2);
    
        //
        // Initialize PIE and clear PIE registers. Disables CPU interrupts.
        //
        Interrupt_initModule();
    
        //
        // Initialize the PIE vector table with pointers to the shell Interrupt
        // Service Routines (ISR).
        //
        Interrupt_initVectorTable();
    
        //
        // Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
        //
        EINT;
        ERTM;
    
        //
        // Loop Forever
        //
        for(;;)
        {
            //
            // Turn on LED
            //
            GPIO_writePin(DEVICE_GPIO_PIN_LED1, 0);
    
            //
            // Delay for a bit.
            //
            DEVICE_DELAY_US(500000);
    
            //
            // Turn off LED
            //
            GPIO_writePin(DEVICE_GPIO_PIN_LED1, 1);
    
            //
            // Delay for a bit.
            //
            DEVICE_DELAY_US(500000);
        }
    }
    
    //
    // End of File
    //
    
    //#############################################################################
    //
    // FILE:   led_ex1_blinky_cpu2.c
    //
    // TITLE:  LED Blinky Example
    //
    // <h1> LED Blinky Example (CPU2) </h1>
    //
    // This example demonstrates how to blink a LED using CPU2.
    //
    // \b External \b Connections \n
    //  - None.
    //
    // \b Watch \b Variables \n
    //  - None.
    //
    //
    //#############################################################################
    // $TI Release: F2837xD Support Library v3.11.00.00 $
    // $Release Date: Sun Oct  4 15:55:24 IST 2020 $
    // $Copyright:
    // Copyright (C) 2013-2020 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"
    
    //
    // Main
    //
    void main(void)
    {
        //
        // Initialize device clock and peripherals
        //
        Device_init();
    
        //
        // Initialize GPIO and configure the GPIO pin as a push-pull output
        //
        // This is configured by CPU1
    
        //
        // Initialize PIE and clear PIE registers. Disables CPU interrupts.
        //
        Interrupt_initModule();
    
        //
        // Initialize the PIE vector table with pointers to the shell Interrupt
        // Service Routines (ISR).
        //
        Interrupt_initVectorTable();
    
        //
        // Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
        //
        EINT;
        ERTM;
    
        //
        // Loop Forever
        //
        for(;;)
        {
            //
            // Turn on LED
            //
            GPIO_writePin(DEVICE_GPIO_PIN_LED2, 0);
    
            //
            // Delay for a bit.
            //
            DEVICE_DELAY_US(500000);
    
            //
            // Turn off LED
            //
            GPIO_writePin(DEVICE_GPIO_PIN_LED2, 1);
    
            //
            // Delay for a bit.
            //
            DEVICE_DELAY_US(500000);
        }
    }
    
    //
    // End of File
    //
    

  • I just have taken the example from driverlib named ..C:\ti\c2000\C2000Ware_3_03_00_00\driverlib\f2837xd\examples\dual\led. 

    And add a extra pin GPIO57 as input for CPU2. 

    When did as the pin output it works ok but when make the pin as input , not working. If you favor me that just make a pin as input in your setup and share me the file or project. for core 2 . it would be very helpful to me. 

    I know that issue is very silly but I am not able to find that where I am going wrong. Even I am sharing you the code file for both CPU. 

    Ashutosh 

    //#############################################################################
    //
    // FILE:   led_ex1_blinky_cpu1.c
    //
    // TITLE:  LED Blinky Example
    //
    //! \addtogroup driver_dual_example_list
    //! <h1> LED Blinky Example</h1>
    //!
    //! This example demonstrates how to blink a LED using CPU1 and blink another
    //! LED using CPU2 (led_ex1_blinky_cpu2.c).
    //!
    //! \b External \b Connections \n
    //!  - None.
    //!
    //! \b Watch \b Variables \n
    //!  - None.
    //!
    //
    //#############################################################################
    // $TI Release: F2837xD Support Library v3.11.00.00 $
    // $Release Date: Sun Oct  4 15:55:24 IST 2020 $
    // $Copyright:
    // Copyright (C) 2013-2020 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"
    
    //
    // Main
    //
    void main(void)
    {
        //
        // Initialize device clock and peripherals
        //
        Device_init();
    
    #ifdef _STANDALONE
    #ifdef _FLASH
        //
        // Send boot command to allow the CPU2 application to begin execution
        //
        Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);
    #else
        //
        // Send boot command to allow the CPU2 application to begin execution
        //
        Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_RAM);
    
    #endif // _FLASH
    #endif // _STANDALONE
    
        //
        // Initialize GPIO and configure the GPIO pin as a push-pull output
        //
        Device_initGPIO();
        GPIO_setPadConfig(DEVICE_GPIO_PIN_LED1, GPIO_PIN_TYPE_STD);
        GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED1, GPIO_DIR_MODE_OUT);
        GPIO_setPadConfig(DEVICE_GPIO_PIN_LED2, GPIO_PIN_TYPE_STD);
        GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED2, GPIO_DIR_MODE_OUT);
    
        //
        // Configure CPU2 to control the LED GPIO
        //
        GPIO_setMasterCore(DEVICE_GPIO_PIN_LED2, GPIO_CORE_CPU2);
    
        //
        // Initialize PIE and clear PIE registers. Disables CPU interrupts.
        //
        Interrupt_initModule();
    
        //
        // Initialize the PIE vector table with pointers to the shell Interrupt
        // Service Routines (ISR).
        //
        Interrupt_initVectorTable();
    
        //
        // Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
        //
        EINT;
        ERTM;
    
        //
        // Loop Forever
        //
        for(;;)
        {
            //
            // Turn on LED
            //
            GPIO_writePin(DEVICE_GPIO_PIN_LED1, 0);
    
            //
            // Delay for a bit.
            //
            DEVICE_DELAY_US(500000);
    
            //
            // Turn off LED
            //
            GPIO_writePin(DEVICE_GPIO_PIN_LED1, 1);
    
            //
            // Delay for a bit.
            //
            DEVICE_DELAY_US(500000);
        }
    }
    
    //
    // End of File
    //
    
    //#############################################################################
    //
    // FILE:   led_ex1_blinky_cpu2.c
    //
    // TITLE:  LED Blinky Example
    //
    // <h1> LED Blinky Example (CPU2) </h1>
    //
    // This example demonstrates how to blink a LED using CPU2.
    //
    // \b External \b Connections \n
    //  - None.
    //
    // \b Watch \b Variables \n
    //  - None.
    //
    //
    //#############################################################################
    // $TI Release: F2837xD Support Library v3.11.00.00 $
    // $Release Date: Sun Oct  4 15:55:24 IST 2020 $
    // $Copyright:
    // Copyright (C) 2013-2020 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"
    
    //
    // Main
    //
    void main(void)
    {
        //
        // Initialize device clock and peripherals
        //
        Device_init();
    
        //
        // Initialize GPIO and configure the GPIO pin as a push-pull output
        //
        // This is configured by CPU1
    
        //
        // Initialize PIE and clear PIE registers. Disables CPU interrupts.
        //
        Interrupt_initModule();
    
        //
        // Initialize the PIE vector table with pointers to the shell Interrupt
        // Service Routines (ISR).
        //
        Interrupt_initVectorTable();
    
        //
        // Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
        //
        EINT;
        ERTM;
    
        //
        // Loop Forever
        //
        for(;;)
        {
            //
            // Turn on LED
            //
            GPIO_writePin(DEVICE_GPIO_PIN_LED2, 0);
    
            //
            // Delay for a bit.
            //
            DEVICE_DELAY_US(500000);
    
            //
            // Turn off LED
            //
            GPIO_writePin(DEVICE_GPIO_PIN_LED2, 1);
    
            //
            // Delay for a bit.
            //
            DEVICE_DELAY_US(500000);
        }
    }
    
    //
    // End of File
    //
    

  • I can take a look. Give me a bit of time. I am currently working on other projects.

  • It works perfectly fine...

  • CPU1 code:

    //#############################################################################
    //
    // FILE:   led_ex1_blinky_cpu1.c
    //
    // TITLE:  LED Blinky Example
    //
    //! \addtogroup driver_dual_example_list
    //! <h1> LED Blinky Example</h1>
    //!
    //! This example demonstrates how to blink a LED using CPU1 and blink another
    //! LED using CPU2 (led_ex1_blinky_cpu2.c).
    //!
    //! \b External \b Connections \n
    //!  - None.
    //!
    //! \b Watch \b Variables \n
    //!  - None.
    //!
    //
    //#############################################################################
    // $TI Release: F2837xD Support Library v3.12.00.00 $
    // $Release Date: Fri Feb 12 19:03:23 IST 2021 $
    // $Copyright:
    // Copyright (C) 2013-2021 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"
    
    //
    // Main
    //
    void main(void)
    {
        //
        // Initialize device clock and peripherals
        //
        Device_init();
    
    #ifdef _STANDALONE
    #ifdef _FLASH
        //
        // Send boot command to allow the CPU2 application to begin execution
        //
        Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);
    #else
        //
        // Send boot command to allow the CPU2 application to begin execution
        //
        Device_bootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_RAM);
    
    #endif // _FLASH
    #endif // _STANDALONE
    
        //
        // Initialize GPIO and configure the GPIO pin as a push-pull output
        //
        Device_initGPIO();
        GPIO_setPadConfig(DEVICE_GPIO_PIN_LED1, GPIO_PIN_TYPE_STD);
        GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED1, GPIO_DIR_MODE_OUT);
        GPIO_setPadConfig(0, GPIO_PIN_TYPE_PULLUP);
        GPIO_setDirectionMode(0, GPIO_DIR_MODE_IN);
    
        //
        // Configure CPU2 to control the LED GPIO
        //
        GPIO_setMasterCore(DEVICE_GPIO_PIN_LED1, GPIO_CORE_CPU2);
        GPIO_setMasterCore(0, GPIO_CORE_CPU2);
    
        //
        // Initialize PIE and clear PIE registers. Disables CPU interrupts.
        //
        Interrupt_initModule();
    
        //
        // Initialize the PIE vector table with pointers to the shell Interrupt
        // Service Routines (ISR).
        //
        Interrupt_initVectorTable();
    
        //
        // Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
        //
        EINT;
        ERTM;
    
        //
        // Loop Forever
        //
        for(;;)
        {
            //
            // Delay for a bit.
            //
            DEVICE_DELAY_US(500000);
        }
    }
    
    //
    // End of File
    //
    

  • CPU2 code

    //#############################################################################
    //
    // FILE:   led_ex1_blinky_cpu2.c
    //
    // TITLE:  LED Blinky Example
    //
    // <h1> LED Blinky Example (CPU2) </h1>
    //
    // This example demonstrates how to blink a LED using CPU2.
    //
    // \b External \b Connections \n
    //  - None.
    //
    // \b Watch \b Variables \n
    //  - None.
    //
    //
    //#############################################################################
    // $TI Release: F2837xD Support Library v3.12.00.00 $
    // $Release Date: Fri Feb 12 19:03:23 IST 2021 $
    // $Copyright:
    // Copyright (C) 2013-2021 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"
    
    //
    // Main
    //
    void main(void)
    {
        //
        // Initialize device clock and peripherals
        //
        Device_init();
    
        //
        // Initialize GPIO and configure the GPIO pin as a push-pull output
        //
        // This is configured by CPU1
    
        //
        // Initialize PIE and clear PIE registers. Disables CPU interrupts.
        //
        Interrupt_initModule();
    
        //
        // Initialize the PIE vector table with pointers to the shell Interrupt
        // Service Routines (ISR).
        //
        Interrupt_initVectorTable();
    
        //
        // Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
        //
        EINT;
        ERTM;
    
        //
        // Loop Forever
        //
        for(;;)
        {
            //
            // Turn on LED
            //
            GPIO_writePin(DEVICE_GPIO_PIN_LED1, GPIO_readPin(0));
    
            //
            // Delay for a bit.
            //
            DEVICE_DELAY_US(500000);
        }
    }
    
    //
    // End of File
    //
    

  • Just ran this on my launchpad. The LED and GPIO0(Input both controlled by CPU2). The LED follows GPIO0 input perfectly.

    Please click the verify answer green button on all posts for code and this response.

    Nima

  • Yes it works fine. Main issue is resolved. 

    But what happened actually I am not able to debug on CCS 10 for core 2. The first core stuck for response for the other core. 

    when I exit the debug session and reset manually the controller it started working. 

    So how can I debug the core 2 from CCS now this is the issue for that I will raise the new thread or some you guide me in same thread ? 

    Ashutosh

  • Debug your CPU1 project notmally. Then while the core is running, connect to CPU2, load the code and run. I did this yesterday on my Launchpad and everything works. You connect and run to both in one debug run.

    Nima