Hello guys,
I have a problem with receiving a very first message after I do a transmission with the same device. If I did not perform transmission in the device (after boot) I can catch every incoming message, so it has to be something connected with the transmission before (something is reconfigured or I don’t know). I am confused about that because I spend I lot of time solving this issue but unsuccessfully and I am totally running out of any ideas.
I would like to thank to [color=#333333][size=small][size=medium][color=#426276]zoran skrba[/color][/size][/size][/color] for trying to help me, but i am still stuck
- I did not use auto re-enable.
- I did not use wait for a response.
- It cannot be caused due to a timing issue, because sending a message from another device is done for now by user button, so definitely when the message from another device is sent, the targeted device is already in receiver mode for sure.
TRANSMISSION
dwt_forcetrxoff(); // go to idle from receive mode
stats = dwt_writetxdata(txDataLen,(uint8_t *)txData,0); // fill TX buffer
stats = dwt_writetxfctrl(txDataLen, 0); // write TX cfg (buffer len and offset)
stats = dwt_starttx(DWT_START_TX_IMMEDIATE);// start transmission
TX callback:
dwt_setrxtimeout(0); // diasbale RX timeout
rxEnFlag = dwt_rxenable(DWT_START_RX_IMMEDIATE); //manually reenable RX
RECEPTION
…after device initialization…
rxEnstat = dwt_rxenable(0); // turn on the receiver
RX callback:
dwt_readrxdata(rxData,DataLen,0); // read RX buffer
dwt_setrxtimeout(0); // diasbale RX timeout
rxEnstat = dwt_rxenable(DWT_START_RX_IMMEDIATE); // turn on the receiver
BEHAVIOR DESCRIBTION:
As I said every message except very first one just after the transmission is received successfully:
[code][18/09/18 - 15:05:11:635] NEW ISR CALLED //ISR start
[18/09/18 - 15:05:11:636] SYS_STAT 0000800103 // all
[18/09/18 - 15:05:11:639] SYS_MASK 3C37FF80 // this
[18/09/18 - 15:05:11:639] SYS_STATE 0B00050C00 // is
[18/09/18 - 15:05:11:642] SYS_STAT 0000806F03 // done
[18/09/18 - 15:05:11:642] SYS_MASK 3C37FF80 // in one
[18/09/18 - 15:05:11:644] SYS_STATE 0000010000 // do {dwt_isr()} while (IRQ == 1)
[18/09/18 - 15:05:11:647]
[18/09/18 - 15:05:11:647] RX callback routine - receiver reenable; // callback called
[18/09/18 - 15:05:11:650]
[18/09/18 - 15:05:11:650] RECEIVED DATA: AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA: // print out received data in RX callback
[18/09/18 - 15:05:11:656] AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:
[18/09/18 - 15:05:11:662] AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:C1:
[18/09/18 - 15:05:11:664] D5:
[/code]
Here is log from receiving after transmission is performed (ISSUE!):
[18/09/18 - 15:11:06:139] NEW ISR CALLED // TX before investigated reception
[18/09/18 - 15:11:06:140] SYS_STAT 02008000F3 // ...
[18/09/18 - 15:11:06:142] SYS_MASK 3C37FF80 // continuing ...
[18/09/18 - 15:11:06:144] SYS_STATE 0000010000 // ...
[18/09/18 - 15:11:06:145] TX callback routine - reenable RX // ...
[18/09/18 - 15:11:06:151] RX ENABLE: OK // ...
[18/09/18 - 15:11:11:261]
[18/09/18 - 15:11:11:262]
[18/09/18 - 15:11:11:262] NEW ISR CALLED // ISR start of tracked reception
[18/09/18 - 15:11:11:262] SYS_STAT 0000800103 // ...
[18/09/18 - 15:11:11:264] SYS_MASK 3C37FF80 // ...
[18/09/18 - 15:11:11:265] SYS_STATE 0B00050C00 // ...
ISR is called (IRQ pin changes to its active value) BUT only RXPRD bit arises (saing that preable is detected). There is no additional bit marking that some problem or error occured. I have masked every interrupt connect with reception: SYS_MASK: 3C37 FF80. The duration and progression of this blank interrupt is also suspicions:
[attachment=195]
As you can see, states register value is 0x00050C00 which mead according to APS022 that the DW1000 is in RX state (0x5) and data reception (0x0C). From SYS_STAT register it could be derived, that preamble is successfully detected, but why SFD and etc. not? I am sure that message is transmitter properly because I have UWB sniffer from Arduino from my preliminary project and it receives it successfully every time.
Then after that, nothing is reconfigured, but the second message after this is received properly.
[21/09/18 - 12:59:08:085] NEW ISR CALLED
[21/09/18 - 12:59:08:086] SYS_STAT 00 0080 0103
[21/09/18 - 12:59:08:087] SYS_MASK 3C37 FF80
[21/09/18 - 12:59:08:087] SYS_STATE 0B 0005 0C00
[21/09/18 - 12:59:08:090] SYS_STAT 00 0080 6F03
[21/09/18 - 12:59:08:093] SYS_MASK 3C37 FF80
[21/09/18 - 12:59:08:093] SYS_STATE 00 0001 0000
[21/09/18 - 12:59:08:097]
[21/09/18 - 12:59:08:097] RX callback routine - receiver reenable;
[21/09/18 - 12:59:08:100]
[21/09/18 - 12:59:08:100] RECEIVED DATA: AA:AA:3F:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:
[21/09/18 - 12:59:08:106] AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:
[21/09/18 - 12:59:08:111] AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:AA:E0:
[21/09/18 - 12:59:08:119] 5E:
[21/09/18 - 12:59:08:119] RXEN:OK
Did you have any idea, what should I try? Or did you somebody met with something similar?
Thank you very much for any advice.
Best regards.