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

nRF8001 WriteDynamicData Internal Error

I am currently using version 'NRF D 8001 1429SH' as printed on the nrf8001 IC

I have already managed to successfully bond with an android phone and completed the ReadDynamicData cycle, with correct event status of ACI_STATUS_TRANSACTION_CONTINUE for sequence 1-7 and ACI_STATUS_TRANSACTION_COMPLETE where I read sequence 8. Sequences 1-7 have lengths of 27 and sequence 8 has a length of 12. I read the dynamic data and then save it on my embedded file system in a .txt file. Upon power cycle, I read from the .txt file the 8 sequences of dynamic data and attempt to start the WriteDynamicData cycle from standby mode to restore dynamic data. I can successfully call acil_encode_command_write_dynamic_data(writebuffer, 1, dyanmicdata1, 27) //seq# 1, len 27 and receive the expected CommandResponseEvent with correct Opcode for WriteDynamicData and correct Status of ACI_STATUS_TRANSACTION_CONTINUE. However, when I call acil_encode_command_write_dynamic_data(writebuffer, 2, dyanmicdata2, 27) //seq#2, len 27, I get a CommandResponseEvent with Correct Opcode for WriteDynamicData but Status of ACI_STATUS_ERROR_INTERNAL.

Why does it generate an internal error, any solutions?

Write Buffer - for data sent via SPI to nrf8001

Read Buffer - for data received via SPI from nrf8001

Here is the SPI data, debug, and the 8 dyanmic data sequenecs:

Read buffer: 04 81 03 00 02 00 00 00

BLEP Received ACI_EVT_DEVICE_STARTED event as expected

BLEP Entering standby mode

//dynamic data read from file in filesystem into which ReadDyanmicData was saved

Dyanmic Data Seq 1:04 02 03 00 08 11 00 03 06 4E 6F 50 61 69 6E 00 0A 04 00 00 00 00 00 0B 02 00 00

Dyanmic Data Seq 2:00 00 0E 01 0A 00 10 02 30 31 00 12 02 31 32 00 14 02 33 34 00 16 07 02 00 00 00

Dyanmic Data Seq 3:AA AA CC CC 00 19 00 00 1B 00 00 1C 02 00 00 00 1F 00 00 21 00 00 22 02 01 00 00

Dyanmic Data Seq 4:00 24 00 00 25 02 00 00 00 27 06 FF FF FF FF FF FF 0C 00 10 5A A4 20 38 A4 E8 00

Dyanmic Data Seq 5:E2 01 01 1D CC 5D 16 2C 4D B7 64 3D F0 10 9A 15 46 95 B6 71 0C 5B 8D 59 B1 0E 00

Dyanmic Data Seq 6:B4 F5 DC 64 00 F8 22 3E 54 3F 58 16 60 10 D9 17 86 BB 1E 23 1F C0 7E 20 1B 0D 00

Dyanmic Data Seq 7:F1 00 00 00 00 00 00 00 00 FA DD 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Dyanmic Data Seq 8:00 00 00 00 00 00 00 14 02 3A 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

// encoding frist WriteDyanmicData command

WriteDyanmicData sequence 1

First 27 bytes of write Buffer for Sequence1:1D 08 01 04 02 03 00 08 11 00 03 06 4E 6F 50 61 69 6E 00 0A 04 00 00 00 00 00 0B

Read buffer: 03 84 08 01 00 00 00 00

Event: ACI Event Command Response

Event Opcode: ACI_CMD WriteDyanmicData

Event Status: WriteDyanmicData Continue

// encoding second WriteDyanmicData command

WriteDyanmicData sequence 2

First 27 bytes of write Buffer for sequence 2:1D 08 02 00 00 0E 01 0A 00 10 02 30 31 00 12 02 31 32 00 14 02 33 34 00 16 07 02

Read buffer: 03 84 08 81 00 00 00 00

Event: ACI Event Command Response

Event Opcode: ACI_CMD WriteDyanmicData

Event Status: ACI_STATUS_ERROR_INTERNAL

  • UPDATE:

I have now tried to call writeDynamicData cycle with the data received directly after readDynamicData cycle completes. Without saving the data in a file or manipulating the data at all, I get the same error as above during write sequence 2.

Parents
  • This looks like a storage issue. The Read Dynamic Data is not matching with the Write Dynamic data from what I see.

    Read: Dyanmic Data Seq 1:04 02 03 00 08 11 00 03 06 4E 6F 50 61 69 6E 00 0A 04 00 00 00 00 00 0B 02 00 00

    Write: WriteDyanmicData sequence 1 First 27 bytes of write Buffer for Sequence1:1D 08 01 04 02 03 00 08 11 00 03 06 4E 6F 50 61 69 6E 00 0A 04 00 00 00 00 00 0B

    They seem to be quite different and points at a storage issue.

    Additionally I took a look at the code storing the Dynamic Data in the nRF8001 SDK for Arduino.

    That does not seem to be using the encode function, so I also suspect the storage/encode is the issue.

    Added I would encourage you to base new development on the the nRF8001 SDK for Arduino as that is the latest and has a lot of fixes and improvements. The nRF8001 SDK does not have a lot of fixes or enhancements. It also has support for multiple platforms like Renesas, STM etc. If you are an existing user of the nRF8001 SDK, I would urge you to upgrade.

  • Here is the print out of the ACI messages and RX and TX buffers for SPI

    I am directly writing the buffers from ReadDynamicData back into WriteDynamicData, skipping storage for now, and I still get the same error. Sequence 2 from the ReadDynamicData matches the WriteDyamicData Sequence 2.

    // Blep Setup Messages ...

    BLEP Received ACI_EVT_DEVICE_STARTED event as expected

    BLEP Entering standby mode

    BLEP Sending bond message

    RX: 038410000000000000000000000000000000000000000000000000000000

    BLEP Response is correct

    BLEP Entering advertisement mode (limited)

    RX: 0F85031F6C2D9ACD4227000000D007050000000000000000000000000000

    ACI Event Connected

    Number of Credits Available: 108

    BLEP Waiting for messages in connected mode

    Device Addr: 1F:6C:2D:9A:CD:42

    CASE 26 BLEP Getting nRF8001 status message

    RX: 118801000000000000000000000000000000000000000000000000000000

    ACI Event Pipe Status

    BLEP Waiting for messages in connected mode (limited)

    CASE 26 BLEP Getting nRF8001 status message

    RX: 078906000000D00700000000000000000000000000000000000000000000

    Event was: 89

    CASE 26 BLEP Getting nRF8001 status message

    RX: 078E37393333353200000000000000000000000000000000000000000000

    ACI Display Pass Key

    Passkey: 7 9 3 3 5 2

    CASE 26 BLEP Getting nRF8001 status message

    RX: 078927000000D00700000000000000000000000000000000000000000000

    Event was: 89

    CASE 26 BLEP Getting nRF8001 status message

    RX: 078906000000D00700000000000000000000000000000000000000000000

    Event was: 89

    CASE 26 BLEP Getting nRF8001 status message

    RX: 0787000104021F1C00000000000000000000000000000000000000000000

    Entering Bond Case

    ACI Event Bond Status

    Bonding Succeeded

    BLEP Waiting for messages in connected mode (limited) case 28

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1188FBCD0000000000000000000000000000000000000000000000000000

    ACI Event Pipe Status

    BLEP Waiting for messages in connected mode (limited)

    CASE 26 BLEP Getting nRF8001 status message

    RX: 078927000000D00700000000000000000000000000000000000000000000

    Event was: 89

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1188FBDD0000000000000000000000000000000000000000000000000000

    ACI Event Pipe Status

    BLEP Waiting for messages in connected mode (limited)

    CASE 26 BLEP Getting nRF8001 status message

    RX: 078906000000D00700000000000000000000000000000000000000000000

    Event was: 89

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1188FFDD0000000000000000000000000000000000000000000000000000

    ACI Event Pipe Status

    BLEP Waiting for messages in connected mode (limited)

    CASE 26 BLEP Getting nRF8001 status message

    RX: 078927000000D00700000000000000000000000000000000000000000000

    Event was: 89

    CASE 26 BLEP Getting nRF8001 status message

    RX: 038603130000000000000000000000000000000000000000000000000000

    ACI_STATUS: 0003

    BLE_STATUS 0013

    ACI Event Disconnected2 for ReadDynamicData

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1E840701010402030008110003064E6F5061696E000A0400000000000B020200

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction CONTINUE

    DynData seq#: 1

    0402030008110003064E6F5061696E000A0400000000000B020200

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1E8407010200000E010A00100230310012023132001402333400160702000000

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction CONTINUE

    DynData seq#: 2

    00000E010A00100230310012023132001402333400160702000000

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1E84070103AAAACCCC001900001B00001C020000001F00002100002202010000

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction CONTINUE

    DynData seq#: 3

    AAAACCCC001900001B00001C020000001F00002100002202010000

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1E840701040024000025020000002706FFFFFFFFFFFF0C00105A8CF2B5613F00

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction CONTINUE

    DynData seq#: 4

    0024000025020000002706FFFFFFFFFFFF0C00105A8CF2B5613F00

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1E84070105F901011F6C2D9ACD42B7641BAC109A154695B6710C5B8D59B10E00

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction CONTINUE

    DynData seq#: 5

    F901011F6C2D9ACD42B7641BAC109A154695B6710C5B8D59B10E00

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1E84070106B4F5DC6400F8223E543F58F263E8C3F4E8708A42076F463F46A700

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction CONTINUE

    DynData seq#: 6

    B4F5DC6400F8223E543F58F263E8C3F4E8708A42076F463F46A700

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1E84070107170000000000000000FEDD00000000000000000000000000000000

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction CONTINUE

    DynData seq#: 7

    170000000000000000FEDD00000000000000000000000000000000

    CASE 26 BLEP Getting nRF8001 status message

    RX: 0F84070208000000000000001402BF6F00000000000000000000000000000000

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction COMPLETE

    DynData seq#: 8

    000000000000001402BF6F00000000000000000000000000000000

    Calling WriteDynData Seq 1

    TX: 1D08010402030008110003064E6F5061696E000A0400000000000B020200

    CASE 26 BLEP Getting nRF8001 status message

    RX: 038408010000000000000000000000000000000000000000000000000000

    ACI Event Command Response

    ACI_CMD WriteDyanmicData

    WriteDyanmicData ACI_STATUS transaction CONTINUE

    Calling WriteDyanmicData seq 2

    TX: 1D080200000E010A00100230310012023132001402333400160702000000

    CASE 26 BLEP Getting nRF8001 status message

    RX: 038408810000000000000000000000000000000000000000000000000000

    ACI Event Command Response

    ACI_CMD WriteDyanmicData

    WriteDyanmicData ACI_STATUS_ERROR_INTERNAL

Reply
  • Here is the print out of the ACI messages and RX and TX buffers for SPI

    I am directly writing the buffers from ReadDynamicData back into WriteDynamicData, skipping storage for now, and I still get the same error. Sequence 2 from the ReadDynamicData matches the WriteDyamicData Sequence 2.

    // Blep Setup Messages ...

    BLEP Received ACI_EVT_DEVICE_STARTED event as expected

    BLEP Entering standby mode

    BLEP Sending bond message

    RX: 038410000000000000000000000000000000000000000000000000000000

    BLEP Response is correct

    BLEP Entering advertisement mode (limited)

    RX: 0F85031F6C2D9ACD4227000000D007050000000000000000000000000000

    ACI Event Connected

    Number of Credits Available: 108

    BLEP Waiting for messages in connected mode

    Device Addr: 1F:6C:2D:9A:CD:42

    CASE 26 BLEP Getting nRF8001 status message

    RX: 118801000000000000000000000000000000000000000000000000000000

    ACI Event Pipe Status

    BLEP Waiting for messages in connected mode (limited)

    CASE 26 BLEP Getting nRF8001 status message

    RX: 078906000000D00700000000000000000000000000000000000000000000

    Event was: 89

    CASE 26 BLEP Getting nRF8001 status message

    RX: 078E37393333353200000000000000000000000000000000000000000000

    ACI Display Pass Key

    Passkey: 7 9 3 3 5 2

    CASE 26 BLEP Getting nRF8001 status message

    RX: 078927000000D00700000000000000000000000000000000000000000000

    Event was: 89

    CASE 26 BLEP Getting nRF8001 status message

    RX: 078906000000D00700000000000000000000000000000000000000000000

    Event was: 89

    CASE 26 BLEP Getting nRF8001 status message

    RX: 0787000104021F1C00000000000000000000000000000000000000000000

    Entering Bond Case

    ACI Event Bond Status

    Bonding Succeeded

    BLEP Waiting for messages in connected mode (limited) case 28

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1188FBCD0000000000000000000000000000000000000000000000000000

    ACI Event Pipe Status

    BLEP Waiting for messages in connected mode (limited)

    CASE 26 BLEP Getting nRF8001 status message

    RX: 078927000000D00700000000000000000000000000000000000000000000

    Event was: 89

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1188FBDD0000000000000000000000000000000000000000000000000000

    ACI Event Pipe Status

    BLEP Waiting for messages in connected mode (limited)

    CASE 26 BLEP Getting nRF8001 status message

    RX: 078906000000D00700000000000000000000000000000000000000000000

    Event was: 89

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1188FFDD0000000000000000000000000000000000000000000000000000

    ACI Event Pipe Status

    BLEP Waiting for messages in connected mode (limited)

    CASE 26 BLEP Getting nRF8001 status message

    RX: 078927000000D00700000000000000000000000000000000000000000000

    Event was: 89

    CASE 26 BLEP Getting nRF8001 status message

    RX: 038603130000000000000000000000000000000000000000000000000000

    ACI_STATUS: 0003

    BLE_STATUS 0013

    ACI Event Disconnected2 for ReadDynamicData

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1E840701010402030008110003064E6F5061696E000A0400000000000B020200

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction CONTINUE

    DynData seq#: 1

    0402030008110003064E6F5061696E000A0400000000000B020200

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1E8407010200000E010A00100230310012023132001402333400160702000000

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction CONTINUE

    DynData seq#: 2

    00000E010A00100230310012023132001402333400160702000000

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1E84070103AAAACCCC001900001B00001C020000001F00002100002202010000

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction CONTINUE

    DynData seq#: 3

    AAAACCCC001900001B00001C020000001F00002100002202010000

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1E840701040024000025020000002706FFFFFFFFFFFF0C00105A8CF2B5613F00

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction CONTINUE

    DynData seq#: 4

    0024000025020000002706FFFFFFFFFFFF0C00105A8CF2B5613F00

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1E84070105F901011F6C2D9ACD42B7641BAC109A154695B6710C5B8D59B10E00

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction CONTINUE

    DynData seq#: 5

    F901011F6C2D9ACD42B7641BAC109A154695B6710C5B8D59B10E00

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1E84070106B4F5DC6400F8223E543F58F263E8C3F4E8708A42076F463F46A700

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction CONTINUE

    DynData seq#: 6

    B4F5DC6400F8223E543F58F263E8C3F4E8708A42076F463F46A700

    CASE 26 BLEP Getting nRF8001 status message

    RX: 1E84070107170000000000000000FEDD00000000000000000000000000000000

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction CONTINUE

    DynData seq#: 7

    170000000000000000FEDD00000000000000000000000000000000

    CASE 26 BLEP Getting nRF8001 status message

    RX: 0F84070208000000000000001402BF6F00000000000000000000000000000000

    ACI Event Command Response

    ACI evtopcode is READ_DYNAMIC_DATA

    ACI_STATUS transaction COMPLETE

    DynData seq#: 8

    000000000000001402BF6F00000000000000000000000000000000

    Calling WriteDynData Seq 1

    TX: 1D08010402030008110003064E6F5061696E000A0400000000000B020200

    CASE 26 BLEP Getting nRF8001 status message

    RX: 038408010000000000000000000000000000000000000000000000000000

    ACI Event Command Response

    ACI_CMD WriteDyanmicData

    WriteDyanmicData ACI_STATUS transaction CONTINUE

    Calling WriteDyanmicData seq 2

    TX: 1D080200000E010A00100230310012023132001402333400160702000000

    CASE 26 BLEP Getting nRF8001 status message

    RX: 038408810000000000000000000000000000000000000000000000000000

    ACI Event Command Response

    ACI_CMD WriteDyanmicData

    WriteDyanmicData ACI_STATUS_ERROR_INTERNAL

Children
No Data
Related