1 of 1 people found this helpful
The reason is that I forget to configure NVIC for SPI IRQ.
No modification on link file is needed.
I have an issue which may be similar to your case. I am trying to implement SPI slave with transmit only. Clock will be provided by master (in this case I am just running a PWM and connecting it externally to the CLK pin of SPI).
I realized that wiced_spi_init and platform_spi_init functions did not provide the options for slave and single line. Made some modifications to allow for that.
Now I am stuck at spi_transfer function. When not using DMA, the code just gets stuck. And when using DMA, spi_dma_transfer function returns WICED_TIMEOUT.
What am I doing wrong? My application is a simple broadcaster at frequency provided by the clock (38kHz in this case). It can be used for IR communication (one-way, tx only like remotes).
I would really appreciate your help.
I am assuming that slave is to receive data in your case.
Regarding using DMA mode,
you can increase the timeout value temporarily, that I ever tried it.
Then it should get the sent data from host.
The underlying platform is STM32F2xx, which does not support 38kHz clock for SPI.
I would like to transmit data, and since required speed is not supported by the platform, I decided that an external clock could be used and use SPI in slave mode to transmit data.
In platform_spi.c I made a new function which is similar to platform_spi_init but also allows to provide direction and master/slave setting. For example, following is set:
spi_init.SPI_Direction = SPI_Direction_1Line_Tx;
spi_init.SPI_Mode = SPI_Mode_Slave;
SPI_Cmd ( spi->port, ENABLE );
which SETs SPE in CR1 register to initialize the SPI.
I didn't modify the transfer functions and am trying to use the original ones. I am wondering if there is anything additional that needs to be taken care of when using SPI in slave mode.
DMA Timeout issue resolved for SPI Master mode.
(special thanks to userc_9344)
I will try to tackle the slave issues:
Trying to use the SPI in slave mode to transmit data (TX only) and there is an external clock (generated via wiced_pwm lib connected to CLK pin via jumper).
If suggestions, please share.
Did you modify chip_select code in wiced_spi_init() as below ?
wiced_gpio_init(spi->chip_select, INPUT_HIGH_IMPEDANCE); //we are slave
Discussion is being locked. If you have any follow-up questions, please start a new discussion.