ETHERNET DRIVER code for MPC5668G

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

ETHERNET DRIVER code for MPC5668G

1,077 Views
sukruthrameshba
Contributor III

Hi ,

I am using MPC5668G microcontroller.  I need a sample ethernet driver code to see the transmission and reception functionality. I am trying to establish a communication between MPC5668g and ethernet node from CANoe (VN5610) .

So can i get simple Ethernet driver code to see this communication happening?Petr Stancik

 

And to mention i have sample code with the tiltle "MPC5668X-FEC-EXTERNALLOOPBACK".

I have flashed it and trying to understand what exactly it is doing. Still dont have the clear picture on it. Can any one advise me on how to proceed with this code?

Labels (1)
3 Replies

669 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

"MPC5668X-FEC-EXTERNALLOOPBACK" is the simplest code example we have. It just sends and receives raw data in external loopback mode without any protocol. If it is not clear, you will have to spend some time reading the manual...

Then we can provide this application note:

http://www.nxp.com/files/32bit/doc/app_note/AN4577.pdf

http://www.nxp.com/files/32bit/doc/app_note/AN4577SW.zip

The complexity goes up, FNET ethernet stack is used. There are examples for UDP, TCP/IP, web server... 

The application note is written for MPC5646C but the ethernet module is the same on MPC5668G.

Regards,

Lukas

0 Kudos

669 Views
sukruthrameshba
Contributor III

Hello Mr. lukaszadrapa,

Thank you so much for your response.

Right now I am writing only low level driver , I don’t need entire stack.

I modified the sample code "MPC5668X-FEC-EXTERNALLOOPBACK" to the transceiver we are using .

Now I am able to see the ‘LINK UP’ between the nodes (MPC 5668G and CANoe).

But I am not able to see transmitted Ethernet Packet on the bus.

I have attached my modified code, Can you help me out if I have missed anything in this?

Best Regards,

Sukruth

0 Kudos

669 Views
martin_kovar
NXP Employee
NXP Employee

Hi Sukruth,

without any deep inspection of your code, I found, you have incorrectly configured GPIO pins. For example, FEC_MDIO is input/output pin and you have not set input a output buffer for this pin. Also FEC_RXD[x] are input pins and you have not set input buffer. So check all pins and it's I/O direction and set appropriate buffers.

Also remember all input pins should be pulled up or pulled down, so set WPE bit in SIU.PCR to 1 for all input pins.

Check the app note AN4577 which lukaszadrapa sent you. There are correct settings for all GPIO pins. Those settings are for MPC5646C, so you have to look at the reference manual of MPC5646C and check, which bits in PCR registers are set for input pins and output pins.

Regards,

Martin