Page 1 of 1
Enabling EMAC clock makes jtag stop
Posted: Mon Jun 27, 2022 12:07 pm
by ThomasBit
Hi
I think is is related to noise and a 50 MHz oscillator for the EMAC.
I use a ESP32 WROOM with an external 50 MHz oscillator.
I use the IO33 from the ESP32 to enable the PHY and the oscillator. The IO0 is used for EMAC clock in
But as soon I enable the oscillator and PHY, setting IO33 high, the jtag interface stops working.
It happen in the reset_hw function of the PHY (ksz80xx_reset_hw)
As long the oscillator is enabled (sending as clock) jtag fails. As soon it is disabled the jtag runs agian.
Is this related to noise?
Thomas
Re: Enabling EMAC clock makes jtag stop
Posted: Mon Jun 27, 2022 1:27 pm
by ESP_ondrej
Hi Thomas,
could you please provide more details about your HW design (schematics)?
Thanks
Ondrej
Re: Enabling EMAC clock makes jtag stop
Posted: Mon Jun 27, 2022 2:02 pm
by ThomasBit
Hi
From ksz80xx_reset_hw
Code: Select all
static esp_err_t ksz80xx_reset_hw(esp_eth_phy_t *phy)
{
/* esp_rom_gpio_pad_select_gpio(0);
gpio_set_direction(0, GPIO_MODE_INPUT);*/
phy_ksz80xx_t *ksz80xx = __containerof(phy, phy_ksz80xx_t, parent);
if (ksz80xx->reset_gpio_num >= 0) {
esp_rom_gpio_pad_select_gpio(ksz80xx->reset_gpio_num);
gpio_set_direction(ksz80xx->reset_gpio_num, GPIO_MODE_OUTPUT);
gpio_set_level(ksz80xx->reset_gpio_num, 0);
esp_rom_delay_us(100); // insert min input assert time
gpio_set_level(ksz80xx->reset_gpio_num, 1); // Here the jtag stops working.
- ESP Eth.png (245.21 KiB) Viewed 4003 times
Re: Enabling EMAC clock makes jtag stop
Posted: Tue Jun 28, 2022 6:05 am
by ESP_ondrej
Thanks for the schematics. I saw your other posts and you had some issues with ESP32 EMAC. It seemed there was some problem with RMII REF CLK. Have you already resolved this issue?
Re: Enabling EMAC clock makes jtag stop
Posted: Tue Jun 28, 2022 6:12 am
by ESP_ondrej
Regarding your JTAG problem. I think it is caused by a fact that JTAG TCK and ETH_RXER are both connected. Therefore when you enable RMII REF CLK, the KSZ8081 is "enabled" and pulls down ETH_RXER because there is no RX error and you lost JTAG TCK... Try to de-solder R12. ETH_RXER is not used by ESP-IDF drivers anyway so it can be left unconnected.
Re: Enabling EMAC clock makes jtag stop
Posted: Wed Jun 29, 2022 11:51 am
by ThomasBit
Hi
That did the trick. Now it all works, thanks
Yes, the RMII clock is also solved. There where some other electrical issues with wrong resistor values etc.
Thomas