cancel
Showing results for 
Search instead for 
Did you mean: 

Why does aci_gap_set_discoverable() return Command Disallowed?

HCohe.1
Associate III

Under what circumstances will the BLE controller return Command Disallowed (0x0C)? I am calling aci_gap_set_discoverable() followed by aci_gap_update_adv_data() periodically. I see aci_gap_set_discoverable() return successful the first time that it's called upon startup and also upon receiving HCI_LE_CONNECTION_COMPLETE. It appears to fail at all other times and the advertising packets are not transmitted.

4 REPLIES 4
Scott Löhr
Senior II

If any of the 4 interval parameters are not attainable, request is disallowed. You will have to tune the intervals according to the slot time left over after anything else that is active (e.g. in connection as a BLE Master or Slave, scanning as a BLE Central, etc.). Whenever you disconnect everything and stop everything, the slot timing is reset in the CPU2, so you will definitely be able to advertise with you parameters then, if they ever were accepted. Read about the slot timing in Chapter 5 of PM0271, STM32WB BLE stack programming guidelines.

Remy ISSALYS
ST Employee

Hello,

Can you check the value of the following define in app_conf.h file ?

/**
 * Maximum number of simultaneous connections that the device will support.
 * Valid values are from 1 to 8
 */
#define CFG_BLE_NUM_LINK            2

Best Reagrds

HCohe.1
Associate III

@Scott L�hr​ I am using the default fast connection parameters, which are 80 and 100 in CubeMX and interestingly appear as 0x80 and 0xA0 in the generated code. I tried halving and doubling them but did not see any improvement.

@Remy ISSALYS​ Yes CFG_BLE_NUM_LINK remains at the default value (2).

When I tested the same code on a P-NUCLEO-WB55 board (in place of our custom board), it behaves differently, so I'm investigating whether my problem is a result of packet loss. To that end, I am trying to run STM32CubeMonitor-RF's BLE PER test. Unfortunately, I'm unable to execute the test successfully. I'm using STM32CubeMonitor-RF V2.8.1 on Windows 11. I'm trying obtain baseline measurements between two P-NUCLEO-WB55 boards. They are running BLE_TransparentMode_reference.hex from STM32Cube_FW_WB_V1.13.3 and Wireless FW 1.13.3 (BLE Full). The tests fail to run and the log indicates "Unknown HCI Command". I attached screen captures from the test program. I suspect a mismatch between the test program and the BLE_TransparentMode code. Any ideas?

0693W00000Ns2P8QAJ.png0693W00000Ns2OoQAJ.png

Remy ISSALYS
ST Employee

Hello,

In BLE Full stack v1.13.3, the following commands aren't supported:

  • HCI_LE_RECEIVER_TEST
  • HCI_LE_TRANSMITTER_TEST
  • HCI_LE_TEST_END
  • HCI_LE_RECEIVER_TEST_V2
  • HCI_LE_TRANSMITTER_TEST_V2

In the next package v1.14.0 available soon, these commands will be added in BLE Full stack. In order to see which command is supported on which BLE stack, you can look this document. A wiki page about wireless stack information is under construction also.

Best Regards