Unable to subscribe to SPI on SL6087

Hi,

I have recently tried to get the SPI working on My SL6087 but i keep getting a error which does not make sense to me

I get the following
[14:19:06:173] SPI1 Bus Subscribed failed
[14:19:06:174] SPI config failed -13
Which is
#define ADL_RET_ERR_NOT_SUPPORTED -13 ///< An option, required by the function, is not enabled on the Wireless CPU®, the function is not supported in this configuration

Which is making me confused, i am using SPI 1 on the SL6087 therfore my block ID should be 1 right?

below is my config settings for the SPI, i have masked out most because i found that i am not even get subscription so the rest will fail

int SPI_sub(void)
{
adl_busEvt_t busEvt;
s32 Ret = OK;
s32 retval=OK;
u32 length_data=8;
u32 length_op=0;
u32 length_ad=8;
int good=0;

// SPI Subscription data
adl_busSPISettings_t SPIConfig =
{
    13,                         // No divider, use full clock speed 1 Mhz
    ADL_BUS_SPI_CLK_MODE_0,     // Mode 0 clock
    ADL_BUS_SPI_ADDR_CS_HARD,   // Use a GPIO to handle the Chip Select signal
    ADL_BUS_SPI_CS_POL_LOW,     // Chip Select active in low state
    ADL_BUS_SPI_MSB_FIRST,      // Data are sent MSB first
    ADL_BUS_SPI_LOAD_UNUSED,    // LOAD signal not used
    ADL_BUS_SPI_DATA_UNIDIR,    // 3 Wires configuration
    ADL_BUS_SPI_MASTER_MODE,    // Master mode
    ADL_BUS_SPI_BUSY_UNUSED     // BUSY signal not used
};

	SPIHandle=adl_busSubscribe(ADL_BUS_ID_SPI,1,&SPIConfig);
	if(SPIHandle>=0)
	{
		wip_debug("SPI1 Bus Subscribed successfully\r\n");
	}
		else
		{
			wip_debug("SPI1 Bus Subscribed failed %d\r\n",SPIHandle);
			good=-1;
		}

// Ret = adl_busIOCtl ( SPIHandle, ADL_BUS_CMD_SET_ASYNC_MODE,0 );//synchronous mode
// //Ret = adl_busIOCtl ( SPIHandle, ADL_BUS_CMD_SET_ASYNC_MODE,1 );//asynchronous mode
//
// if(Ret==OK)
// {
// wip_debug(“Async or Sync mode set successfully\r\n”);
// }
// else
// {
// wip_debug(“Async or Sync mode set failed\r\n”);
// good=-1;
// }
//
// retval=adl_busIOCtl(SPIHandle,ADL_BUS_CMD_SET_OP_SIZE,(void *)&length_op);//no opcode used
// if(retval==OK)
// {
// wip_debug(“opcode length set successfully\r\n”);
// }
// else
// {
// wip_debug(“opcode length set failed\r\n”);
// good=-1;
// }
//
// retval=adl_busIOCtl(SPIHandle,ADL_BUS_CMD_SET_ADD_SIZE,(void *)&length_ad);
// if(retval==OK)
// {
// wip_debug(“Address length set successfully\r\n”);
// }
// else
// {
// wip_debug(“Address length set failed\r\n”);
// good=-1;
// }
//
// retval=adl_busIOCtl(SPIHandle,ADL_BUS_CMD_SET_DATA_SIZE,(void *)&length_data);
// if(retval==OK)
// {
// wip_debug(“DATA Length set successfully\r\n”);
// }
// else
// {
// wip_debug(“DATA Length set failed\r\n”);
// good=-1;
// }

	return good;

}

hope someone can help
regards

Hi,

In the SPI settings, ADL_BUS_SPI_ADDR_CS_HARD option is being used, which means that reserved hardware chip select pin is being used for the bus.
Is there any special purpose of using the reserved chip select pin.Can you please use the GPIO pin as chip select signal.For the same,use option ADL_BUS_SPI_ADDR_CS_GPIO and test if subscription is successful or not.Is there any restriction on using GPIO pins i.e. are you using GPIO Pins for some other purpose?

Thanks.

Hi,

In ADL user guide,the option ADL_BUS_SPI_ADDR_CS_HARD is being provided for SPI settings.But this option is not supported.It is a restriction.In ADL user guide,it should be mentioned as a note that this option is not supported.
A documentation tracker has been created for the same.
We will update your when the tracker is fixed.

Thanks.