Transparent Wi-Fi module with RMII input

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

Re: Transparent Wi-Fi module with RMII input

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

WiFive wrote:
rudi ;-) wrote:
btw, there a small parameter idx mistake in the given pvParameter
but have figured it out
What is the correction?
I'm glad
To get a question from you WiFive
Finally you know what not 8-)

:D

here is the answer idx swap:

f_out = f_xtal * (sdm2 + 4) / (2 * (o_div + 2))

param0: enable
param1: (uint8_t) sdm2
param2: (uint8_t) o_div
param3: ?
param4: ?

examples:

rtc_plla_ena(1, 1, 1, 0, 0); // 33,3 MHz
rtc_plla_ena(1, 2, 1, 0, 0); // 40,3 MHz
rtc_plla_ena(1, 3, 1, 0, 0); // 47,2 MHz
rtc_plla_ena(1, 3, 0, 0, 0); // 70,2 MHz
rtc_plla_ena(1, 3, 1, 0, 0); // 47,2 MHz
rtc_plla_ena(1, 4, 2, 0, 0); // 40,3 MHz
rtc_plla_ena(1, 5, 1, 0, 0); // 60 MHz

bingo ;-)
rtc_plla_ena(1, 1, 0, 0, 0); // 50 MHz

rtc_plla_ena(1, 10, 0, 0, 0); // 140 MHz
rtc_plla_ena(1, 12, 0, 0, 0); // 156 MHz
rtc_plla_ena(1, 16, 0, 0, 0); // 156 MHz
rtc_plla_ena(1, 0, 1, 0, 0); // 26,7 MHz
rtc_plla_ena(1, 0, 2, 0, 0); // 20 MHz ( glass clear)
rtc_plla_ena(1, 0, 14, 0, 0); // 5 MHz Jitter
rtc_plla_ena(1, 1, 14, 0, 0); // 6.25 MHz Jitter
rtc_plla_ena(1, 6, 2, 0, 0); // 50 MHz
rtc_plla_ena(1, 0, 9000, 0, 0); // 8 MHz
rtc_plla_ena(1, 0, 900, 0, 0); // 8 MHz
rtc_plla_ena(1, 0, 254, 0, 0); // 2.57 MHz
rtc_plla_ena(1, 0, 255, 0, 0); // 2.5MHz


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

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Transparent Wi-Fi module with RMII input

Postby ESP_igrr » Wed Mar 01, 2017 1:37 am

The fact that sdm2 is the 3rd argument and not 5th might mean that we aren't using the same version of libraries... And the function signature you have is then rtc_plla_ena(bool enable, uint32_t sdm2, uint32_t o_div).

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

Re: Transparent Wi-Fi module with RMII input

Postby rudi ;-) » Wed Mar 01, 2017 2:24 am

hi ivan

thanks! good to know there are more versions ;-)

i use the first and last 'public' from esp32-wifi-lib

https://github.com/espressif/esp32-wifi ... brtc_clk.a

think there was only one version online

btw:
if i call the function with 3 parameters
rtc_plla_ena(bool enable, uint32_t sdm2, uint32_t o_div)
then i got an error, "to few arguments"

added the lib, to use, rename it .a without .zip

thanks again!

best wishes

rudi ;-)

edit:
Please always check on history
It may already have a newer version
on
Http://www.github.com/espressif
are located.
this uploaded was the first public version
and can be out dated if you surf later time here
in this thread.
Attachments
librtc_clk.a.zip
(10.23 KiB) Downloaded 957 times
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

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

Re: Transparent Wi-Fi module with RMII input

Postby rudi ;-) » Fri Mar 03, 2017 12:10 am

@ivan
thanks for the hint!
now i figured it out, ESP32 ETH PHY RMII with own 50MHz Clk for Refer and X_in
done!

i will forward code ect to robin and angus after clearing all
it takes few days for testing - and then upload

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

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

Re: Transparent Wi-Fi module with RMII input

Postby rudi ;-) » Fri Mar 03, 2017 4:16 pm

ESP_igrr wrote:
Sorry, no idea whether that works with EMAC (there may be more settings needed to make EMAC actually use this clock), but at least it gets 50MHz out of IO16. Hope this helps.

Edit: rtc_plla_ena function signature may change, this function may be removed, you may get eaten by raptors if you use it, etc, etc.
hi ivan

short, think we can use it for EMAC - but we must change few things. at weekend i try to complete.

i read between the lines, that the rtc_plla_ena function may be removed?
How - will this function no longer exist?
Can you reveal something that does this function?
(E.g.
It would be interesting which register it uses to get this setting.

A few things I have already found in the emac_main
But are not all listed, e.g. Still missing the entry
Just for the use of gpio16 as clk src.

So far we have

Code: Select all

If (emac_config.mac_mode == ETH_MODE_RMII) {
         emac_set_clk_rmii ();
     } else {
         emac_set_clk_mii ();
     }
I will supplement it with ( or other name )

Code: Select all

ETH_MODE_RMII_INT_50MHZ_CLK
in as well

Esp_eth.h

Code: Select all

Typedef enum {
     ETH_MODE_RMII = 0,
     ETH_MODE_RMII_INT_50MHZ_CLK, /* new */
     ETH_MDOE_MII,
} Eth_mode_t;

for config the emac_main

Code: Select all

If (emac_config.mac_mode == ETH_MODE_RMII) {
         emac_set_clk_rmii ();
     } else {
        if ( emac_config.mac_mode == ETH_MODE_RMII_INT_50MHZ_CLK) {
         emac_set_clk_rmii_intern();
         } else {
         emac_set_clk_mii ();
     }
 }

And also adjust the emac_dev with

Code: Select all


Void emac_set_clk_rmii_intern (void)
{
     // clear ex clock source
     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);
         
}


And a few other things like init clk for gpio16 ect.


i will try and make a PR then

just in time i have only the problem for right setup ( register settings ) with LAN8710A
it looks we have a small difference to LAN8720A -

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

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

Re: Transparent Wi-Fi module with RMII input

Postby rudi ;-) » Sun Mar 05, 2017 1:29 pm

ESP_igrr wrote:The fact that sdm2 is the 3rd argument and not 5th might mean that we aren't using the same version of libraries... And the function signature you have is then rtc_plla_ena(bool enable, uint32_t sdm2, uint32_t o_div).
hi ivan
fyi, now the esp-idf repo provide the lib that you mentioned with 5 parameters.
txs

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

AAAwen
Posts: 15
Joined: Fri Sep 08, 2017 6:00 am

Re: Transparent Wi-Fi module with RMII input

Postby AAAwen » Sat Sep 16, 2017 6:39 am

ESP_Sprite wrote:Fyi, we have both Ethernet (RMII) as well as WiFi on the ESP32. We do not have support for packet forwarding yet (which is what you seem to need) but we do have that in the roadmap; it should appear in esp-idf eventually.
Hi,ESP_Sprite:

I have the same question about the transparent bridge (between eth and wifi). I have a wrover-kit board, but I can't find the sample or document about it. Is any advice? Thanks very much!
我也同样想尝试用ESP32做一个以太网与wifi的桥接器进行透明传输。但是没有找到相关的资料。是否有人能够赐教,不胜感激!

eplancho
Posts: 2
Joined: Tue Nov 27, 2018 7:05 pm

Re: Transparent Wi-Fi module with RMII input

Postby eplancho » Tue Nov 27, 2018 7:12 pm

Any example available for this application?
Need to provide Wifi capabilities to an existing Ethernet board.
Thanks,

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

Re: Transparent Wi-Fi module with RMII input

Postby ESP_morris » Wed Nov 28, 2018 2:18 am


eplancho
Posts: 2
Joined: Tue Nov 27, 2018 7:05 pm

Re: Transparent Wi-Fi module with RMII input

Postby eplancho » Wed Nov 28, 2018 2:27 pm

Thanks

Who is online

Users browsing this forum: No registered users and 120 guests