433
SAM4CP [DATASHEET]
43051E–ATPL–08/14
27.7
MAC Coprocessor
PPLC accelerators can be used to perform PRIME MAC-specific tasks by hardware, decreasing CPU load from the
external MCU/MPU. For that purpose, Cyclic Redundance Check (CRC) and AES128 encryption blocks are available in
PPLC.
Please refer to Atmel doc43048 “Atmel PRIME Implementation” for Atmel software package detailed description and
functionality.
27.7.1 Cyclic Redundancy Check (CRC)
27.7.1.1 PRIME v1.3 CRC
There are three types of MAC PDUs (generic, promotion and beacon) for different purposes, and each one has its own
specific CRC. There is a hardware implementation of every CRC type calculated by the MAC layer. This CRC hardware-
calculation is enabled by default. Note that the CRC included at the physical layer is also a hardware implementation
available (enabled by default).
Figure 27-3.
Example: Generic MAC PDU format and generic MAC header detail
In transmission all CRC bytes are real-time calculated and the last bytes of the MAC PDU are overwritten with these
values, (provided that the field HT in the first byte of the MAC header in transmission data is equal to the corresponding
MAC PDU type).
In reception the CRC bytes are also real-time calculated and these bytes are checked with the last bytes of the MAC
PDU. If the CRC is not correct, then an error flag is activated, the complete frame is discarded, and the corresponding
error counter is increased. These counters allow the MAC layer to take decisions according to error ratio.
For the Generic MAC PDU
, there is an 8-bit CRC in the Generic MAC header, which corresponds to PRIME HDR.HCS.
In reception if this CRC doesn’t check successfully, the current frame is discarded and no interruption is generated.
This works in the same way as CRC for the PHY layer (CRC Ctrl, located in the PHY header, see PRIME specification for
further information).
There is another CRC for the Generic MAC PDU which is the last field of the GPDU. It is 32 bits long and it is used to
detect transmission errors. The CRC shall cover the concatenation of the SNA with the GPDU except for the CRC field
itself. In reception, if the CRC is not successful then an internal flag is set and the error counter is increased.
For the Promotion Needed PDU
there is an 8-bit CRC, calculated with the first 13 bytes of the header. In reception, if
this CRC is not correct, then an internal flag is set and the corresponding error counter is increased.
For the Beacon PDU
there is a 32-bit CRC calculated with the same algorithm as the one defined for the CRC of the
Generic MAC PDU. This CRC shall be calculated over the complete BPDU except for the CRC field itself. In reception, if
this CRC is not successful, then an internal flag is set and the same error counter used for GPDU is increased. The
hardware used for this CRC is the same as the one used for GPDU.
Generic MAC Header
Packet 1
. . .
Packet n
CRC
Unused
HDR.HT
Reserved
Reserved
HDR.DO
HDR. LEVEL
HDR. HCS
MSB
LSB