Hi,
I have an issue where CMD_PROP_TX sometimes fails to transmit - the command struct's status field is ACTIVE indefinitely. The radio core is set up with rf_patch_cpe_sl_longrange (revision 18438).
A bit of background: the setup I'm working on is normally in continuous RX (CMD_PROP_RX_ADV). It receives commands to transmit at an absolute time over a serial bus. The way I stop RX and enter TX is the following:
1. set up a RAT timer compare with good margin to the planned TX time
2. when the compare interrupt triggers, I send a CMD_ABORT to the radio core to stop RX
3. the following chain of radio commands is set up and sent to the radio core:
- CMD_FS for TX
- CMD_PROP_TX with startTime set to the planned transmit time
- CMD_FS for RX
- CMD_PROP_RX_ADV
the intention of this chain being to perform the TX and return to RX such that a new round of RX and later TX can begin. CMD_PROP_RADIO_DIV_SETUP is sent once as part of the radio initialization and finishes without error.
Sometimes, it seems that the RAT compare triggers right as the radio core is busy receiving a packet, such that an IRQ_RX_ABORTED is raised after CMD_ABORT is sent. Regardless, the CMD_FS for TX finishes with CMDSTA_Done and also raises an IRQ_COMMAND_DONE where I check that the command's status field is DONE_OK. However, the CMD_PROP_TX step never finishes in these cases. I have the PA_ENABLE signal tied to a GPIO, which never transitions high. For debugging purposes I set up a 2nd RAT compare for ~20 ms after the planned TX time (at which time the TX step should definitely have finished), and I see that the status field of the CMD_PROP_TX command struct is still ACTIVE at that time. I also checked the command start time to verify that it is correct.
Neither IRQ_INTERNAL_ERROR nor IRQ_SYNTH_NO_LOCK are triggered in these cases. IRQ_COMMAND_DONE never triggers either, because the TX step is just ACTIVE indefinitely. The TX step is set up with startTrigger.pastTrig = false, so I don't think I'm missing the TX time margin in these scenarios (otherwise TX would fail with ERROR_PAST_START).
Side note: the same setup is also used with rf_patch_cpe_genfsk, and I have never seen this problem with that RF patch. Perhaps I'm hitting a timing-based race condition, or maybe my setup doesn't play nice with rf_patch_cpe_sl_longrange.
I did see this thread which seems somewhat related, but as I understand, OP was seeing the issue on every transmission. That ticket wasn't resolved either.
Do you have any suggestions for further debugging?
thanks,
Fredrik