Skip to content

Commit

Permalink
Correct the definition of M487/NUC472 EMAC NU_ETH_MAX_FLEN & PACKET_B…
Browse files Browse the repository at this point in the history
…UFFER_SIZE
  • Loading branch information
cyliangtw committed Dec 10, 2019
1 parent 54d8c40 commit 42103f0
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Expand Up @@ -263,7 +263,7 @@ void numaker_eth_init(uint8_t *mac_addr)
EMAC->CAMEN = 1; // Enable CAM entry 0

/* Limit the max receive frame length to 1514 + 4 */
EMAC->MRFL = 1518;
EMAC->MRFL = NU_ETH_MAX_FLEN;
reset_phy();

EMAC_ENABLE_RX();
Expand Down
Expand Up @@ -85,7 +85,7 @@
#define RX_DESCRIPTOR_NUM NU_RX_RING_LEN//4 //2 // 4: Max Number of Rx Frame Descriptors
#define TX_DESCRIPTOR_NUM NU_TX_RING_LEN//4 //2 // 4: Max number of Tx Frame Descriptors

#define PACKET_BUFFER_SIZE NU_ETH_MAX_FLEN//1520
#define PACKET_BUFFER_SIZE ( NU_ETH_MAX_FLEN + ((NU_ETH_MAX_FLEN%4) ? (4 - (NU_ETH_MAX_FLEN%4)) : 0) ) //For DMA 4 bytes alignment

#define CONFIG_PHY_ADDR 1

Expand Down
Expand Up @@ -230,7 +230,7 @@ void numaker_eth_init(uint8_t *mac_addr)
numaker_set_mac_addr(mac_addr); // need to reconfigure hardware address 'cos we just RESET emc...

/* Limit the max receive frame length to 1514 + 4 */
EMAC->MRFL = 1518;
EMAC->MRFL = NU_ETH_MAX_FLEN;
reset_phy();

EMAC->CTL |= EMAC_CTL_STRIPCRC_Msk | EMAC_CTL_RXON_Msk | EMAC_CTL_TXON_Msk | EMAC_CTL_RMIIEN_Msk | EMAC_CTL_RMIIRXCTL_Msk;
Expand Down
Expand Up @@ -84,7 +84,7 @@
#define RX_DESCRIPTOR_NUM NU_RX_RING_LEN//4 //2 // 4: Max Number of Rx Frame Descriptors
#define TX_DESCRIPTOR_NUM NU_TX_RING_LEN//4 //2 // 4: Max number of Tx Frame Descriptors

#define PACKET_BUFFER_SIZE NU_ETH_MAX_FLEN//1520
#define PACKET_BUFFER_SIZE ( NU_ETH_MAX_FLEN + ((NU_ETH_MAX_FLEN%4) ? (4 - (NU_ETH_MAX_FLEN%4)) : 0) ) //For DMA 4 bytes alignment

#define CONFIG_PHY_ADDR 1

Expand Down
Expand Up @@ -42,7 +42,7 @@
#define NU_BUFF_ALIGNMENT 4
#define PHY_LINKED_STATE 1
#define PHY_UNLINKED_STATE 0
#define PACKET_BUFFER_SIZE NU_ETH_MAX_FLEN
#define PACKET_BUFFER_SIZE ( NU_ETH_MAX_FLEN + ((NU_ETH_MAX_FLEN%4) ? (4 - (NU_ETH_MAX_FLEN%4)) : 0) ) //For DMA 4 bytes alignment

extern "C" void numaker_eth_rx_next(void);
/* \brief Flags for worker thread */
Expand Down
Expand Up @@ -22,7 +22,7 @@
#define NU_RX_RING_LEN (8)
#define NU_TX_RING_LEN (4)

#define NU_ETH_MAX_FLEN (1520)
#define NU_ETH_MAX_FLEN (1518)

#define NU_HWADDR_SIZE (6)

Expand Down

0 comments on commit 42103f0

Please sign in to comment.