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??
