Other Parts Discussed in Thread: C2000WARE
I'm working on converting a project to use both cores on this device, however I'm having issues getting the GPIOs to work from core 2.
My pin setup is basically as follows:
GPIO_setPadConfig(162, GPIO_PIN_TYPE_STD); GPIO_setPinConfig(GPIO_162_GPIO162); GPIO_setDirectionMode(162, GPIO_DIR_MODE_OUT); GPIO_setMasterCore(162, GPIO_CORE_CPU2);
However running the GPIO_writePin() function from core 2 doesn't seem to work. I tried a few other pins, and also from core 1 and that doesn't seem to work anymore either.
I then decided to try the included LED demo to no success (see below). I set it up so I could use build configurations and defined symbols to target the different cores from the same project (hence the preprocessor define gating).
#include "driverlib.h"
#include "device.h"
#define DEVICE_GPIO_PIN_LED1 59
#define DEVICE_GPIO_PIN_LED2 162
#ifdef CPU1
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// 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);
}
}
#endif
#ifdef CPU2
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);
}
}
#endif
I have the memory map setup so that CPU1 is using GS0 as its .sysmem section and CPU2 is using GS1 as its .system section, if that's worth anything.
Any pointers would be greatly appreciated.
