HPDWARN and CLKPLL_LL are set when send tx_resp_msg by useing dwt_starttx(DWT_START_TX_DELAYED | DWT_RESPONSE_EXPECTED ) function
I am blocked by this problem for several days, when i use the GD32F103RET6 to measure distance with DW1000 in inturrpt mode.
First the anchors send a msg to the tag to start a measurement,
Second the tag send the poll_msg back to the anchors ,
Third the anchors send the response msg to the tag ,the error happend when i use the fuchtion
ret_A= dwt_starttx(DWT_START_TX_DELAYED | DWT_RESPONSE_EXPECTED );
It return dwt_error. I check the SYS_STATUS_ID by print checkTxOK, it get from :
checkTxOK= dwt_read16bitoffsetreg(SYS_STATUS_ID,3) ; It return a ,which indicate the HPDWARN and CLKPLL_LL are set .
in the manual:" “In performing a delayed transmission, if the host microprocessor is late in invoking the dwt_starttx() function, (i.e. so that the DW1000’s system clock has passed the specified starttime and would have to complete almost a whole clock count period before the start time is reached), then the transmission is aborted (transceiver off) and the dwt_starttx() function returns the -1 error indication."
At first i guess may be the send time is too late,so I print the systim and the Response_tx_time,
systim=3089891902,Response_tx_tim=3089071143,
Yes it is too late
then I change the POLL_RX_TO_RESP_TX_DLY_UUS from 2600 to 8000, and print the time again
systim=3498533464,Response_tx_tim=3499095795
As you see ,the Response_tx_tim is larger than the systim, but the checkTxOK is still a, so i don’t know how to solve it? Who can help me ? My send code:
type or paste code here
case TA_TXRESPONSE_WAIT_SEND://4
{
int ret_A=0; uint32 poll_rx_ts_hi32=0;
poll_rx_ts = get_rx_timestamp_u64();//»ñµÃPoll°ü½ÓÊÕʱ¼äT2
poll_rx_ts_hi32 = poll_rx_ts>> 8;
Response_tx_time = (poll_rx_ts + (POLL_RX_TO_RESP_TX_DLY_UUS * UUS_TO_DWT_TIME)) >> 8;//¼ÆËãResponse·¢ËÍʱ¼äT3¡£
dwt_setdelayedtrxtime(Response_tx_time);//ÉèÖÃResponse·¢ËÍʱ¼äT3
dwt_setrxaftertxdelay(RESP_TX_TO_FINAL_RX_DLY_UUS);//ÉèÖ÷¢ËÍÍê³Éºó¿ªÆô½ÓÊÕÑÓ³Ùʱ¼ä
dwt_setrxtimeout(FINAL_RX_TIMEOUT_UUS);//½ÓÊÕ³¬Ê±Ê±¼ä
/*response°ü·¢ËÍ*/
dwt_writetxdata(sizeof(tx_resp_msg), tx_resp_msg, 0);
dwt_writetxfctrl(sizeof(tx_resp_msg), 0);
systim=dwt_readsystimestamphi32();
ret_A= dwt_starttx(DWT_START_TX_DELAYED | DWT_RESPONSE_EXPECTED ); //¿ªÆôÑÓ³Ù·¢ËͲ¢µÈ´ý½ÓÊÕfinal°ü
printf("systim=%lu,Response_tx_tim=%lu,poll_rx=%lu\n",systim,Response_tx_time,poll_rx_ts_hi32);
if (ret_A == DWT_ERROR)//ÅжÏÊÇ·ñ³öÏÖ´íÎó
{
ins.testAppState=TA_WAIT_DOOR;
ins.nextState=TA_WAIT_DOOR;
ins.previousState=TA_TXRESPONSE_WAIT_SEND;
printf("base_send_response_error\n");
}
else
{
ins.testAppState=TA_TXRESPONSE_WAIT_SEND;
ins.previousState=TA_TXRESPONSE_WAIT_SEND;
ins.nextState=TA_TX_WAIT_CONF;
printf("base_send_response\n");
}
break;
Blockquote
> Blockquote