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

Why do I get ACI_STATUS_ERROR_INVALID_PARAMETER for every command I send?

I am communicating with the nrf8001 via SPI, from an HCS08 MCU. First thing I receive:

0x01 0x04 0x81 0x02 0x00 0x02

This makes sense, it tells me it is in setup state. I want to put it into test state, specifically for testing the ACI. So, I transmit:

0x02 0x01 0x02

I get acknowledgements of 0x00, 0x01, 0x00. Then, I receive:

0x01 0x03 0x84 0x01 0x85

According to the datasheet, this is an error, due to an invalid parameter. Okay, next I transmit an echo command:

0x04 0x02 0x47 0x48 0x49

I expect it to either tell me that it is in the wrong state, or, by some miracle, return the last three bytes. I receive:

0x01 0x03 0x84 0x01 0x85

Invalid Parameter. I have tried sending it various commands, even those with no parameters, such as the GetDeviceAddress (0x0A) or GetTemperature (0x0C). Yet, every time, I receive the same error: Invalid Parameter.

What could I be doing wrong?

  • What do you mean you get acknowledgement, 0x00, 0x01, 0x00? Do you have a logic analayzer you can use to monitor the SPI traffic? Do you have any other device on the spi lines? Are you able to run the ble_aci_transport_layer_verification project? If you are not I guess there is something wrong with your SPI configuration. Make sure length is 0 when reading events so you don't send commands by accident.

  • You seem to have successfully received the Device Started Event stating that the device is in setup mode. However when you sent the Test command (0x01) , the command has failed. The failure is clear from the Command Response Event that is received for the Test command.

    We need to understand why the test command failed. Can you send me the chip markings on top of the nRF8001 and the nRF8001 board that you are using.

    Unexpected things noticed:

    1. The nRF8001 is reponding with (0x01 0x03 0x84 0x01 0x85) to the echo command, and by looking at the SPI message received (command Response Event) the nRF8001 seems to think that the test command was sent. This would appear that no further commands are possible and only a pin RESET can be used to proceed and re-attempt the Test command again.

    Actions requested (summary):

    As @run_ar has suggested an SPI trace of the nRF8001 would be nice.

    In addition mention the lines that you are using between the HS08 and the nRF8001 and Mention the SPI clock speed that you have used

    Chip markings on the nRF8001 and the nRF8001 board used.

  • I am running my own C program on the HCS08 MCU, which is only connected to the nrf8001. The SPI module in the MCU triggers an interrupt once the SPI buffer is full, then I store the data register in memory. When I send 0x02, 0x01, 0x02, I get 0x00, 0x01 and 0x00 in return, from the nrf8001. I do not have a logic analyzer, but I do use an oscilloscope. I did not find any C files at the project link. My HCS08 runs either assembly or C code. If you have any other examples, I would really appreciate it. I only send 0x00 when doing my read cycle. I am curious as to the meaning of these debug bytes that start every received message. For reference, here is my application controller code: [https://pastebin.com/ibWUdZd1]

  • The .ino file has C code in it so you can take a look at it.

  • The markings on top of the chip are: NRF D 8001 1429SH

    I am using the MikroElektronika BLE P click board.

    My master generates a clock of 2MHz (verified by oscilloscope).

    nrf8001 MC9S08QE8

    • RESET ==> Port A, Pin 2
    • RDYN ==> Port A, Pin 3
    • REQN ==> Port B, Pin 5 (SS)
    • MISO ==> Port B, Pin 4 (MISO)
    • MOSI ==> Port B, Pin 3 (MOSI)
    • SCK ==> Port B, Pin 2 (SPSCK)

    If you would like a full circuit diagram, I would be happy to provide it.

    I am sending and recieving these messages through scratch-built C code

    I have not tried resetting the nrf8001 after I receive the error and before sending the new command.

Related