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.

2650 - The command ID number in the command structure is unknown

Other Parts Discussed in Thread: CC2650, BLE-STACK

Hi,


Working on CC2650, over Contiki. I am trying to shoot CMD_BLE_ADV to RFCore, but RFCOre is returning 0x82 Error Value on CMDSTA Register - "The command ID number in the command structure is unknown" as described on Datasheet.

A little glimse of my code goes below

 printf("into send_ble_adv_con routine...\r\n");

  /* Clear both buffers */
  memset(&cmd, 0x00, sizeof(cmd));
  memset(ble_params_buf, 0x00, sizeof(ble_params_buf));
  memset(ble_device_address, 0x00, sizeof(ble_device_address));

  /* Adv Cmd Packet Preparation packet code goes here */
  cmd.commandNo = CMD_BLE_ADV;
  cmd.condition.rule = 0x01;
  cmd.whitening.bOverride = 0;
  cmd.whitening.init = 0;
  cmd.pParams = params;
  cmd.channel = channel;

  /* device info */
  memset(payload, 0, BLE_ADV_PAYLOAD_BUF_LEN);
  

  //Payload is for demo purpose.
  payload[p++] = 0x15;// total length from here till end, in hex
  payload[p++] = 0x03;
  payload[p++] = 0x19;  // Appearance GAP Profile.
  payload[p++] = 0x02;  //Next Data, Length 2 Byte
  payload[p++] = 0x01;  // Flag Type GAP Profile
  payload[p++] = 0x06;  //LE General Discoverable Mode.
  payload[p++] = 0x14;  // Device Name Length + 1
  payload[p++] = 0x09;  // Device Name GAP Profile id
  memcpy(&payload[p], node_config.adv_device_name,
           strlen(node_config.adv_device_name));
    p += strlen(node_config.adv_device_name);
  payload[p++] = 0xd3;  // Flag Type GAP Profile

  /* Set up BLE Advertisement parameters */
  params->pDeviceAddress = ble_device_address;
  params->endTrigger.triggerType = TRIG_NEVER;
  params->endTime = TRIG_NEVER;

  /* Set up BLE Advertisement parameters */
  //params = (rfc_bleAdvPar_t *)ble_params_buf;
  params->advLen = nAdv_Payload_Len;
  params->pAdvData = adv_payload;

  printf("Sending ADV_CMD to Core Now...\r\n");

  if(rf_core_send_cmd((uint32_t)&cmd, &cmd_status) == RF_CORE_CMD_ERROR) {
    printf("send_ble_adv FAILED: Send Cmd : Chan=%d CMDSTA=0x%08lx, status=0x%04x\r\n",
           channel, cmd_status, cmd.status);
    return RF_CORE_CMD_ERROR;
  }

  printf("CMD_Send to Core for ADV SUCCESS.Now Waiting for good Response from RF Core...\r\n");
  /* Wait until the command is done */
  if(rf_core_wait_cmd_done(&cmd) != RF_CORE_CMD_OK) {
    printf("send_ble_adv-wait FAILED: Wait For Cmd: Chan=%d CMDSTA=0x%08lx, status=0x%04x\r\n",
           channel, cmd_status, cmd.status);
    return RF_CORE_CMD_ERROR;
  }

  printf("ADV CMD SUCCESS. Now BLE ACTIVE and working...\r\n");

I am unable to track it out where is the fault? is my struct is not correctly filled or what? Its been a nightmare for me. Apart from this, Bluestack which TI Released has loads of code supported for TI RTOS whihc is quitee hard to pathc up with contiki. What could be the issue? Anybody?

  • Hello,

    Support of BLE-Stack on Contiki is currently not enabled. I suggest looking at the "Humidity & Temperature Sensor Node" TI Design, which can be found on the BLE Wiki. The provided SW has examples for sending BLE Advertisements (non-connectable).

    Best wishes
  • Hi Annim,

    We have not gotten far enough to document how to use the RF Core BLE API as most customers use the BLE stack instead of interfacing the radio directly. There will be a TI RTOS RF driver which also supports the BLE API included with TI RTOS early next year. This will also include radio patches + overrides to use with the radio for optimal performance.

    What you are probably missing is to configure the RF core to support the BLE API. This is done with a write to the PRCM module (before you power on RF core I think) as done in Contiki with the API rf_core_set_modesel in contiki/cpu/cc26xx-cc13xx/rf-core/rf-core.c

    Regards,
    Svend
  • @svendbt Thank you for pointing it out. Will try and will close this if i got worked. But quickly i want to ask this, if we have to set PRCM accordingly to get RF Core into BLE then what CMD_RADIO_SETUP cmd does as there also we have to tell inside struct mode=00 for BLE . As mentioned in datasheet!!!
  • The modes in PRCM will tell the radio which API's is supported. Since not all CC26xx devices support the same protocols the RF Core needs to know through the PRCM register which protocols you enable. The values for this are not the same as the ones in CMD_RADIO_SETUP where you do the actually configuration of the radio into this mode.

    Regards,
    Svend