GD32F20x User Manual
803
Magic packet detection
Another wakeup method is detecting Magic Packet frame (see ‘Magic Packet Technology’,
Advanced Micro Devices). A Magic Packet frame is a special frame with formed packet solely
intended for wakeup purposes. This packet can be received, analyzed and recognized by the
Ethernet block and used to trigger a wakeup event. Setting MPE bit in ENET_MAC_WUM
register can enable this function. This type of frame’s format is as follows: starts by 6
continuous bytes of the value 0xFF (0xFFFF FFFF FFFF) in anywhere of the frame behind
the destination and source address field, then there are 16 duplicate MAC addresses without
any interruption and pause. If there is any discontinuity between repeating it 16 times, MAC
needs to re-detect 0xFFFF FFFF FFFF in the receive frame. WUM module continuously
monitors each frame received. When a Magic Packet frame passing the address filter, MAC
will detect its format with Magic Packet format, once the format is matched the WUM will make
MAC wakeup from power down state. Then the MAC wakes up from power-down state after
receiving a Magic Packet frame. Module also accepts multicast frames as Magic Packet frame.
Example: An example of a Magic Packet with station address 0xAABB CCDD EEFF is the
following (MISC indicates miscellaneous additional data bytes in the packet):
<DESTINATION><SOURCE><MISC>
……………………………………………………….FF FF FF FF FF FF
AABB CCDD EEFF AABB CCDD EEFF AABB CCDD EEFF AABB CCDD EEFF
AABB CCDD EEFF AABB CCDD EEFF AABB CCDD EEFF AABB CCDD EEFF
AABB CCDD EEFF AABB CCDD EEFF AABB CCDD EEFF AABB CCDD EEFF
AABB CCDD EEFF AABB CCDD EEFF AABB CCDD EEFF AABB CCDD EEFF
<MISC><FCS>
Upon detecting a Magic Packet, the MPKR bit in ENET_MAC_WUM register will be set. If the
Magic Packet interrupt is enabled, the corresponding interrupt will generate.
Precautions during system power-down state
When the MCU is in Deep-sleep mode, if external interrupt line 19 is enabled, Ethernet WUM
module can still detecting frames. Because the MAC in power-down state needs detecting
Magic Packet or remote wakeup frame, the REN bit in ENET_MAC_CFG register must be
maintained set. The transmit function should be turned disable during the power-down state
by clearing the TEN bit in the ENET_MAC_CFG register. Moreover, the Ethernet DMA block
should be disabled during the power-down state, because it is not necessary that the Magic
Packet or remote wakeup frame is forwarded to the application. Application can disable the
Ethernet DMA block by clearing the STE bit and the SRE bit (for the TxDMA and the RxDMA,
respectively) in the ENET_DMA_CTL register.
Follow steps are recommended for application to enter and exit power-down state:
Summary of Contents for GD32F20 Series
Page 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Page 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Page 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Page 385: ...GD32F20x User Manual 385 ...
Page 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...