This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF8001 strange events

Hi,

Firstly a warning I'm a noob in this area.

I'm seeing some strange events consistently returned from the nRF8001 over SPI. I have an example of the SPI traffic below which shows everything working fine until a point. The strange thing is that if I put a printf("delay") in my aci loop when lib_aci_event_get(&aci_state, &aci_data) == FALSE it works fine and I get no spurious unexpected events.

Any advice would be most welcome at this point as I have been looking into this issue for a number of days now.

SPI TX  00, 00, 00, 03, 00, ...
SPI RX  0f, 85, 03, 90, aa, ...		EVENT - CONNECTED

SPI TX  01, 09, 60, 00, 00, ...		COMMAND - 09 (GET DEVICE VERSION)
SPI RX  11, 88, 7d, cd, bb, ...		EVENT - PIPE STATUS

SPI TX  00, 00, 20, 03, 00, ...
SPI RX  11, 88, 7f, cd, bb, ...		EVENT - PIPE STATUS

SPI TX  00, 00, 20, 03, 00, ...
SPI RX  0c, 84, 09, 00, 41, ...		EVENT - COMMAND RESPONSE - 09 (GET DEVICE VERSION)

SPI TX  0b, 0d, 02, 41, 00, ...		COMMAND - 0d (SET LOCAL DATA)
SPI RX  11, 88, 7f, cd, bf, ...		EVENT - PIPE STATUS

SPI TX  00, 00, 00, 03, 00, ...
SPI RX  03, 84, 0d, 00, 00, ...		EVENT - COMMAND RESPONSE - 0d (SET LOCAL DATA)

SPI TX  00, 00, 20, 03, 00, ...
SPI RX  03, 8c, 11, 01, fe, ...		EVENT - DATA RECEIVED

SPI TX  11, 15, 12, d0, 07, ...		COMMAND 15 (SEND DATA)
SPI RX  11, 88, 7f, cd, ff, ...		EVENT - PIPE STATUS

SPI TX  00, 00, 20, 03, 00, ...
SPI RX  11, 88, 7f, cf, ff, ...		EVENT - PIPE STATUS

SPI TX  00, 00, 00, 03, 00, ...
SPI RX  02, 8a, 01, 1e, 00, ...		EVENT - DATA CREDIT

SPI TX  00, 00, 00, 03, 00, ...
SPI RX  03, 8c, 11, 02, 00, ...		EVENT - DATA RECEIVED

SPI TX  11, 15, 12, 01, 00, ...		COMMAND 15 (SEND DATA)
SPI RX  00, 00, 00, 00, 00, ...

SPI TX  00, 00, 00, 03, 00, ...
SPI RX  02, 8a, 01, 1e, 00, ...		EVENT - DATA CREDIT

SPI TX  00, 00, 00, 03, 00, ...
SPI RX  03, 8c, 11, 03, 00, ...		EVENT - DATA RECEIVED

SPI TX  11, 15, 12, 01, 00, ...		COMMAND 15 (SEND DATA)
SPI RX  00, 00, 00, 00, 00, ...

SPI TX  00, 00, 00, 03, 00, ...
SPI RX  02, 8a, 01, 00, 00, ...		EVENT - DATA CREDIT

SPI TX  00, 00, 00, 03, 00, ...
SPI RX  03, 8c, 11, 04, 00, ...		EVENT - DATA RECEIVED

SPI TX  11, 15, 12, df, 07, ...		COMMAND 15 (SEND DATA)
SPI RX  00, 00, 00, 00, 00, ...

SPI TX  00, 00, 00, 03, 00, ...
SPI RX  02, 8a, 01, 1e, 00, ...		EVENT - DATA CREDIT

SPI TX  00, 00, 00, 03, 00, ...
SPI RX  07, 8c, 15, e0, 07, ...		EVENT - DATA RECEIVED

SPI TX  11, 0d, 19, e0, 07, ...		COMMAND 0d (SET LOCAL DATA)
SPI RX  00, 00, 00, 00, 00, ...

SPI TX  0f, 15, 16, e0, 07, ...		COMMAND 15 (SEND DATA)
SPI RX  03, 84, 0d, 00, 07, ...		EVENT - COMMAND RESPONSE - 0d (SET LOCAL DATA)

---- STARTS TO GO WRONG NOW ----

SPI TX  00, 00, 00, 03, 00, ...
SPI RX  03, 84, 84, 82, 00, ...		EVENT - COMMAND RESPONSE - 84 INVALID COMMAND (WHAT!!!)

SPI TX  00, 00, 20, 03, 00, ...
SPI RX  08, 60, 84, 82, f4, ...		EVENT - WHAT!!!

SPI TX  00, 00, 20, 03, 00, ...
SPI RX  08, 60, 01, 82, f4, ...		EVENT - WHAT!!!

SPI TX  00, 00, 20, 03, 00, ...
SPI RX  08, 20, 01, 82, f4, ...		EVENT - WHAT!!!

SPI TX  00, 00, 20, 03, 00, ...
SPI RX  08, 20, 15, e0, 07, ...		EVENT - WHAT!!!
Parents
  • You have obviously thought of this but just thought I would mention. There is no chance you are sharing SPI bus with other peripherals on your PCB? Do you have a debug output UART port on your MCU? There is code in the hal_aci_tl.cpp file that supports printing sent and received radio packets over the serial link. It's enabled by hal_aci_tl_debug_print(true). I've found it very useful in debugging. Finally, there is an ble_aci_transport_layer_verification example in the SDK code for doing a test of the transport layer you are having problems with. These are just some things I found useful getting our board up and running.

Reply
  • You have obviously thought of this but just thought I would mention. There is no chance you are sharing SPI bus with other peripherals on your PCB? Do you have a debug output UART port on your MCU? There is code in the hal_aci_tl.cpp file that supports printing sent and received radio packets over the serial link. It's enabled by hal_aci_tl_debug_print(true). I've found it very useful in debugging. Finally, there is an ble_aci_transport_layer_verification example in the SDK code for doing a test of the transport layer you are having problems with. These are just some things I found useful getting our board up and running.

Children
No Data
Related