BX100 AT Command for SPI Error

@dargaj,

I am assuming you are talking about the BX3100? I suspect that your firmware is not 2.5+
ati
BX310x
OK
at+cmgr
BX310x.2.5.0-2
OK
at
OK
at+srspi?
+SRSPI: 0,0
OK
at+srspi=1,1
OK

Couple of other things as they are not well documented.

SPI Frame:
command 2 bytes
payload_length 2 bytes
more 1 byte
reserved 3 bytes
payload 256 bytes

  • <command>
  • 0x0001: AT command
    • 0x0002: AT response
    • 0x0003: data (data mode)
    • 0xffff: dummy data
  • <payload_length>:
    • Length of the significant content in the payload
    • Range: 0-256
  • <more>:
    • For command=0x0002, if more=1 it indicates that the AT response is not complete and that another frame will be sent after this one
  • <payload>:
    • Payload is always 256 bytes long. The significant data could be less, <payload_length> indicate the length of the significant part of payload.
    • When sending a frame, the slave add 0 padding to the payload if necessary.
    • When receiving a frame, the slave will only process the data if <payload_length> and <payload> are coherent. Non significant part of <payload> is expected to be set to 0.

SPI “AT commands” differences from UART

  • To exit data mode, a frame with only the escape sequence must be sent to the slave. If the escape sequence is included in a data frame sent to the slave, it will not be detected.
  • When using AT+RST, the OK response may not be sent to the master (because the device is rebooting immediately afterwards, so there is not enough time for the response to be processed).

Hardware interface selection (UART/SPI)
If GPIO 17 is high when the module boots up, SPI will be selected, otherwise UART will be selected.

Regards

Matt