SWCU192 November 2021 CC1312R7 , CC1352P7 , CC2652P7 , CC2652R7
At the start of a slave or master 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. The channel parameter is not allowed to be 37, 38, or 39 because they are not data channels. For the Bluetooth low energy 5 commands, 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 shall 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 the receiver or the transmitter. The operation proceeds with reception and transmission in turn until it ends by one of the end-of-command criteria.
When the demodulator obtains sync on a message, the message is received into the first available RX buffer that can fit the packet. The flags bCrcErr and bIgnore are set according to Table 26-128, depending on the CRC result and whether the SN field of the header was the same as the SN field of the last successfully received packet. A received packet that has a payload length of 0 shall be viewed as an empty packet, which means that if pParams->rxConfig.bAutoflushEmpty is 1 and bCrcErr and bIgnore are both 0, the packet is removed from the RX buffer.
CRC Result | SN Different from Previous | bCrcErr | bIgnore |
---|---|---|---|
OK | Yes | 0 | 0 |
OK | No | 0 | 1 |
NOK | X | 1 | 0 |
If there is no available RX buffer with enough available space to hold the received packet, the received data shall be discarded. However, the packet shall be received so that the CRC can be checked. When the packet is received, the radio CPU shall set the sequence bits so that a retransmission of the lost packet is requested (that is, NACK), unless the packet would have been discarded from the RX queue anyway due to the setting of pParams->rxConfig.
If two subsequent packets are received with CRC error, the command shall end, as required by the Bluetooth low energy specification.
When a packet is to be transmitted or retransmitted, it is read from the current data entry in the TX queue unless the TX queue is empty or an auto-empty packet has to be retransmitted. The radio CPU shall create the header as follows.
There are a number of interrupts that can be raised on different conditions. The pOutput structure contains a number of counters corresponding to the interrupts. Table 26-129 lists the conditions for incrementing each counter or raising an interrupt. There may be more than one condition fulfilled after a packet is transmitted or received. In the list of conditions, the term acknowledgment is used to define a successfully received packet with an NESN value in the header that is different from the SN value of the last transmitted packet.
Condition | Counter Incremented | Interrupt Generated |
---|---|---|
Packet transmitted | nTx | Tx_Done |
Packet transmitted and acknowledgment received | nTxAck | Tx_Ack |
Packet with LLID = 11b transmitted | nTxCtrl | Tx_Ctrl |
Packet with LLID = 11b transmitted and acknowledgment received | nTxCtrlAck | Tx_Ctrl_Ack |
Packet with LLID = 11b transmitted, acknowledgment received, and acknowledgment sent | nTxCtrlAckAck | Tx_Ctrl_Ack_Ack |
Packet transmitted with same SN as previous transmitted packet | nTxRetrans | Tx_Retrans |
Packet with payload transmitted and acknowledgment received | nTxEntryDone | Tx_Entry_Done |
Packet received with bCrcErr = 0, bIgnore = 0, and payload length > 0 | nRxOk | Rx_Ok |
Packet received with CRC error (bCrcErr = 1) | nRxNok | Rx_Nok |
Packet received with bCrcErr = 0 and bIgnore = 1 | nRxIgnored | Rx_Ignored |
Packet received with bCrcErr = 0, bIgnore = 0, and payload length = 0 | nRxEmpty | Rx_Empty |
Packet received with LLID = 11b, bCrcErr = 0 and bIgnore = 0 | nRxCtrl | Rx_Ctrl |
Packet received with LLID = 11b, bCrcErr = 0 and bIgnore = 0, and acknowledgment sent | nRxCtrlAck | Rx_Ctrl_Ack |
Packet received that did not fit in RX buffer and was not to be flushed | nRxBufFull | Rx_Buf_Full |
The first RX data entry in the RX queue changed state to finished | — | Rx_Entry_Done |
The radio CPU shall maintain two counters: one packet counter nPkt and one NACK counter nNack. At the start of the master or slave radio operation, both counters shall be initialized to pParams->maxPkt and pParams->maxNack, respectively. The packet counter nPkt shall be decremented each time a packet transmitted. The NACK counter nNack shall be decremented if a packet is received that does not contain an acknowledgment of the last transmitted packet, otherwise it shall be reset to pParams->maxNack if an acknowledgment is received. If either counter counts to 0, the operation shall end. This shall happen after a packet is received for master and a packet is transmitted for slave. Setting pParams->maxPkt or pParams->maxNack to 0 shall disable the corresponding counter functionality.
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. After the radio operation ends, any transmitted packet shall have MD = 0 and the connection event shall end after the next packet is transmitted for a slave or received for a master. If the immediate command CMD_STOP is received by the radio CPU, it shall have the same meaning as the end trigger occurring (except that after ending, the status code shall be CMD_DONE_STOPPED). For slave commands, pParams->endTrigger.triggerType may take the value BLE_TRIG_REL_SYNC, which is 15. This value means that pParams->endTime is relative to the timestamp of the first received packet. If no packet is received, the end trigger will not occur (the timeout trigger should be used to handle this situation).
The register pParams->seqStat contains bits that shall be updated by the radio CPU during operation and shall be used for getting correct operation on SN, NESN, and retransmissions. The rules that must be followed for the radio CPU are:
When an interrupt is raised as described in the previous list, the corresponding counter given in
Table 26-129 shall be incremented.
In the header of a transmitted packet, the MD bit shall be set according to the following rules:
The pOutput structure contains counters, which shall be updated by the radio CPU as explained in the previous list and in Table 26-129. 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. In addition to the counters, the following fields shall be set by the radio CPU:
For correct operation, the value of pParams->seqStat shall be the same at the beginning of a command as the value at the end of the previous operation of the same connection. The TX queue should also be unmodified between commands operating on the same connection (except that packets may be appended to the queue).