CC1110关于simpliciTI协议的丢包率问题
我用1个AP带动5个ED组网,每个ED以50ms的间隔发包,包的有效载荷为50字节,AP每收到一包都会通过UART完整转发给上位机,同时ED对发送数量做了统计并包含在50字节中发送,AP收到后,在接收中断里,长度校验和CRC校验之前做一次统计,然后在uart转发之前再做一次统计,两次统计值也是加入到50字节信息里,然后uart将50字节信息转发给上位机,但是5个ED全都在发送出去之后到AP收到CRC校验之前就已经有超过2%的丢失率,一直没找到原因,求教。
协议只启用了最基本的必要的宏(包括AP_IS_DATA_HUB),DMA通道优先级设置成了最高,UART中断优先级高于无线中断优先级,更改了CCA发送时的退避时间和尝试次数,由之前的最小1.25ms*4改到了0.25ms*20,UART波特率是115200,无线配置使用的smartRF给的配置,433MHz,250k波特率,具体如下:
#define SMARTRF_SETTING_PKTCTRL0 0x05
#define SMARTRF_SETTING_FSCTRL1 0x0C
#define SMARTRF_SETTING_FSCTRL0 0x00
#define SMARTRF_SETTING_FREQ2 0x10
#define SMARTRF_SETTING_FREQ1 0xB1
#define SMARTRF_SETTING_FREQ0 0x3B
#define SMARTRF_SETTING_MDMCFG4 0x2D
#define SMARTRF_SETTING_MDMCFG3 0x3B
#define SMARTRF_SETTING_MDMCFG2 0x13
#define SMARTRF_SETTING_MDMCFG1 0x22
#define SMARTRF_SETTING_MDMCFG0 0xF8
#define SMARTRF_SETTING_DEVIATN 0x62
#define SMARTRF_SETTING_CHANNR 0x00
#define SMARTRF_SETTING_MCSM0 0x18
#define SMARTRF_SETTING_FOCCFG 0x1D
#define SMARTRF_SETTING_BSCFG 0x1C
#define SMARTRF_SETTING_AGCCTRL2 0xC7
#define SMARTRF_SETTING_AGCCTRL1 0x00
#define SMARTRF_SETTING_AGCCTRL0 0xB0
#define SMARTRF_SETTING_FREND1 0xB6
#define SMARTRF_SETTING_FREND0 0x10
#define SMARTRF_SETTING_FSCAL3 0xEA
#define SMARTRF_SETTING_FSCAL2 0x2A
#define SMARTRF_SETTING_FSCAL1 0x00
#define SMARTRF_SETTING_FSCAL0 0x1F
#define SMARTRF_SETTING_TEST1 0x31
#define SMARTRF_SETTING_TEST0 0x09
#define SMARTRF_SETTING_PA_TABLE0 0x60
AP主循环流程和下面这段一致,对成功接收到的帧的处理部分就只有数量统计和UART转发
if (sJoinSem && (sNumCurrentPeers < NUM_CONNECTIONS))
{
/* listen for a new connection */
while (1)
{ /* SMPL_LinkListen will call nwk_PllBackgrounder for us if FHSS active */
if (SMPL_SUCCESS == SMPL_LinkListen(&sLID[sNumCurrentPeers]))
{
break;
}
/* Implement fail-to-link policy here. otherwise, listen again. */
}
sNumCurrentPeers++;
BSP_ENTER_CRITICAL_SECTION(intState);
sJoinSem--;
BSP_EXIT_CRITICAL_SECTION(intState);
}
/* Have we received a frame on one of the ED connections?
* No critical section -- it doesn't really matter much if we miss a poll
*/
if (sPeerFrameSem)
{
uint8_t msg[MAX_APP_PAYLOAD], len, i;
/* process all frames waiting */
for (i=0; i<sNumCurrentPeers; ++i)
{
if (SMPL_SUCCESS == SMPL_Receive(sLID[i], msg, &len))
{
processMessage(sLID[i], msg, len);
BSP_ENTER_CRITICAL_SECTION(intState);
sPeerFrameSem--;
BSP_EXIT_CRITICAL_SECTION(intState);
}
}
}
请问您做的也是多发一收么?
是的