Skip to content

[eppp]: Support for transport via Ethernet (phy or emac) #622

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

david-cermak
Copy link
Collaborator

@david-cermak david-cermak commented Jul 25, 2024

  • Using a real phy chip, via a standard Ethernet cable
  • Using a dummy phy, by means of EMAC to EMAC connection
  • Added emac2emac example which demonstrates overriding (standard) Ethernet drivers with the custom one: eth_dummy_phy


- Internal EMAC with real PHY chip
* TCP - 5Mbits/s
* UDP - 8Mbits/s
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm quite surprised with such poor performance. Do you have idea what could be the bottle neck and why it isn't at least as good as SDIO?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would probably get similar performance as SDIO, after some optimizations; tested just briefly with all defaults.
I'm planning on looking into it at some point.

@david-cermak david-cermak force-pushed the feat/eppp_emac2emac branch from 001855e to da05de2 Compare July 26, 2024 08:45
@david-cermak
Copy link
Collaborator Author

@kostaond Thanks taking a look at the emac2emac option. I must say that I concur with your assessment and think that this option is probably not a viable transport option for eppp at this moment.

My suggestion is that we drop the emac2emac option in this PR, but allow the Ethernet init/start functionality to be extended (with callbacks or __weak functions).
Then we can add emac2emac as an example and add appropriate comments about the GPIO0 workaround and the synchronization and reset stuff...

@kostaond
Copy link
Collaborator

@kostaond Thanks taking a look at the emac2emac option. I must say that I concur with your assessment and think that this option is probably not a viable transport option for eppp at this moment.

My suggestion is that we drop the emac2emac option in this PR, but allow the Ethernet init/start functionality to be extended (with callbacks or __weak functions). Then we can add emac2emac as an example and add appropriate comments about the GPIO0 workaround and the synchronization and reset stuff...

Agree, if you need to move forward, drop the emac2emac. It's currently too much polluted with the GPIO0 workaround. Presence or non presence of the workaround must be super clear to users because the most probable use case is to use ESP32 with WiFi connected to some other chip without WiFi.

@david-cermak david-cermak force-pushed the feat/eppp_emac2emac branch from da05de2 to 35f9579 Compare July 26, 2024 12:14
@david-cermak
Copy link
Collaborator Author

It's currently too much polluted with the GPIO0 workaround. Presence or non presence of the workaround must be super clear to users because the most probable use case is to use ESP32 with WiFi connected to some other chip without WiFi.

Removed the emac2emac from the component and added it as an extra example with the specific configuration, so the GPIO0 workaround is in the app code only. (Moreover It demonstrates using any custom Ethernet driver)

sscanf(CONFIG_EPPP_LINK_ETHERNET_THEIR_ADDRESS, "%2" PRIu8 ":%2" PRIu8 ":%2" PRIi8 ":%2" PRIu8 ":%2" PRIu8 ":%2" PRIu8,
&s_their_mac[0], &s_their_mac[1], &s_their_mac[2], &s_their_mac[3], &s_their_mac[4], &s_their_mac[5]);
esp_eth_ioctl(s_eth_handles[0], ETH_CMD_S_MAC_ADDR, s_our_mac);
ESP_RETURN_ON_ERROR(esp_event_handler_register(ETH_EVENT, ESP_EVENT_ANY_ID, event_handler, NULL), TAG, "Failed to register Ethernet handlers");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we open space for a custom event handler?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't create a custom handler/even-loop for eppp as I don't think it's necessary at this point. we can always add that later.

What would be the purpose of these custom events?

TaskHandle_t task_handle = xTaskGetHandle(pcTaskGetName(NULL));
gpio_isr_handler_add(CONFIG_EXAMPLE_RMII_CLK_READY_GPIO, gpio_isr_handler, task_handle);
ESP_LOGW(TAG, "waiting for RMII CLK sink device interrupt");
ESP_LOGW(TAG, "if RMII CLK sink device is already running, reset it by `EN` button");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make it part of the source device to automatically reset the device if the user enables it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we would need some other signalling method to perform the reset of the other device, right? (I think @bogdankolendovskyy suggested a similar handshaking mechanism with GPIOs like that, but it was rejected by @kostaond for being "too complicated", correct?)

@david-cermak
Copy link
Collaborator Author

@kostaond @euripedesrocha Thanks for your review, I've reworked this PR, so that it uses "just Ethernet" with customizable initialization. Then (in a separate commit) I've added the EMAC-2-EMAC example with all those workarounds and magic delays.

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

Successfully merging this pull request may close these issues.

4 participants