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.

TMS320F28375D reconfiguration after booting CPU2



Hi,


Is any reconfiguration of pins, registers, etc required after booting CPU2 from CPU1?

I have an application that resides in an EEPROM and I set the DCSM OTP BOOTCTRL register in CPU1 to boot from it from SPI.

CPU1 boots from the EEPROM then sends an IPC command to boot CPU2 from the same EEPROM and the application knows which CPU it's running on and behaves differently.

Right now, the CPU2 part just blinks an LED while the CPU1 part allows downloading a new image into the EEPROM.

The issue I am having is that CPU1 cannot access the EEPROM after CPU2 has booted. The SPI pins aren't wiggling like they should, which leads me to believe that I need to reconfigure them, which I have tried unsuccessfully to do.


The SPI accesses work when just running the CPU1 part, so the problem only occurs when CPU2 is running.

Here's the related code:

  //SPI-A connected to CPU02
  DevCfgRegs.CPUSEL6.bit.SPI_A = 1;
  //Allows CPU02 bootrom to take control of clock configuration registers
  ClkCfgRegs.CLKSEM.all = 0xA5A50000;

  // configure GPIO SPI pins for CPU2
  blGpioSetupPinOptions(EE_SPI_SIMO_PIN, GPIO_OUTPUT, GPIO_PUSHPULL);
  blGpioSetupPinMux(EE_SPI_SIMO_PIN, GPIO_MUX_CPU2, GPIO58_SPISIMOA);

  blGpioSetupPinOptions(EE_SPI_SOMI_PIN, GPIO_INPUT, GPIO_ASYNC);
  blGpioSetupPinMux(EE_SPI_SOMI_PIN, GPIO_MUX_CPU2, GPIO59_SPISOMIA);

  blGpioSetupPinOptions(EE_SPI_CLK_PIN, GPIO_OUTPUT, GPIO_PUSHPULL);
  blGpioSetupPinMux(EE_SPI_CLK_PIN, GPIO_MUX_CPU2, GPIO60_SPICLKA);

  GpioDataRegs.GPBDAT.bit.AFE_EE_SPI_CSn_BIT = 1; // default to high
  blGpioSetupPinOptions(EE_SPI_CSn_PIN, GPIO_OUTPUT, GPIO_PUSHPULL);
  blGpioSetupPinMux(EE_SPI_CSn_PIN, GPIO_MUX_CPU2, GPIO61_GPIO);

  //CPU01 to CPU02 IPC Boot Mode Register (SPI)
  IpcRegs.IPCBOOTMODE = 0x4;
  // CPU01 To CPU02 IPC Command Register
  IpcRegs.IPCSENDCOM  = 19;
  // CPU01 to CPU02 IPC flag register
  IpcRegs.IPCSET.all = 0x80000001;

  //SPI-A connected to CPU01
  DevCfgRegs.CPUSEL6.bit.SPI_A = 0;
  //Allows CPU01 to take control of clock configuration registers
  ClkCfgRegs.CLKSEM.all = 0xA5A50002;

  // Set GPIO SPI pins back to CPU1
  blGpioSetupPinOptions(AFE_EE_SPI_SIMO_PIN, GPIO_OUTPUT, GPIO_PUSHPULL);
  blGpioSetupPinMux(AFE_EE_SPI_SIMO_PIN, GPIO_MUX_CPU1, GPIO58_SPISIMOA);

  blGpioSetupPinOptions(AFE_EE_SPI_SOMI_PIN, GPIO_INPUT, GPIO_ASYNC);
  blGpioSetupPinMux(AFE_EE_SPI_SOMI_PIN, GPIO_MUX_CPU1, GPIO59_SPISOMIA);

  blGpioSetupPinOptions(AFE_EE_SPI_CLK_PIN, GPIO_OUTPUT, GPIO_PUSHPULL);
  blGpioSetupPinMux(AFE_EE_SPI_CLK_PIN, GPIO_MUX_CPU1, GPIO60_SPICLKA);

  GpioDataRegs.GPBDAT.bit.AFE_EE_SPI_CSn_BIT = 1; // default to high
  blGpioSetupPinOptions(AFE_EE_SPI_CSn_PIN, GPIO_OUTPUT, GPIO_PUSHPULL);
  blGpioSetupPinMux(AFE_EE_SPI_CSn_PIN, GPIO_MUX_CPU1, GPIO61_GPIO);

Is there anything i'm doing wrong or need to do in addition to this?

  • Hi Taylor,

    Couple of questions -

    You are configuring the PINMUC for SPI two times. Are you resetting the configuration in-between hence you need to reconfigure the pinmux? If not then IInd pinmux configuration is not needed. Also if pinmux setting has not been reset then writing to GPBDAT register (iind time) will not take effect because this pin has been configured as SPI pin. 

    Also CPUSEL register is EALLOW protected.  I don't see EALLOW instruction in this code. Is this taken care of?

    Regards,

    Vivek Singh

  • Hi Vivek,

    The CPUSEL was the culprit. There is an EALLOW in the top of the function that this code is in, but setting the CPUSEL back to CPU1 didn't take effect. I realized there's also EALLOW and EDIS in the GPIOSetup functions so I think those interfered with the one in this function.

    Putting an EALLOW before setting the CPUSEL back to CPU1 works.

    Thanks for your help,

    - Taylor