Skip to main content
Pascal Zosso
Associate II
December 4, 2017
Question

How to use the SOCKDW command correctly over SPI on SPWF04SA?

  • December 4, 2017
  • 2 replies
  • 3059 views
Posted on December 04, 2017 at 09:10

Hello everybody,

Since the release of the new documentation (Datasheet V5 and Command Guide V2), I'm looking for more detailed informations about SPI interface, SPI timing and SPI dialogue.... but the new doc is still poor in informations about SPI (really poor).

After lot of trial, I could send a SOCKDW on my SPI:

02 00 0F 4A 03 01 00 01 00 01 07 AA AA 03 DF 01 01 1F

It means : SOCKDW, sid=0, cid=0, len=7, data isAA AA 03 DF 01 01 1F

After that, I receive the two following reply from SPWF04SA:

02 3A 00 00 00

which I think is a'OK result code' as mention in Command Guide page 14 (see chapter 6.1)

and

02 3A 21 00 00

which I don't know what it is.... because it is not documented....

So my question is double :

Could we have a proper documentation about the SPI interface (sync reply, dialogue sample, )?

and

What does the '02 3A 21 00 00' means?

PS: I really appreciate the new example for SPI protocol but the Second example has still its length false and the text about the translate procedure still contains wrong informations about the byte number.

PSPS: the SPI dialogue for SOCKDW in attachment

[EDIT 2018] I add a SOCKDW example

#sockdw #spi #spwf04

Note: this post was migrated and contained many threaded conversations, some content may be missing.
This topic has been closed for replies.

2 replies

Gerardo GALLUCCI
ST Employee
December 4, 2017
Posted on December 04, 2017 at 14:09

Into UM2114, rev2, I see (page 12) an example on SOCKW command.

Please note that '0' and '5' means 0x30 and 0x35 (not 0x00 and 0x05).

There is not a big difference between AT-commands and SPI protocol. You can easily build your own SPI parser, starting from AT-commands.

Pascal Zosso
Associate II
December 4, 2017
Posted on December 04, 2017 at 17:12

There is not a big difference between AT-commands and SPI protocol. You can easily build your own SPI parser, starting from AT-commands.

It is what I do now, it would be easier if I had the translate of the synchronous replies of SPWF04 over SPI. I found some of them in the training lab but only the 'UART format'.

What I really need to know is what are these synchronous replies on SPI:

AT-S.OK                 02 3A 00 00 00                               correct?            

AT-S.Reading:5:5  02 3A FE 05 00 35 3A 35 0D 0A     correct ?

AT-S.ON:0              .....

etc...

To confirm my parser is good, I need to understand what the SPWF04 replies mean.

Into UM2114, rev2, I see (page 12) an example on SOCKW command.

Please note that '0' and '5' means 0x30 and 0x35 (not 0x00 and 0x05).

Yeah, I have seen it and deal with the ASCII char to put the right socket server id, socket client id and data length in the SOCKDW command. 

Gerardo GALLUCCI
ST Employee
December 4, 2017
Posted on December 04, 2017 at 18:33

I assume you are still using old FW1.0.0 (CrLf inside the packet...)

'02 1* X other' means +WIND ASync messages number X

'02

 2

*

 X

other

' means critical 

+WIND ASync messages number X (module will reboot)

'02 3* Y

other

' means

Sync messages (AT-S.something)

About Sync messages:

'Y == 0xFF' means AT-S.something that cannot be masked (your 'On')

'Y == 0xFE' means AT-S.something that can be masked by console_verbose variable (your 'Reading')

'Y == 0x00

' means AT-S.OK

'Y == Z

' means AT-S.ERROR number Z ( where: 0 < Z < 120 )

Pascal Zosso
Associate II
January 22, 2018
Posted on January 22, 2018 at 16:36

For the people who would have an example of the SOCKDW command timing:

1) SOCKDW command

2) data payload

3)

AT-S.OK

SPI run at 8MHz, nHost interrupt line is not shown but CS line can give you an idea of the interrupt request timing.

The content of the frames are on the left panel.

0690X00000609LFQAY.png

I can't explain what take so long to the SPWF04SA to send few bytes.