Part Number: TMS320F28377D
Other Parts Discussed in Thread: UNIFLASH
Tool/software:
This should be the most basic question, but I am stumped. I want cpu2 to toggle GPIO44.
On cpu2, I have:
#include "F28x_Project.h"#include "F2837xD_device.h"#include "F2837xD_Gpio.h"
void main(void){InitSysCtrl();
//// cpu1 will give us this pin: let's toggle one line at a time to watch in debugger//
GpioDataRegs.GPBSET.bit.GPIO44 = 1;GpioDataRegs.GPBSET.bit.GPIO44 = 0;GpioDataRegs.GPBSET.bit.GPIO44 = 1;GpioDataRegs.GPBSET.bit.GPIO44 = 0;
//// Or try a simple blink loop with toggle://for(;;){GpioDataRegs.GPBTOGGLE.bit.GPIO44 = 1;DELAY_US(10000); // 10 000 µs = 0.01 s at 200 MHz SYSCLK}}
But obviously I need to start with cpu1 first to get hold of that pin, so I have:
#include "F28x_Project.h"#include "F2837xD_Ipc.h"#include "F2837xD_device.h"#include "F2837xD_GlobalPrototypes.h"#include "F2837xD_Gpio_defines.h"#include "F2837xD_Ipc_drivers.h"
static void BootCPU2_FromFlash(void){EALLOW;IpcRegs.IPCBOOTSTS = 0; // clear stale boot status flagsIPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);EDIS;}
void main(void){InitSysCtrl();
EALLOW;DevCfgRegs.CPU2RESCTL.bit.RESET = 1; // make sure CPU2 is held in resetEDIS;
InitGpio();
EALLOW;GpioCtrlRegs.GPBMUX1.bit.GPIO44 = 0; // detach from any peripheralGpioCtrlRegs.GPBDIR.bit.GPIO44 = 1; // enable for outputGpioDataRegs.GPBSET.bit.GPIO44 = 1; // turn on just to check scopeGpioCtrlRegs.GPBCSEL2.bit.GPIO44 = 1; // hand over to CPU2 owns GPIO44GpioDataRegs.GPBTOGGLE.bit.GPIO44 = 1; // should not toggleEDIS;
// Basic interrupt/PIE init DINT;InitPieCtrl();IER = 0x0000;IFR = 0x0000;InitPieVectTable();EINT
// Minimal flash wait state init for CPU1 codeInitFlash();
// Do the bootBootCPU2_FromFlash();
// CPU1 go idlefor(;;) { asm(" NOP"); }}
when cpu1 fires up, I see GPIO44 rise on the scope and once GPBCSEL2 is set then the subsequent call to GPBTOGGLE does nothing, which is appropriate. When I then boot cpu2 I do see GPI044 drop to zero which is intriguing, (but I guess ok ?). But no matter what I do from inside cpu2, I cant get the pin to budge. I also tried setting GPBGMUX1 to zero.
What am I missing? Thanks.
(I am using compiler 20.4 if it is pertinent. I get the same behaviour if I load the code with CCS or Uniflash.)