Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DP83848 doesn't want to work #3

Open
MicroKoder opened this issue Dec 13, 2021 · 3 comments
Open

DP83848 doesn't want to work #3

MicroKoder opened this issue Dec 13, 2021 · 3 comments

Comments

@MicroKoder
Copy link

Hi!
I'm trying this example with another PHY - DP83848.
It works well with this example: https://github.com/sandeepmistry/pico-rmii-ethernet
It sends DHPC requests, i see it in wireshark and router logs, but it doesn't receive data.
I tried to dump received data to serial port. All bytes is received and match with wireshark, but all packages have same size - 1518 bytes and they are not splitted.
I always see this message in serial output:
"invalid packet received (crc)"
could you help me, what can be wrong?

@messani
Copy link
Owner

messani commented Dec 13, 2021

Hi...
I don't think that I can help you. This was only an experiment. I do not have even tools to measure signals (I only have cheap 24MHz analyzer from china which only works at cca 8MHz). This code was made by method of trial and error.

I use this ethernet module in my another experiment and I found several bugs in this code.

  1. It is probably necessarry to clear interrupts before call pio_sm_init() in lan8720_rx.pio
+    // Clear IRQ flag before starting
+    hw_clear_bits(&pio->inte0, 1u << sm);
+    hw_clear_bits(&pio->inte1, 1u << sm);
+    pio->irq = 1u << sm;

This was inspired by example code pio-examples/pio/i2c.pio

  1. when reading data through RMII interface, bit must be read right after falling edge(). I do not know why this worked at this project, but I got readings which was shifted by 1 bit in another project.

I don't think that any of these thinks will help you. You wrote that all messages have 1518 bytes. Are they full of zeros (I suppose that there are no traffic at network)? Or are they padded to 1518 bytes?
I guess there is something wrong with configuration of CRS pin.

@MicroKoder
Copy link
Author

sorry, I was wrong. The package size is correct, but every received package fails crc check. Several bytes received is different with wireshark

@messani
Copy link
Owner

messani commented Dec 30, 2021

Try to increase RPi Pico clock. Or change wires between pico and DP83848.
Or you can debug it and check what the problem is. Whether it is changed bit, or data are shifted.
If data are shifted, increasing clock could help. If a bit is changed, there can be problem with wiring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants