器件:CC2340
SDK版本:simplelink_cc23xx_sdk_6_40_00_21_eng
问题:cmdId为RCL_CMDID_BLE5_GENERIC_RX,调用RCL_Command_submit和RCL_Command_pend返回错误码138-----RCL_CommandStatus_Error_UnknownOp
麻烦技术解答一下,谢谢!
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.
器件:CC2340
SDK版本:simplelink_cc23xx_sdk_6_40_00_21_eng
问题:cmdId为RCL_CMDID_BLE5_GENERIC_RX,调用RCL_Command_submit和RCL_Command_pend返回错误码138-----RCL_CommandStatus_Error_UnknownOp
麻烦技术解答一下,谢谢!
您好,
收到工程师的回复:
To clarify, the customer wants to receive and decode BLE packets using the rfPacketRx example? Could you provide a bit more information about their use-case? If they want to implement Bluetooth LE communication, then I would recommend that the customer implement a BLE examples on both sides of the connection.
您是想要使用 rfPacketRx 示例接收和解码 BLE 数据包?您能否提供有关其用例的更多信息?如果您想要实现蓝牙 LE 通信,那么我们会建议您在连接的两端都实现一个 BLE 示例。
您好,
1、想要使用 rfPacketRx 示例接收和解码 BLE 数据包,但是我用的不是RCL_CMDID_GENERIC_RX命令,而是RCL_CMDID_BLE5_GENERIC_RX命令,
2、用例的更多信息就是基于 rfPacketRx 示例修改,把命令改为RCL_CMDID_BLE5_GENERIC_RX命令,目前问题是调用RCL_Command_submit和RCL_Command_pend返回0x8A(RCL_CommandStatus_Error_UnknownOp),修改后的源码下面提供,
3、这样做是为了实现连接监听(connect monitor)功能,
RCL_CmdBle5GenericRx rxCmd; // RX command
RCL_CtxGenericRx ctx;
RCL_StatsGenericRx stats; // Statistic command
/* Initialize and open RCL */
RCL_init();
RCL_Handle rclHandle = RCL_open(&rclClient, &rclRadioConfigGenericBle);
/* Setup generic receive command */
rxCmd = RCL_CmdBle5GenericRx_DefaultRuntime();
/* Set RF channel */
rxCmd.channel = 37;
RCL_BLE5_setDefaultRfFrequency(2402000000U);
rxCmd.common.phyFeatures = RCL_GENERIC_PHY_FEATURE_PHY_1MBPS;
/* Start command as soon as possible */
rxCmd.common.scheduling = RCL_Schedule_Now;
rxCmd.common.status = RCL_CommandStatus_Idle;
rxCmd.common.timing.absStartTime = 0;
rxCmd.common.timing.relHardStopTime = 0;
/* Set command to run forever until completion */
rxCmd.common.timing.relGracefulStopTime = 0;
rxCmd.common.runtime.client = &rclClient;
/* Callback triggers on last command done or packet received */
rxCmd.common.runtime.callback = defaultCallback;
rxCmd.common.runtime.rclCallbackMask.value = RCL_EventLastCmdDone.value |
RCL_EventRxEntryAvail.value;
ctx = RCL_CtxGenericRx_DefaultRuntime();
ctx.accessAddress = 0x8e89bed6;
ctx.accessAddress = 0x555555;
ctx.config.repeated = 1;
/* Maximum packet length */
ctx.maxPktLen = MAX_LENGTH;
rxCmd.ctx = &ctx;
/* Setup generic status command */
stats = RCL_StatsGenericRx_DefaultRuntime();
/* Set RX command statistics structure */
rxCmd.stats = &stats;
GPIO_setConfig(CONFIG_GPIO_RLED, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);
GPIO_write(CONFIG_GPIO_RLED, CONFIG_GPIO_LED_OFF);
/* Initialize multi-buffer to allow RCL to store RX packet */
for(int i = 0; i < NUM_OF_PACKETS; i++)
{
multiBuffer = (RCL_MultiBuffer *) buffer[i];
RCL_MultiBuffer_init(multiBuffer, BUFF_STRUCT_LENGTH);
RCL_MultiBuffer_put(&rxCmd.ctx->rxBuffers, multiBuffer);
}
/* Submit command */
RCL_CommandStatus RCL_Sta = 0;
RCL_Sta = RCL_Command_submit(rclHandle, &rxCmd);
/* Pend on command completion */
RCL_Sta = RCL_Command_pend(&rxCmd);
感谢您的支持,希望得到进一步的支持
您好,
收到工程师回复,如同之前说的,查看 RCL_Command.h 文件,我们可以找到错误代码的含义。
RCL_CommandStatus_Error_UnknownOp, /*!< Command ended because radio did not recognize command; probably wrong image for given command */
这意味着无线电配置(radio configuration)不正确。您能验证一下吗?
您好,
收到工程师回复:
Since you are using a BLE5 command (RCL_CmdBle5GenericRx_DefaultRuntime), try to make sure you are using BLE5 setup for RCL_open.
Specifically, try the files C:\ti\simplelink_cc23xx_sdk_6_40_00_21_eng\source\ti\boards\cc23x0\ble_setup.c (and ble_setup.h).
Look for "rclRadioConfigBle" --> then do RCL_Handle rclHandle = RCL_open(&rclClient, &rclRadioConfigBle);
由于您正在使用 BLE5 命令 (RCL_CmdBle5GenericRx_DefaultRuntime),请尝试确保您正在为 RCL_open 使用 BLE5 设置。
具体来说,尝试文件 C:\ti\simplelink_cc23xx_sdk_6_40_00_21_eng\source\ti\boards\cc23x0\ble_setup.c(和 ble_setup.h)。
寻找“rclRadioConfigBle”——> 然后执行 RCL_Handle rclHandle = RCL_open(&rclClient, &rclRadioConfigBle);
您好,
我们建议检查这些参数,并确保它们与 TX 端匹配:
ctx.accessAddress = 0x8e89bed6;
ctx.accessAddress = 0x555555;
目前,代码似乎正在覆盖 accessAddress。
I recommend checking these parameters, and making sure they match the TX side:
ctx.accessAddress = 0x8e89bed6;
ctx.accessAddress = 0x555555;
Currenlty, it seems the code is overwriting the accessAddress.
您好,
ctx.accessAddress = 0x8e89bed6;
ctx.accessAddress = 0x555555;
What I mean is that they are writing twice the value of ctx.accessAddress (first time it is 0x8e89bed6, second time it is 0x555555 -- in the end, final value is 0x555555 ) -- please confirm exactly which value they want for ctx.accessAddress.
工程师的意思是您写的值是ctx.accessAddress的两倍 。(第一次是 0x8e89bed6, 第二次是 0x555555 --最后,最终值为0x555555 ) -- 请确认您想要 ctx.accessAddress 的确切值。