This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BLE scanner CC2640 without BLE stack fails

Other Parts Discussed in Thread: CC2640, BLE-STACK, CC2650

I want to make a barebone BLE scanner without making use of the TI BLE stack, due to memory constraints and other reasons.
Therefore I interface via the so called Radio doorbell interface.
Here I run into the problem that the CMD_BLE_SCANNER is not accepted by this doorbell interface. It is refused with the result: 0x82 (UnknownCommand), although the command is correct.

In the provided documentation and examples from TI, I cannot find an example of barebone usage of the radio.
All examples are based on the provided BLE stack from TI.
My inspiration/example is the open source contiki environment, which also supports this CC2640 radio.
I run similar startup code as used in the rf-ble.c module in this contiki environment. Simplified flow:

/* Request the HF XOSC to source the HF clock. */
oscillators_request_hf_xosc();

/* Boot the CPE */
rf_core_boot();

/* Trigger a switch to the XOSC, so that we can use the FS */
oscillators_switch_to_hf_xosc();

/* Enter BLE mode (CMD_RADIO_SETUP command) */
rf_radio_setup();

This startup code is working fine.
After this radio setup, I want to use the CMD_BLE_SCANNER radio command.
When I create and send that command to the radio, the command is refused with the error result 0x82 in the CMDSTA register.
According the TI documentation (swcu117d.pdf) this means:
0x82 = UnknownCommand = The command ID number in the command structure is unknown.
But the command ID for CMD_BLE_SCANNER is correct: 0x1807

What am I doing wrong here??

Now the strange stuff:
I can get this exact same software flow working as follows:

As development environment, I use CCS with the SmartRF06 Evaluation Board connected to the target board, based on the CC2640.
When I download my program in this board, I get the 0x82 error as described above.
Now I disconnect CCS and connect the SmartRF Studio 7 tool to my board.
With this SmartRF Studio 7, you can send individual commands to this radio interface.
With this tool I send the same CMD_BLE_SCANNER command to the target, which is accepted.
(the contents of this CMD_BLE_SCANNER command is the exactly the same as the CMD_BLE_SCANNER command in my software!)
Now I disconnect SmartRF Studio 7 and download my program again in the target (keeping the power to the target alive!)
When I run my program now, the CMD_BLE_SCANNER is now accepted.
As soon as I remove the target power and start the program again, it is refused again.
What am I missing here??

It seems that there is a volatile setting, which needs to be enabled before making use of the CMD_BLE_SCANNER command.
This setting is most likely done in the SmartRF Studio 7, but from the documentation and discussions in the e2e forums I cannot find this.
What I see in the e2e forums is that there are more people struggling with this barebone usage of the radio.

Can I get help here?
Or can TI provide a simple barebone usage of the radio doorbell interface, without the complete BLE stack?

  • Hello Gerrit,

    We do not provide such examples for BLE as our support interface is via the BLE-Stack. Future versions of the TI-RTOS will include an RF-Driver interface to the radio which will give more direct access to the radio.

    Best wishes
  • Hello,

    We want to make use of the radio without using the BLE-stack. This low level doorbell interface is extensively described in the TI documentation, so I assume that making use of this described interface is also supported by TI when running into problems, like me.

    The problem is that I think that I have executed all steps before sending the CMD_BLE_SCANNER command to this doorbell interface, but it simply replies with 0x82 (unknown command ID). This error suggests that the given command ID is unknown, but it is not unknown.The command ID is correct, but I think I need to enable something else, but it is hard/impossible to detect what is wrong here. I cannot debug beyond this doorbell interface boundary. This 0x82 error code now hints me in the wrong direction.

    E.g. is there a kind of checklist for the several bits in the several radio registers that I can check, to make sure these are set correctly before sending the CMD_BLE_SCANNER command?

    Or is there another way to detect why the doorbell interface replies with 0x82, although the command ID is correct?

    What also might help if you can tell be if the Smart RF Studio 7 tool indeed does do more via this doorbell interface  than sending this CMD_BLE_SCANNER command, when I send this command via this tool (as I suggested in the previous message).

    Or is it the policy of TI that this kind of low level interface development is not supported?
    One of the reasons for choosing the CC2640 chip from TI is that we expected that we could use this interface.

    When is this RF-driver interface available for TI-RTOS?

    Best regards,
    /Gerrit

  • Hi, I also want to drive the RF core without using BLE-stack, how u solved ur problem at last?
  • Hi Jason,

    RF Driver examples for CC2650 and CC2640 can be found here: dev.ti.com/.../

    Cheers,
    Fredrik