SWCU185G January 2018 – June 2024 CC1312PSIP , CC1312R , CC1352P , CC1352R , CC2642R , CC2642R-Q1 , CC2652P , CC2652PSIP , CC2652R , CC2652RB , CC2652RSIP , CC2662R-Q1
The generic receiver command may be used to receive physical layer test packets or to receive any packet, such as in a packet sniffer application.
A generic receiver operation is started by a CMD_BLE_GENERIC_RX or CMD_BLE5_GENERIC_RX command. In the command structure, it shall have a pParams parameter of the type defined in Table 26-101 and a pOutput parameter of the type defined in Table 26-114. At the start of a generic receiver operation, the radio CPU shall wait for the start trigger. It shall then program the frequency based on the channel parameter of the command structure. For CMD_BLE5_GENERIC_RX, it shall also set up the PHY mode given in phyMode.mainMode. The radio CPU shall set up the access address defined in pParams->accessAddress and use the CRC initialization value defined in pParams->crcInit. The whitener shall be set up as defined in the whitening parameter. The radio CPU shall then configure receiver.
In a generic receiver operation, the only assumption made on the packet format is that the second received byte is a length field that indicates the length of the payload following that byte, and that a standard BLE-type CRC is appended to the packet. The number of bits in the length field is assumed to be the same as for an advertising packet, that is by default 8 bits if configured using CMD_BLE5_RADIO_SETUP and 6 bits otherwise.
After tuning to the correct channel, the radio CPU shall start listening for a packet. If sync is obtained on the demodulator, the message is received into the RX queue (if any). If the length is greater than the maximum allowed length for BLE legacy advertising packets (37, but can be overridden), reception shall be stopped and restarted.
If pParams->pRxQ is NULL, the received packets shall not be stored. The counters shall still be updated and interrupts generated.
If a packet is received with CRC error, the bCrcErr bit shall be set. The bIgnored flag shall never been set for the generic RX command.
If the packet being received did not fit in the RX queue, the packet shall be received to the end, but the received bytes are not stored. If the packet would normally not have been discarded from the RX buffer, the operation shall end.
A trigger to end the operation is set up by pParams->endTrigger and pParams->endTime. If the trigger that is defined by this parameter occurs, the radio operation shall end as soon as possible. If it occurs while waiting for sync, the operation shall end immediately. If it occurs at another time, the operation shall continue until the current packet is fully received, and then end. If the immediate command CMD_STOP (see Section 26.3.3.2.2) is received by the radio CPU, it shall have the same meaning as the end trigger occurring, except that the status code after ending shall be CMD_DONE_STOPPED.
The output structure pOutput contains fields that give information on the command being run. The radio CPU shall not initialize the fields, so this must be done by the system CPU when a reset of the counters is desired. The fields shall be updated by the radio CPU as described in the following list. The list also indicates when interrupts shall be raised in the system CPU.
After a packet is received, reception shall be restarted on the same channel if pParams->bRepeat = 1, the end event has not been observed, and the packet fit in the receive queue. If pParams->bRepeat = 0, the operation shall always end after receiving a packet.
A generic RX operation shall end with one of the statuses listed in Table 26-164. The status field of the command structure after the operation is ended indicates the reason why the operation ended. In all cases, a Command_Done interrupt is raised. In each case, the result of TRUE, FALSE, or ABORT, is indicated, which will decide the next action, as defined in Section 26.3.2.5.2. The pNextOp field of a generic RX command structure may point to the same command structure. That way, RX may be performed until the end trigger or until the RX buffer goes full.
Condition | Status Code | Result |
---|---|---|
Received a packet with CRC OK and pParams->bRepeat = 0 | BLE_DONE_OK | TRUE |
Received a packet with CRC error and pParams->bRepeat = 0 | BLE_DONE_RXERR | TRUE |
Observed trigger indicated by pParams->endTrigger while waiting for sync | BLE_DONE_ENDED | FALSE |
Observed trigger indicated by pParams->endTrigger, then finished receiving packet | BLE_DONE_ENDED | FALSE |
Observed CMD_STOP while waiting for sync | BLE_DONE_STOPPED | FALSE |
Observed CMD_STOP, then finished receiving packet | BLE_DONE_STOPPED | FALSE |
Received CMD_ABORT | BLE_DONE_ABORT | ABORT |
No space in RX buffer to store received packet | BLE_ERROR_RXBUF | FALSE |
Illegal value of channel | BLE_ERROR_PAR | ABORT |