LPC4088 QuickStart Board - How to Expand - Ethernet

Overview

The LPC4088 QuickStart Board has an on-board 100/10Mbps Ethernet interface, including the RJ45 connector and magnetics. Everything is ready-to-go with the Ethernet interface. The mbed Ethernet driver is ported and ready for the hardware.

Examples


Report

8 comments on LPC4088 QuickStart Board - How to Expand - Ethernet:

15 Jan 2014

Is it possible to get the Ethernet link status from the LPC4088 like you can with the LPC1768? The Eth Phys are different and currently lpc_phy.h does not map correctly. See http://mbed.org/users/edodm85/notebook/ethernet-connection-status/

Since the LPC4088 doesn't have a direct link_status pins like the LPC1768 has (P1_25 & P1_26), it would be nice to have a function to call that could get the real time Eth link status.

...kevin

16 Jan 2014

Have a look at the ethernet_link function in ethernet_api.c to see how link status is retrieved from the PHY.

ethernet_api.c

16 Jan 2014

In code:

if (eth.link()) {

Compiler error: Error: Class "EthernetInterface" has no member "link" in "main_kb.cpp", Line: 1217, Col: 13

I see the code in the API, but how do I access it?

int ethernet_link(void) {

    if (phy_id == DP83848C_ID) {
      return (phy_read(PHY_REG_STS) & PHY_STS_LINK);
    }
    else { // LAN8720_ID
      return (phy_read(PHY_REG_BMSR) & PHY_BMSR_LINK);
    }
}

...kevin

16 Jan 2014

The message says "Class EthernetInterface has no member link in...." just because as it is written,

the function "int ethernet_link(void) {....}" is not an method from a class, it's just a function as strcpy, printf, can be.

So from, just call :

int linkState; linkState = ethernet_link();

and you got It !

17 Jan 2014

That too comes up with a compiler error:

Error: Identifier "ethernet_link" is undefined in "main.cpp", Line: 1433, Col: 17

17 Jan 2014

First of all ethernet_link() is an internal function (implemented in the LPC4088 HAL) and not part of the public mbed API. I referred to that function since I thought you wanted to know how link status is checked against the Ethernet PHY. In your first post you referred to code that isn't part of mbed's public API, but instead using the PHY directly.

Secondly there is a link() method in the Ethernet class. If you are not using this class you have to check the class/library documentation of the class you are using to see if there is an equivalent method. The code below show how to use the Ethernet class to check link status.

Check link status

#include "mbed.h"

Ethernet eth;

int main() {
        
    while(1) {              
        printf("Link status: %s\n", (eth.link() == 0 ? "down" : "up"));        
        wait(2.0);
    }
}
17 Jan 2014

Thanks,

I ended up using 2 classes in order for the link to work. eth for services and elink just for the link status

EthernetInterface eth;                      //Ethernet connection
Ethernet elink;                             //Ethernet connection used only for link status
11 Jun 2014

Hello,

What is the default RX Ethernet buffer size? I see packet loss on quick, big UDP datagrams. The only thing I've found is

#define EMAC_NUM_RX_FRAG         4           /**< Num.of RX Fragments 4*1536= 6.0kB */`

in lpc17xx_emac.h, and in lpc_emac_config.h :

#define LPC_NUM_BUFF_RXDESCS 3

And, is there a way to add more capacity to it? A trade-off with send buffer would probably be OK for my application.

Thanks for the answer :)

Please log in to post comments.