Ethernet example fails to discover DHCP assigned address
Ethernet example fails to discover DHCP assigned address
See attached code which is based on the "examples/ethernet" project with a few small changes.
The enclosed example will discover its IP address when connected to a DHCP server.
There seem to be (at least) two ways to stop the DHCP discovery process.
(1) Use a stack which is not sized 2^n words (possibly just even sized)
METHOD:
Change the task creation to option (2).
Build and run.
The example will no longer collect an IP address.
This is strange as the stack size parameter in xTaskCreate() is the size in words so alignment (if that is the issue) should be assured.
(2) Some uses of printf()
METHOD:
Revert back to task creation option (1).
Rebuild and confirm that the example no longer collects an IP address.
Which is also odd as displayMemoryDetails() is using printf()
I am new to the ESP world and so think that there must be something very basic which I have not yet tuned into.
The enclosed example will discover its IP address when connected to a DHCP server.
There seem to be (at least) two ways to stop the DHCP discovery process.
(1) Use a stack which is not sized 2^n words (possibly just even sized)
METHOD:
Change the task creation to option (2).
Build and run.
The example will no longer collect an IP address.
This is strange as the stack size parameter in xTaskCreate() is the size in words so alignment (if that is the issue) should be assured.
(2) Some uses of printf()
METHOD:
Revert back to task creation option (1).
Rebuild and confirm that the example no longer collects an IP address.
Which is also odd as displayMemoryDetails() is using printf()
I am new to the ESP world and so think that there must be something very basic which I have not yet tuned into.
- Attachments
-
- ethernet_example_main.c
- (5.8 KiB) Downloaded 927 times
& I also believe that IDF CAN should be fixed.
Re: Ethernet example fails to discover DHCP assigned address
Bump. Anyone able to repeat with supplied code?
& I also believe that IDF CAN should be fixed.
Re: Ethernet example fails to discover DHCP assigned address
Would suggest you set debug log level
Re: Ethernet example fails to discover DHCP assigned address
Can do, new to ESP32 - which compile option?
If u have 5, are youable to repeat?
If u have 5, are youable to repeat?
& I also believe that IDF CAN should be fixed.
Re: Ethernet example fails to discover DHCP assigned address
Changed log level to debug using menuconfig.
The example no longer obtains an IP address even with the 'working' settings.
This is an ESP supplied simple program with a few added printf(), really should not be this hard!
Anyone able to repeat and/or advise?
The example no longer obtains an IP address even with the 'working' settings.
This is an ESP supplied simple program with a few added printf(), really should not be this hard!
Anyone able to repeat and/or advise?
& I also believe that IDF CAN should be fixed.
Re: Ethernet example fails to discover DHCP assigned address
I am running code on an ESP32-EVB. Code is built on Windows.
I have tried with the board powered using USB and external PSU and with just USB.
I have monitored TXD0, TXD1, RXD0, RXD1.
RXD0, RXD1 always trigger when I PING from PC.
TXD0, TXD1 only trigger in working versions of the code.
I note that TXD0, TXD1 share GPIO with U0CTS, U0RTS.
Rxtask init() sets however.
I can switch between 'working' and 'not working' with the most trivial of changes. Simply adding or removing an integer counter may influence.
This makes the issue extremely difficult to diagnose.
Has anyone reproduced and/or had success with ESP_IF_ETH ?
I have tried with the board powered using USB and external PSU and with just USB.
I have monitored TXD0, TXD1, RXD0, RXD1.
RXD0, RXD1 always trigger when I PING from PC.
TXD0, TXD1 only trigger in working versions of the code.
I note that TXD0, TXD1 share GPIO with U0CTS, U0RTS.
Rxtask init() sets
Code: Select all
uart_set_pin(UART_NUM_1, TXD_PIN, RXD_PIN, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
I can switch between 'working' and 'not working' with the most trivial of changes. Simply adding or removing an integer counter may influence.
This makes the issue extremely difficult to diagnose.
Has anyone reproduced and/or had success with ESP_IF_ETH ?
& I also believe that IDF CAN should be fixed.
Re: Ethernet example fails to discover DHCP assigned address
Is there a difference in debug output?
Re: Ethernet example fails to discover DHCP assigned address
Debug output breaks it completely. Nothing obvious in the log.
But as said, just adding a line can break it. Also increasing stack size can break it.
But as said, just adding a line can break it. Also increasing stack size can break it.
& I also believe that IDF CAN should be fixed.
Re: Ethernet example fails to discover DHCP assigned address
Post the debug output anyway
Re: Ethernet example fails to discover DHCP assigned address
Thanks for the support.
This is from an ESP-EVB. I have tried on other instances of that board.
Enclosed are the outputs from one program compiled with different log options.
'info-working.txt' is with the program compiled with loglevel set to info.
Next I changed loglevel to debug using menuconfig & recompiled producing 'debug-fails.txt'
I can also cause failures by adding and/or removing code.
The working output resets the LAN8720 many times & the failing build does not.
I know that RXD0, RXD1 carry data (when I ping) in the failing cases but TXD0, TXD1 remain idle.
This suggests that the PHY has been initialised in both cases.
I will poke around the PHY initialisation and double check voltages again, delay EMAC/PHY initialisation etc.
Would be helpful to know if any have used the EVB wired Ethernet.
This is from an ESP-EVB. I have tried on other instances of that board.
Enclosed are the outputs from one program compiled with different log options.
'info-working.txt' is with the program compiled with loglevel set to info.
Next I changed loglevel to debug using menuconfig & recompiled producing 'debug-fails.txt'
I can also cause failures by adding and/or removing code.
The working output resets the LAN8720 many times & the failing build does not.
I know that RXD0, RXD1 carry data (when I ping) in the failing cases but TXD0, TXD1 remain idle.
This suggests that the PHY has been initialised in both cases.
I will poke around the PHY initialisation and double check voltages again, delay EMAC/PHY initialisation etc.
Would be helpful to know if any have used the EVB wired Ethernet.
- Attachments
-
- debug-fails.txt
- Fails to gain IP address
- (11.3 KiB) Downloaded 896 times
-
- info-working.txt
- Gains IP address
- (6.61 KiB) Downloaded 857 times
& I also believe that IDF CAN should be fixed.
Who is online
Users browsing this forum: No registered users and 64 guests