EMAC receive not working
Re: EMAC receive not working
lan8720使用esp的clk工作正常吗?rudi ;-) wrote:hi robinRobinC wrote:Very cool Rudi. How are you generating the clock?
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); ..
think there is a small mistake in the paramsCode: 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);
but try this:
best wishesCode: 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)
rudi
Re: EMAC receive not working
hi robin, hi www220
have plan to do on weekend, but could not wait:
ESP32 generate 50 MHz for xRefer and X_in ( LAN8710A )
clk ok, SMI ok, now create the header for LAN8710A for DHCP and IP
( clk small curved cause have not filtered pinheader )
now we have
tlk110
LAN8720
and append
LAN8710A
its the Olimex ESP32 EVB REV A Board
( edit: now we try to get the ip )
best wishes
rudi
have plan to do on weekend, but could not wait:
ESP32 generate 50 MHz for xRefer and X_in ( LAN8710A )
clk ok, SMI ok, now create the header for LAN8710A for DHCP and IP
( clk small curved cause have not filtered pinheader )
now we have
tlk110
LAN8720
and append
LAN8710A
its the Olimex ESP32 EVB REV A Board
( edit: now we try to get the ip )
best wishes
rudi
Last edited by rudi ;-) on Wed Mar 08, 2017 11:24 am, edited 1 time in total.
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Re: EMAC receive not working
@www220www220 wrote:lan8720使用esp的clk工作正常吗?rudi ;-) wrote:hi robinRobinC wrote:Very cool Rudi. How are you generating the clock?
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); ..
think there is a small mistake in the paramsCode: 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);
but try this:
best wishesCode: 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)
rudi
a big Yes
best wishes
rudi
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Re: EMAC receive not working
@www220
get the thing runing with Intern RMII Clk 50 MHz
sometimes i can ping, somtimes there is a long time for it.
sometimes i get no ip. i will try some things like delay's before each register change
and others.
it makes difference sence to run the clk_on process with a try on difference process
have tried:
and a play on Process Priority
it will take a litle more time to figure it out what the best is.
from my test i can say, in general it is possible to create clk from esp,
to use it is sometimes difference and depending on the art of created "RTOS" process for it
To the comparison i will try this with the silicon rev1 again.
The clk itself is stable, I think the process PRIORITIES / creating claims a lot
So that only a few time slots remain for the processing for ip and ping answere.
Let's see what we can optimize together on the rtos
In the moment I use the external clk for project development and expansion and try to move it later intern rmii clk
best wishes
rudi
get the thing runing with Intern RMII Clk 50 MHz
sometimes i can ping, somtimes there is a long time for it.
sometimes i get no ip. i will try some things like delay's before each register change
and others.
it makes difference sence to run the clk_on process with a try on difference process
have tried:
Code: Select all
// xTaskCreate(&clk_on_task, "clk_on_task", 2048, NULL, (tskIDLE_PRIORITY + 2), NULL);
// xTaskCreatePinnedToCore(&clk_on_task, "clk_on_task", 2048, ParamPTR, 1, NULL, 0);
// core 0: no ip
// core 1: sometimes an ip
// xTaskCreatePinnedToCore(&clk_on_task, "clk_on_task", 2048, NULL, configMAX_PRIORITIES - 1 , NULL, 1);
it will take a litle more time to figure it out what the best is.
from my test i can say, in general it is possible to create clk from esp,
to use it is sometimes difference and depending on the art of created "RTOS" process for it
To the comparison i will try this with the silicon rev1 again.
The clk itself is stable, I think the process PRIORITIES / creating claims a lot
So that only a few time slots remain for the processing for ip and ping answere.
Let's see what we can optimize together on the rtos
In the moment I use the external clk for project development and expansion and try to move it later intern rmii clk
best wishes
rudi
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Re: EMAC receive not working
使用外部clk就涉及到gpio0冲突的问题,现在还没有什么完美的解决方案
Re: EMAC receive not working
clk sig is ok ( rigol )www220 wrote:使用外部clk就涉及到gpio0冲突的问题,现在还没有什么完美的解决方案
mdc, mdio is ok, can read and set register
only i get no ip
perhabs you ( or robin ) see a mistake in the used header for LAN8710A
best wishes
#define BASIC_MODE_CONTROL_REG (0x0)
#define SOFTWARE_RESET BIT(15)
#define BASIC_MODE_STATUS_REG (0x1)
#define AUTO_NEGOTIATION_COMPLETE BIT(5)
#define LINK_STATUS BIT(2)
#define PHY_IDENTIFIER_REG (0x2)
#define OUI_MSB_21TO6_DEF 0x0007
#define AUTO_NEG_ADVERTISEMENT_REG (0x4)
#define ASM_DIR BIT(11)
#define PAUSE BIT(10)
#define PHY_LINK_PARTNER_ABILITY_REG (0x5)
#define PARTNER_PAUSE BIT(10)
#define SOFTWARE_STRAP_CONTROL_REG (0x9)
#define SW_STRAP_CONFIG_DONE BIT(15)
#define AUTO_MDIX_ENABLE BIT(14)
#define AUTO_NEGOTIATION_ENABLE BIT(13)
#define AN_1 BIT(12)
#define AN_0 BIT(11)
#define LED_CFG BIT(10)
#define RMII_ENHANCED_MODE BIT(9)
#define PHY_SPECIAL_CONTROL_STATUS_REG (0x1f)
#define AUTO_NEGOTIATION_DONE BIT(12)
#define SPEED_DUPLEX_INDICATION_10T_HALF 0x04
#define SPEED_DUPLEX_INDICATION_10T_FULL 0x14
#define SPEED_DUPLEX_INDICATION_100T_HALF 0x08
#define SPEED_DUPLEX_INDICATION_100T_FULL 0x18
#define SPEED_INDICATION_100T BIT(3)
#define SPEED_INDICATION_10T BIT(2)
#define DUPLEX_INDICATION_FULL BIT(4)
rudi
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Re: EMAC receive not working
Have you verified the 8710 is working with an external crystal or oscillator? I didn't get an IP until I connected crs/dv to gpio27. Are you seeing the DHCP request on your server?
Robin
Robin
Re: EMAC receive not working
hi robinRobinC wrote:Have you verified the 8710 is working with an external crystal or oscillator? I didn't get an IP until I connected crs/dv to gpio27. Are you seeing the DHCP request on your server?
Robin
saw it after posting - need a scalpel again on weekend
let you know how i get on the REV-A
RM3- CRS_DV LAN8710A ..GPIO18
R21- FUNC_GPIO27_EMAC_RX_DV on it for using I2C pulled up and other ) best wishes
rudi
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Re: EMAC receive not working
@robin
without words
best wishes
rudi
need few hacks/mods on EVB-REV-A
without words
best wishes
rudi
need few hacks/mods on EVB-REV-A
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Who is online
Users browsing this forum: Baidu [Spider] and 81 guests