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.

Slave Boot – Booting From an External Master Host SPI0 SLAVE

Hi

I am trying to boot Dsp from as a slave device as mentioned in the boot section

7 of Using the OMAP-L1x7 Bootloader

I am trying to implement the protocol that is as specified in the datasheet,which says

  • Start-word synchronization (SWS),
  • Ping Op-code synchronization (POS) and
  • Op-code synchronization (OS).
  • Needs to be implemented 
  • I have a Mcu controller that acts as a Master(MCUSM470RIBIM)  & DSP OMAPL137
  • Dsp is selected to boot from spi slave 0 and corresponding pins on the line is set accordingly
  • On the Mcu side our application tries to communicate with ,HERE (on MCU SPI2) that is connected to SPI0 SLAVE ON DSP
  • The clock frequency of spiclock on MCU is 1 MHZ    
  • the following is the implementation done on MCU side to send the XMT_START and recieve RCV_START
///////////////////////////

#define XMT_START_H 0X5853   ----->opcode to send start transfer

#define RECV_START     0X5253  ----->opcode received Ack  
while(1)
{ 
for(x=0;x<1;x++) // TRYING TO TRANSFER ONCE 
{
sleep(400000);  //THIS PROVIDES A DELAY OF 2SEC i am changing the delays and checking for 50usec to 1sec between each command processing
sws_value = sws_synchronisaton_spi2(0x5853);  TRYING TO WRITE THE VALUE OF XMT_START
send_int(sws_value);// PRINT THE VALUE ON CONSOLE
}
if(sws_value == RECV_START)
{
break;
}
for(x=0;x<1;x++)
{
sleep(200000); 
sws_value = sws_synchronisaton_spi2(0xFFFF);   /// TRYING TO READ BACK IF DATA IS PRESENT BY WRITING FFFF SO THAT IT DOESENT STARTING PROCESSING AGAIN THINKING ITS 0X5853
send_int(sws_value);
}
if(sws_value == RECV_START)
{
break;
}
sleep(200);
}

 //////////////////////////
int sws_synchronisaton_spi2(unsigned short cmd_data)
{
int val;
int i;
unsigned short data = 0;
//------------------------------------------------------------------------------------ 
SPI2PC3 &= 0xFFEF; // CS Pin is made LOW 
for(i=0;i<1;i++)
{
SPI2DAT1 = cmd_data; // This is just a dummy read. No affect on this
sleep(5);
}
// SPI2PC3 |= 0x0010; // CS Pin is made HIGH*/
// sleep(5);
//------------------------------------------------------------------------------------*/ 

//-------------------------------------------------------------------------------------- 
// SPI2PC3 &= 0xFFEF; // CS Pin is made LOW
sleep(5);
while(!(SPI2CTRL3_bit.RXINTFLAG & 0x1));
data = SPI2BUF;
sleep(50);
SPI2PC3 |= 0x0010; // CS Pin is made HIGH
return data;
}

 I am changing the delays and checking for 50usec to 1sec between each command processing

I have searched different forums and different approach for sending the command 0x5853 IN FOR AND WHILE LOOP and receiving I always end up in 0XFFFF

  Here i am trying to send the the XMT_START 0X5853 which has to be transmitted and receive  RECV_START 0x5253

I am able to send the data on the MOSI line (MASTER OUT SLAVE IN)  and the proper value appears on CRO but I am not able to get back any response

from the DSP it always gives 0XFFFF as output .

I have also refereed to the atuil.cs file that does   the uART  transmission,

 What could be the proper approach ?

Where could i be going wrong??

  • Hi

    I am trying to boot Dsp from as a slave device as mentioned in the boot section

    7 of Using the OMAP-L1x7 Bootloader

    I am trying to implement the protocol that is as specified in the datasheet,which says

    • Start-word synchronization (SWS),
    • Ping Op-code synchronization (POS) and
    • Op-code synchronization (OS).
    • Needs to be implemented 
    • I have a Mcu controller that acts as a Master(MCUSM470RIBIM)  & DSP OMAPL137
    • Dsp is selected to boot from spi slave 0 and corresponding pins on the line is set accordingly
    • On the Mcu side our application tries to communicate with ,HERE (on MCU SPI2) that is connected to SPI0 SLAVE ON DSP
    • The clock frequency of spiclock on MCU is 1 MHZ    
    • the following is the implementation done on MCU side to send the XMT_START and recieve RCV_START
      ///////////////////////////
      
      #define XMT_START_H 0X5853   ----->opcode to send start transfer
      
      #define RECV_START     0X5253  ----->opcode received Ack  
      while(1)
      { 
      for(x=0;x<1;x++) // TRYING TO TRANSFER ONCE 
      {
      sleep(400000);  THIS PROVIDES A DELAY OF 2SEC
      sws_value = sws_synchronisaton_spi2(0x5853);  TRYING TO WRITE THE VALUE OF XMT_START
      send_int(sws_value);// PRINT THE VALUE ON CONSOLE
      }
      if(sws_value == RECV_START)
      {
      break;
      }
      for(x=0;x<1;x++)
      {
      sleep(200000); 
      sws_value = sws_synchronisaton_spi2(0xFFFF);   /// TRYING TO READ BACK IF DATA IS PRESENT BY WRITING FFFF SO THAT IT DOESENT STARTING PROCESSING AGAIN THINKING ITS 0X5853
      send_int(sws_value);
      }
      if(sws_value == RECV_START)
      {
      break;
      }
      sleep(200);
      }
      
       //////////////////////////
      int sws_synchronisaton_spi2(unsigned short cmd_data)
      {
      int val;
      int i;
      unsigned short data = 0;
      //------------------------------------------------------------------------------------ 
      SPI2PC3 &= 0xFFEF; // CS Pin is made LOW 
      for(i=0;i<1;i++)
      {
      SPI2DAT1 = cmd_data; // This is just a dummy read. No affect on this
      sleep(5);
      }
      // SPI2PC3 |= 0x0010; // CS Pin is made HIGH*/
      // sleep(5);
      //------------------------------------------------------------------------------------*/ 
      
      //-------------------------------------------------------------------------------------- 
      // SPI2PC3 &= 0xFFEF; // CS Pin is made LOW
      sleep(5);
      while(!(SPI2CTRL3_bit.RXINTFLAG & 0x1));
      data = SPI2BUF;
      sleep(50);
      SPI2PC3 |= 0x0010; // CS Pin is made HIGH
      return data;
      }

    I have searched different forums and different approach for sending the command 0x5853 IN FOR AND WHILE LOOP and receiving I always end up in 0XFFFF

      Here i am trying to send the the XMT_START 0X5853 which has to be transmitted and receive  RECV_START 0x5253

    I am able to send the data on the MOSI line (MASTER OUT SLAVE IN)  and the proper value appears on CRO but I am not able to get back any response

    from the DSP it always gives 0XFFFF as output .

    I have also refereed to the atuil.cs file that does   the uART  transmission,

     What could be the proper approach ?

    Where could i be going wrong??

  • Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages (for processor issues). Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics (e2e.ti.com). Please read all the links below my signature.

    Moved this thread over OMAPL-1x forum for faster and appropriate response. Thank you.

    Note: We strongly recommend you to create new e2e thread for your queries instead of following up on an old/closed e2e thread, new threads gets more attention than old threads and can provide link of old threads or information on the new post for clarity and faster response.

  • Hi
    Rajashekar thanks for forwarding this for faster respone !
    I request the your team to get back with this issue asap!
  • Deepak,

    Have you looked at this wiki article for slave SPI boot on OMAPL137 devices:
    processors.wiki.ti.com/.../Using_the_D800K001_bootloader_in_SPI_Slave_mode

    HAve you ensure the device is in SPI slave boot mode and the clock and the CS pins are being driven correctly to the device? Pay special attention to the hardware requirements and constraints specified here:
    processors.wiki.ti.com/.../Using_the_D800K001_bootloader_in_SPI_Slave_mode

    What is the SPI clock that you are using ? When the device comes out of reset the PLL is in bypass so you need to keep the input clock slow to start with.

    You can use, this GEL file when the boot fails to see if there is any error code generated by the DSP ROM bootloader:
    processors.wiki.ti.com/.../OMAP-L1x_Debug_Gel_Files

    Regards,
    Rahul