EMAC receive not working

RobinC
Posts: 45
Joined: Sat Feb 04, 2017 5:29 pm

Re: EMAC receive not working

Postby RobinC » Sun Feb 26, 2017 2:29 pm

Success on LAN8720 as well. Lack of CRS/DV was due to non-populated resister R10 on the eval board which is inline between phy and CRS pin on rmii connector. Once I populated that resister, it all just worked.

Rudy, I had already used the mapping of GPIO27 to EMAC_RX_DV in the example but went back and took it out. Turns out that mapping is the default so it is not needed.

So current status is TLK110 and LAN8720 working and ESP32 pingable.

I'll do a pull request on the changes to make the 8720 work.

Robin

User avatar
rudi ;-)
Posts: 1698
Joined: Fri Nov 13, 2015 3:25 pm

Re: EMAC receive not working

Postby rudi ;-) » Sun Feb 26, 2017 3:15 pm

RobinC wrote:Success on LAN8720 as well. Lack of CRS/DV was due to non-populated resister R10 on the eval board which is inline between phy and CRS pin on rmii connector. Once I populated that resister, it all just worked.

Rudy, I had already used the mapping of GPIO27 to EMAC_RX_DV in the example but went back and took it out. Turns out that mapping is the default so it is not needed.

So current status is TLK110 and LAN8720 working and ESP32 pingable.

I'll do a pull request on the changes to make the 8720 work.

Robin
hi robin, hi www220

yeap GPIO27 not need.
yes confirm, TLK110 and LAN8720 working and ESP32 pingable.

ok, have closed the request - we have done byself ;-)


hey guys - this was a nice teamwork now.
missed three register to set.
Too tired this morning of the long night,
Wanted to make it after lunch,
Www220 was faster ;-)

@www220
i use the SW reset, your HW Reset is fine ( perhabs change in my code too to this )

Now we can work on this

now we go lwip examples telnet shell, http and so on?

try just in time to build a callback/function for check packets ect
and want response on a udp or tcp or "fossil" :mrgreen:

btw: we have transparent WiFi Hotspot now ;-)

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

www220
Posts: 34
Joined: Wed Dec 21, 2016 7:21 am

Re: EMAC receive not working

Postby www220 » Mon Feb 27, 2017 1:24 pm

rudi,搞定gpio的ext_clk或者gpio16的clk_out,论坛里面发个帖子,emac就差这么点了

User avatar
rudi ;-)
Posts: 1698
Joined: Fri Nov 13, 2015 3:25 pm

Re: EMAC receive not working

Postby rudi ;-) » Mon Feb 27, 2017 3:17 pm

www220 wrote:rudi,搞定gpio的ext_clk或者gpio16的clk_out,论坛里面发个帖子,emac就差这么点了
hi www220,

just in time with LAN8720 there is a 50 MHz clk on board.
on tlk110 eval board from TI there is a 25 MHz on Board ( MII )
to use the tlk110 board with RMII we must change the onboard clk to 50 MHz

i would really much more work on GPIO16 and get from this the clk sig
but we must wait for a solution from esp guys / digital guys.
ESP_igrr wrote: Regarding the second question about Ethernet clock output, be sure that we saw your question, and we'll let you know as soon as we figure this out. IIRC, we may have to use the APLL to generate the 50MHz clock for the Ethernet.
src
projectgus wrote: Please be patient. As mentioned in other places, we don't have a good answer for this yet but we want to give you (and other Ethernet PHY users) one.
state

hope this helps.
and thank you for the missing register and values!
after change the register, the ping was done by help from you, thank you!

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

RobinC
Posts: 45
Joined: Sat Feb 04, 2017 5:29 pm

Re: EMAC receive not working

Postby RobinC » Mon Feb 27, 2017 6:08 pm

Hi Rudi. The 50MHz oscillator on the lan8720 eval board is there but not used. The onboard 25MHz crystal is used and the 8720 has the functionality to double the clock for it's reference and output so that a cheap crystal can be used.

I did have to remove the 25MHz crystal and add a 50MHz oscillator to the tlk110 eval board.

Robin

User avatar
rudi ;-)
Posts: 1698
Joined: Fri Nov 13, 2015 3:25 pm

Re: EMAC receive not working

Postby rudi ;-) » Mon Feb 27, 2017 6:37 pm

RobinC wrote:Hi Rudi. The 50MHz oscillator on the lan8720 eval board is there but not used. The onboard 25MHz crystal is used and the 8720 has the functionality to double the clock for it's reference and output so that a cheap crystal can be used.

I did have to remove the 25MHz crystal and add a 50MHz oscillator to the tlk110 eval board.

Robin
hi robin

studdy just in time the same theme with further eth phy
there is the same functionally there, the 50 MHz would activate by register and the ref clk 50MHz comes :mrgreen:
i think - so we need the generated clk by gpio16 not - and we can use the 25 MHz clk.

just in time studdy and compare datasheets from more eth phys
do you know KSZ8081RNAZA ?

best wishes
rudi ;-)

btw:
PR, well done!
Attachments
25_50.png
25_50.png (42.59 KiB) Viewed 14950 times
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

User avatar
rudi ;-)
Posts: 1698
Joined: Fri Nov 13, 2015 3:25 pm

Re: EMAC receive not working

Postby rudi ;-) » Mon Feb 27, 2017 9:45 pm

hi robin

the desing think on EVB is not bad :)
LAN8720.png
LAN8720.png (58.9 KiB) Viewed 14933 times
best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

User avatar
rudi ;-)
Posts: 1698
Joined: Fri Nov 13, 2015 3:25 pm

Re: EMAC receive not working

Postby rudi ;-) » Tue Feb 28, 2017 7:28 pm

RobinC wrote:Hi Rudi. The 50MHz oscillator on the lan8720 eval board is there but not used. The onboard 25MHz crystal is used and the 8720 has the functionality to double the clock for it's reference and output so that a cheap crystal can be used.

I did have to remove the 25MHz crystal and add a 50MHz oscillator to the tlk110 eval board.

Robin

Hi Robin

good news you get here
now we try to clk the RMII over the gpio16
gpio 16 has now 50 MHz refere´r
bingo !
:)
50Mhz_glass_clear.jpg
50Mhz_glass_clear.jpg (137.7 KiB) Viewed 14912 times
best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

RobinC
Posts: 45
Joined: Sat Feb 04, 2017 5:29 pm

Re: EMAC receive not working

Postby RobinC » Tue Feb 28, 2017 10:17 pm

Very cool Rudi. How are you generating the clock?

User avatar
rudi ;-)
Posts: 1698
Joined: Fri Nov 13, 2015 3:25 pm

Re: EMAC receive not working

Postby rudi ;-) » Tue Feb 28, 2017 10:45 pm

RobinC wrote:Very cool Rudi. How are you generating the clock?
hi robin

try this:

Code: Select all

..
#include "soc/emac_ex_reg.h"
extern void rtc_plla_ena(bool ena, uint32_t sdm0, uint32_t sdm1, uint32_t sdm2, uint32_t o_div);
..

Code: Select all


PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO16_U, FUNC_GPIO16_EMAC_CLK_OUT);
REG_SET_FIELD(EMAC_EX_CLKOUT_CONF_REG, EMAC_EX_CLK_OUT_H_DIV_NUM, 0);
REG_SET_FIELD(EMAC_EX_CLKOUT_CONF_REG, EMAC_EX_CLK_OUT_DIV_NUM, 0);
REG_CLR_BIT(EMAC_EX_CLK_CTRL_REG, EMAC_EX_EXT_OSC_EN);
REG_SET_BIT(EMAC_EX_CLK_CTRL_REG, EMAC_EX_INT_OSC_EN);
think there is a small mistake in the params
but try this:

Code: Select all

// f_out = f_xtal * (sdm2 + 4) / (2 * (o_div + 2))
//   = 40.000.000,00 *  (1 + 4) / (2 * ( 0 + 2) ) 
//   = 40.000.000,00 *  ( 5) / (2 * ( 2) )
//   = 40.000.000,00 *  ( 5) / (4 )
//   = 200.000.000,00  / ( 4 )
//   = 50.000.000,00 
//   = 50 MHz

// param0= ena
// param1=smd2
// param2=o_div
// param3=?
// param4=?

rtc_plla_ena(1, 1, 0, 0, 0); // 50 MHz
// rtc_plla_ena(1, 5, 1, 0, 0); // 60 MHz
// rtc_plla_ena(1, 0, 2, 0, 0); //  20 MHz ( glass clear)
best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

Who is online

Users browsing this forum: No registered users and 40 guests