cancel
Showing results for 
Search instead for 
Did you mean: 

Yet another SPI SPWF04S problem

Posted on June 14, 2017 at 12:07

Hi all.

I'm having trouble connecting to AP with SPI mode. I tried to same network with putty and USB-to-UART cable and it connected fine (I only did ping over the connection, so not much). However with SPI it connects and drops it right away and repeats it forever.

Initializing SPWF04SA Interface..

>> Configuration Failure no 2 <-----i

nteresting, 'RAM cannot be mounted'

<<WIND 7, status 0

10

<<WIND 1, status 0

170216-fd39c59-SPWF04S

<<WIND 13, status 0

SPWF04SA

<<WIND 65, status 0

1

<<WIND 0, status 0

<<WIND 3, status 0

20

<<WIND 32, status 3

>>AT

<<OK

>>AT

<<OK

>>AT

<<WIND 49, status 2

0

<<OK

>>AT

<<OK

>>AT

<<OK

<<WIND 32, status 3

wifi started and ready...

>>AT

<<corrupted OK packet!!

<<OK

End of Initialization..

>>connecting to AP... TPNY, xxxxxxxxxx, 2

>>AT

<<corrupted OK packet!!

<<OK

>>AT

<<OK

>>AT

<<OK

>>AT

<<OK

>>AT

<<OK

>>AT

<<OK

<<WIND 32, status 3

<<WIND 21, status 4

<<WIND 35, status 4

00

<<WIND 19, status 7

98:DE:D0:EA:4C:62

<<WIND 25, status 7

TPNY

<<WIND 41, status 7

2

<<WIND 21, status 4

<<WIND 35, status 4

00

<<WIND 21, status 4

<<WIND 35, status 4

00

<<WIND 19, status 7

98:DE:D0:EA:4C:62 (after this it loops back line <<WIND 25 status 7)

The RAM mount thing is a littlebit worrying.

Othervise it seems to connect-disconnect-connect forever.

My setup is STM32F469NI, 1Mhz (currently) SPI and X-Nucleo-IDW04A1 board.

#spwf04sa

Note: this post was migrated and contained many threaded conversations, some content may be missing.
22 REPLIES 22
Posted on June 19, 2017 at 11:56

Hi Mridu.

Are you quite certain? I mean the condition only calls the SPI_SendAT_Command:

 SPI_Send_AT_Command(offset-len, mode);//send the SPI cmd packet

//printf('Sending data: %d\r\n', len);

//SPI_Transmit_Manager_Poll(data, len);//now send the data

And then in the SPI_Send_AT_Command uses the SPI package structure:

/* SPI DMA Transmit*/

void SPI_Send_AT_Command(int offset, int mode)

{

tx_payload_data = WiFi_SPI_Packet;  <----- Here is the problem

&sharpif DEBUG_PRINT

printf('>>%s\r\n', WiFi_Counter_Variables.curr_data);

&sharpendif

payload_size_to_transmit = offset;

switch (mode)

{

case SPI_POLL:

SPI_Transmit_Manager_Poll(tx_payload_data, payload_size_to_transmit);

break;

case SPI_DMA:

SPI_Transmit_Manager(SPI_PAYLOAD_TRANSMIT);

break;

case SPI_IT:

//not supported yet

break;

}

}
Posted on June 19, 2017 at 12:33

Ok, in the case of SPI_DMA uses the WiFi_Counter_Variables.curr_data (2k). However the cmd_funcArgs in the spwf04WiFi.c compose the AT command into WiFi_SPI_Packet that's not sent as far as I've understood. Only part of WiFi_Counter_Variables.curr_data is sent.

Posted on June 19, 2017 at 13:01

in case of SPI_DMA tx_payload_data is sent which is the SPI_Packet. The certificate data is sent after the packet send is complete. This is by generating a SW IRQ on nIRQ which sends the data (curr_data). There would be other ways of doing this but currently this is it. We will review all this currently.