-
Notifications
You must be signed in to change notification settings - Fork 17
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
LAN8670 PLCA Configuration error (IDFGH-14401) #48
Labels
Comments
bogdankolendovskyy
added a commit
to bogdankolendovskyy/esp-eth-drivers
that referenced
this issue
Jan 13, 2025
Commit fixe the byte order in truct that defines TOTMR register and adds padding to prevent possible issues among compilers. Also addresses two typos made in custom_ioctl commands. Closes espressif#48
6 tasks
bogdankolendovskyy
added a commit
to bogdankolendovskyy/esp-eth-drivers
that referenced
this issue
Jan 13, 2025
Commit fixe the byte order in truct that defines TOTMR register and adds padding to prevent possible issues among compilers. Also addresses two typos made in custom_ioctl commands. Closes espressif#48
bogdankolendovskyy
added a commit
to bogdankolendovskyy/esp-eth-drivers
that referenced
this issue
Jan 14, 2025
Commit fixe the byte order in truct that defines TOTMR register and adds padding to prevent possible issues among compilers. Also addresses two typos made in custom_ioctl commands. Closes espressif#48
@alexsb3 thank you for reporting the issue! It will be fixed soon. See linked PR for more information. |
bogdankolendovskyy
added a commit
to bogdankolendovskyy/esp-eth-drivers
that referenced
this issue
Jan 16, 2025
Commit fixe the byte order in truct that defines TOTMR register and adds padding to prevent possible issues among compilers. Also addresses two typos made in custom_ioctl commands. Closes espressif#48
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Checklist
How often does this bug occurs?
always
Expected behavior
I'm configuring the PLCA parameters of the LAN8670 using the following commands:
LAN867X_ETH_CMD_S_EN_PLCA, LAN867X_ETH_CMD_S_PLCA_NCNT, LAN867X_ETH_CMD_S_PLCA_ID, LAN867X_ETH_CMD_S_PLCA_TOT, LAN867X_ETH_CMD_S_MAX_BURST_COUNT, LAN867X_ETH_CMD_S_BURST_TIMER from esp_eth_phy_lan867x.h
I expect that when I view the modified values with the get commands (example LAN867X_ETH_CMD_G_EN_PLCA) from esp_eth_phy_lan867x.h, I should see all the modifications I have done to the PLCA of the LAN8670.
Actual behavior (suspected bug)
What I get is that some modifications are carried out some not:
Values that are modified correctly: LAN867X_ETH_CMD_S_PLCA_NCNT, LAN867X_ETH_CMD_S_PLCA_ID, LAN867X_ETH_CMD_S_MAX_BURST_COUNT, LAN867X_ETH_CMD_S_BURST_TIMER.
Values that NOT are modified correctly: LAN867X_ETH_CMD_S_EN_PLCA, LAN867X_ETH_CMD_S_PLCA_TOT
I suspect that when the command access the different registers to modify the values of the PLCA parameters, the registers that additionally have some of the bits reserved block the modification of the other bits. I suspect that this is the case since the parameters that I can modify not have any of the bits reserved and the other ones have some parts with reserved bits.
Pictures from the lan8670 datasheet
PLCA Enable NOT being able to modification:
![image](https://private-user-images.githubusercontent.com/191383200/402261018-428ee122-1c6d-4620-9062-c7d3670dda7a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNDUxODIsIm5iZiI6MTczOTA0NDg4MiwicGF0aCI6Ii8xOTEzODMyMDAvNDAyMjYxMDE4LTQyOGVlMTIyLTFjNmQtNDYyMC05MDYyLWM3ZDM2NzBkZGE3YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOFQyMDAxMjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zYjE1ZjYyNDQ0NDNjNTA3YzUyMTM3ODg4ZTdkNDI5ZWVhMmM2ZGY5M2U0OWZiNzE2NmI0YjI4Yzg2NGI2OTNmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.jpfbwCmQyfCmN3_F3C8q0DtPR_F6Tp1oSZlbkqe1ia4)
PLCA Node Count and PLCA ID being able to modification:
![image](https://private-user-images.githubusercontent.com/191383200/402261174-631654ef-3f60-41d7-b6d9-e5b3e9719a39.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNDUxODIsIm5iZiI6MTczOTA0NDg4MiwicGF0aCI6Ii8xOTEzODMyMDAvNDAyMjYxMTc0LTYzMTY1NGVmLTNmNjAtNDFkNy1iNmQ5LWU1YjNlOTcxOWEzOS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOFQyMDAxMjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jNjg4ZDk4MGViZjZmMTA3NTM5YTEyZGFjZWY3MWM5YjEzODZkNGUxMGEzMjVjZmJmNTA5ODAxNzZlM2FkNzRmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.j0NgPWTPQQOS7UPwryqAHYKFZor0nOM8WjwpmrieAJ0)
PLCA TOT NOT being able to modification:
![image](https://private-user-images.githubusercontent.com/191383200/402261297-29877566-0ce1-460a-b7c1-ae6201587d61.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNDUxODIsIm5iZiI6MTczOTA0NDg4MiwicGF0aCI6Ii8xOTEzODMyMDAvNDAyMjYxMjk3LTI5ODc3NTY2LTBjZTEtNDYwYS1iN2MxLWFlNjIwMTU4N2Q2MS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOFQyMDAxMjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00NjM2YzZiMjE5ZmI3MTYyNzQ0NmJlNDc0NzIxMWNjNTBkOGY2MmZiNWRlYTFlN2EyMzI4OWY5NTliMTcwODJiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.oSvJ4OqYteMVr1xpyYj9BNsDBgXIo345s49DjMhckgQ)
PLCA Max Burst Count and PLCA Burst Timer being able to modification:
![image](https://private-user-images.githubusercontent.com/191383200/402261413-b277a9b1-f293-4bef-9426-1b9a9969a43f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNDUxODIsIm5iZiI6MTczOTA0NDg4MiwicGF0aCI6Ii8xOTEzODMyMDAvNDAyMjYxNDEzLWIyNzdhOWIxLWYyOTMtNGJlZi05NDI2LTFiOWE5OTY5YTQzZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOFQyMDAxMjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mNDE0ODBkMzNhMTU2OTBhMzQyMWQxMWNmMWMwNWNjYTI4NzMyZTYwMjkzZTJmOWNjNGQyNzc0MTJjNTdkODAyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.32qTnBc0ZaYikK5h64au0ZQMpynm7Va1J55elewGeWU)
Error logs or terminal output
Steps to reproduce the behavior
Code:
#include <stdio.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_mac.h"
#include "esp_netif.h"
#include "esp_eth.h"
#include "esp_eth_phy_lan867x.h"
#include "esp_event.h"
#include "esp_log.h"
#include "ethernet_init.h"
#include "lwip/sockets.h"
#include "sdkconfig.h"
#define SOCKET_ADDRESS "192.168.1.100"
#define SOCKET_PORT 5000
#define SOCKET_MAX_LENGTH 1400
#define CONFIG_EXAMPLE_LAN867X_USE_PLCA 1
static const char *TAG = "lan867x_client";
static SemaphoreHandle_t xGotIpSemaphore;
/* Event handler for IP_EVENT_ETH_GOT_IP (Connect Driver to TCP/IP Stack) */
static void got_ip_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *data)
{
ip_event_got_ip_t *event = (ip_event_got_ip_t *) data;
const esp_netif_ip_info_t *ip_info = &event->ip_info;
}
void app_main(void)
{
// Create default event loop that running in background
ESP_ERROR_CHECK(esp_event_loop_create_default());
#if CONFIG_EXAMPLE_LAN867X_USE_PLCA
// Set PLCA Node Count
uint8_t plca_node_count = 3;
esp_eth_ioctl(eth_handles[0], LAN867X_ETH_CMD_S_PLCA_NCNT, &plca_node_count);
#endif // otherwise rely on CSMA/CD
}
Project release version
Using VSC with ESP-IDF v5.3.1
System architecture
Intel/AMD 64-bit (modern PC, older Mac)
Operating system
Windows
Operating system version
Windows 10 Home
Shell
PowerShell
Additional context
No response
The text was updated successfully, but these errors were encountered: