Enabling EMAC clock makes jtag stop

ThomasBit
Posts: 10
Joined: Thu Jun 09, 2022 11:05 am

Enabling EMAC clock makes jtag stop

Postby ThomasBit » Mon Jun 27, 2022 12:07 pm

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

ESP_ondrej
Posts: 166
Joined: Fri May 07, 2021 10:35 am

Re: Enabling EMAC clock makes jtag stop

Postby ESP_ondrej » Mon Jun 27, 2022 1:27 pm

Hi Thomas,

could you please provide more details about your HW design (schematics)?

Thanks
Ondrej

ThomasBit
Posts: 10
Joined: Thu Jun 09, 2022 11:05 am

Re: Enabling EMAC clock makes jtag stop

Postby ThomasBit » Mon Jun 27, 2022 2:02 pm

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
ESP Eth.png (245.21 KiB) Viewed 2754 times

ESP_ondrej
Posts: 166
Joined: Fri May 07, 2021 10:35 am

Re: Enabling EMAC clock makes jtag stop

Postby ESP_ondrej » Tue Jun 28, 2022 6:05 am

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?

ESP_ondrej
Posts: 166
Joined: Fri May 07, 2021 10:35 am

Re: Enabling EMAC clock makes jtag stop

Postby ESP_ondrej » Tue Jun 28, 2022 6:12 am

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.

ThomasBit
Posts: 10
Joined: Thu Jun 09, 2022 11:05 am

Re: Enabling EMAC clock makes jtag stop

Postby ThomasBit » Wed Jun 29, 2022 11:51 am

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

Who is online

Users browsing this forum: No registered users and 56 guests