LPC1768 to interface with ksz8863 and lwip

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

LPC1768 to interface with ksz8863 and lwip

2,504 Views
eliarad2
Contributor II

Hi

When LPC1768 , as a reference design , it works with lwip tcp example fine.

a udp example can send and receive data from windows app.

We connected a 3 port switch , ksz8863  from microchip , to LPC1768 and the udp is not working.

The status is:

1. There is a link to the switch, it can be read via the same code that reads the phy registers ( mdio and mdc are func1)

2. we can access using bit bang , smi and mii to the chip ( change mdio and mdc to gpio - func0)

3. we tried to use mac mode in the switch rather then phy more , both not working.

Does any one connected to any micro controller a Ethernet switch and worked with lwip?

does it require any changes in the code?

Do we need to configure the switch to work in phy more or mac mode ( just to be sure)

The question can be directly for LPC1768 + ksz8863 + lwip + udp 

but also for any micro controller ->  port switch -> lwip + udp.

Any information is welcome,

Thank you.

Labels (2)
3 Replies

152 Views
deepaktajanpure
Contributor II

If possible please share interfacing diagram of ksz8863 and lpc1768

0 Kudos
Reply

1,959 Views
eliarad2
Contributor II

We found the problem

in  emac_config.h 

there is PHY ADDRESS

/* The PHY address connected the to MII/RMII */
#define LPC_PHYDEF_PHYADDR 3

the phy address should be 3 

because the switch has 3 ports , where there the MII is connected to port 3 now 

it was connected to port 1 in the reference design

This is the only change that should be done, 

156 Views
deepaktajanpure
Contributor II

Hi,

I am also planning to interface KSZ8863 with LPC4088. As you have used LPC1768 from the same series of NXP, will you please share your code which will be helpful for me in implementing the driver for LPC4088?

Waiting for your kind reply.

 

Thanks

Deepak

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-734397%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ELPC1768%20to%20interface%20with%20ksz8863%20and%20lwip%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-734397%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EWhen%20LPC1768%20%2C%20as%20a%20reference%20design%20%2C%20it%20works%20with%20lwip%20tcp%20example%20fine.%3C%2FP%3E%3CP%3Ea%20udp%20example%20can%20send%20and%20receive%20data%20from%20windows%20app.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EWe%20connected%20a%203%20port%20switch%20%2C%20ksz8863%26nbsp%3B%20from%20microchip%20%2C%20to%20LPC1768%20and%20the%20udp%20is%20not%20working.%3C%2FP%3E%3CP%3EThe%20status%20is%3A%3C%2FP%3E%3CP%3E1.%20There%20is%20a%20link%20to%20the%20switch%2C%20it%20can%20be%20read%20via%20the%20same%20code%20that%20reads%20the%20phy%20registers%20(%20mdio%20and%20mdc%20are%20func1)%3C%2FP%3E%3CP%3E2.%20we%20can%20access%20using%20bit%20bang%20%2C%20smi%20and%20mii%20to%20the%20chip%20(%20change%20mdio%20and%20mdc%20to%20gpio%20-%20func0)%3C%2FP%3E%3CP%3E3.%20we%20tried%20to%20use%20mac%20mode%20in%20the%20switch%20rather%20then%20phy%20more%20%2C%20both%20not%20working.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EDoes%20any%20one%20connected%20to%20any%20micro%20controller%20a%20Ethernet%20switch%20and%20worked%20with%20lwip%3F%3C%2FP%3E%3CP%3Edoes%20it%20require%20any%20changes%20in%20the%20code%3F%3C%2FP%3E%3CP%3EDo%20we%20need%20to%20configure%20the%20switch%20to%20work%20in%20phy%20more%20or%20mac%20mode%20(%20just%20to%20be%20sure)%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EThe%20question%20can%20be%20directly%20for%20LPC1768%20%2B%20ksz8863%20%2B%20lwip%20%2B%20udp%26nbsp%3B%3C%2FP%3E%3CP%3Ebut%20also%20for%20any%20micro%20controller%20-%26gt%3B%26nbsp%3B%20port%20switch%20-%26gt%3B%20lwip%20%2B%20udp.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EAny%20information%20is%20welcome%2C%3C%2FP%3E%3CP%3EThank%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-734397%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3ELPC17xx%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELPCOpen%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2204102%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC1768%20to%20interface%20with%20ksz8863%20and%20lwip%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2204102%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIf%20possible%20please%20share%20interfacing%20diagram%20of%20ksz8863%20and%20lpc1768%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2204094%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC1768%20to%20interface%20with%20ksz8863%20and%20lwip%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2204094%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20am%20also%20planning%20to%20interface%20KSZ8863%20with%20LPC4088.%20As%20you%20have%20used%20LPC1768%20from%20the%20same%20series%20of%20NXP%2C%20will%20you%20please%20share%20your%20code%20which%20will%20be%20helpful%20for%20me%20in%20implementing%20the%20driver%20for%20LPC4088%3F%3C%2FP%3E%3CP%3EWaiting%20for%20your%20kind%20reply.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThanks%3C%2FP%3E%3CP%3EDeepak%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-734398%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC1768%20to%20interface%20with%20ksz8863%20and%20lwip%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-734398%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWe%20found%20the%20problem%3C%2FP%3E%3CP%3Ein%26nbsp%3B%20emac_config.h%26nbsp%3B%3C%2FP%3E%3CP%3Ethere%20is%20PHY%20ADDRESS%3C%2FP%3E%3CP%3E%2F*%20The%20PHY%20address%20connected%20the%20to%20MII%2FRMII%20*%2F%3CBR%20%2F%3E%23define%20LPC_PHYDEF_PHYADDR%203%3C%2FP%3E%3CP%3Ethe%20phy%20address%20should%20be%203%26nbsp%3B%3C%2FP%3E%3CP%3Ebecause%20the%20switch%20has%203%20ports%20%2C%20where%20there%20the%20MII%20is%20connected%20to%20port%203%20now%26nbsp%3B%3C%2FP%3E%3CP%3Eit%20was%20connected%20to%20port%201%20in%20the%20reference%20design%3C%2FP%3E%3CP%3EThis%20is%20the%20only%20change%20that%20should%20be%20done%2C%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E