How to reflect asignment of ethernet pins to lwip middleware

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to reflect asignment of ethernet pins to lwip middleware

Jump to solution
1,040 Views
luimarma
Contributor III

Hi,

I am developing a solution with LPC54018 microcontroller and ethernet.

At first I have been trying to develop a custom board with LPC54018J2MET180, but the prototype is giving me problems when trying to flash the program to the internal QSPI flash.

As the problems seem to be related to the LPC chip, I suspect that the state of the art of my board assembler technilogy is not ready for BGA packages. Thus I have been checking for a replacement part for this project with more "conventional" chip package.

I have comed out with LPC54606J512BD100E that seems to fulfill my needs.

As this chip has a reduced set of pins, I am forced to move ethernet pins from the standard development board asignment to a custom one.

I know that for the init of the board I have to modify the pin_mux.c file to reflect the asignment, but I cannot figure out how is this binded to the network interface init. I suppose that somehow this must be related to some code in lwip middleware, but I have searched high and low without any success.

Anywone does know how to reflect the custom pin asignment?

1 Solution
1,002 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

This is my understanding, although the PIO0_26 is connected to the Reset pin of PYH, but there is not an api function to set/clear the pin to reset the PHY.

I copy the PIO0_26 pin assignment code, it enables the on-chip pull-up resistor, so the pin is high after the line is executed, the PHY can work.

If you do want to reset the PHY, you have to configure the pin as GPIO mode and output mode, clear the pin, after a delay, set the pin.

const uint32_t port2_pin26_config = (/* Pin is configured as PIO2_26 */
IOCON_PIO_FUNC0 |
/* Selects pull-up function */
IOCON_PIO_MODE_PULLUP |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);

 

Hope it can help you

BR

XiangJun Rong

View solution in original post

3 Replies
1,020 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

The LWIP is the third party Ethernet stack, it can adapt to all mcu with Ethernet module, so the adapting code is required.

Regarding the pin assignment, it is independent part, the LWIP and even adapting code does not have anything to do with the pin assignment code. After you have completed the pin assignment, the LWIP and adapting code think that the ethernet pin will function as the ethernet.

In other words, it is okay to call the BOARD_InitPins() api function before you init the etherent, the pin assignment code is NOT part of ethernet.

Hope it can help you

BR

XiangJun Rong

 

 

 

1,010 Views
luimarma
Contributor III

Hi,

I think that this may be valid for most of the signals that are set up as Ethernet pins, but for example in the LPC56XX development board P2_26 is used to reset the PHY (LAN8720A) this line is set up as general I/O pin, so how can the driver know that we asigned this signal to another port, like in my case P0_21?

1,003 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

This is my understanding, although the PIO0_26 is connected to the Reset pin of PYH, but there is not an api function to set/clear the pin to reset the PHY.

I copy the PIO0_26 pin assignment code, it enables the on-chip pull-up resistor, so the pin is high after the line is executed, the PHY can work.

If you do want to reset the PHY, you have to configure the pin as GPIO mode and output mode, clear the pin, after a delay, set the pin.

const uint32_t port2_pin26_config = (/* Pin is configured as PIO2_26 */
IOCON_PIO_FUNC0 |
/* Selects pull-up function */
IOCON_PIO_MODE_PULLUP |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);

 

Hope it can help you

BR

XiangJun Rong