Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

STM32, FreeRTOS and LwIP - Ping Issues

Status
Not open for further replies.
I suspect the DLink 10/100 Fast Ethernet Switch to which you refer is not a managed switch thereby you unable to interact with it via an interface, view the MAC address table, etc. If that is the case, you will need to utilize the network analysis tools on your desktop system.

However, first please answer the following questions:

1. Are you now using a straight through cables, instead of a cross over cable?

2. have you tested ALL cables and the switch to ensure they are functioning as expected? You can accomplish this by simply connecting the Ethernet ports of two known functional systems, e.g, desktop and a laptop and pinging the two systems from both ends.

3. Have ALL devices and systems connected been assigned the same private subnet, addresses within that subnet and with correct network masks and gateway assignments? Please list all network related assignments for each device or system.

4. What operating system (OS) is your desktop system currently using?

Once you answered the above, you will need to utilize the network analysis tools provided by the OS of your desktop system.


BigDog
 

@BigDog,

I'm using Dlink switch, from the manual :
=======
Dlink...
DES-1005D is an unmanaged 10/100Mbps Fast Ethernet switch that
offers solutions for the accelerating bandwidth needs of small Ethernet
workgroups.
https://files.dlink.com.au/Products/DES-1005D/Manuals/DES-1005D_N1_Manual_v4.20.pdf

Let me answer your question :

1. Are you now using a straight through cables, instead of a cross over cable?
I'm using straight through cables

2. have you tested ALL cables and the switch to ensure they are functioning as expected? You can accomplish this by simply connecting the Ethernet ports of two known functional systems, e.g, desktop and a laptop and pinging the two systems from both ends.
The cables and switch are ok...


3. Have ALL devices and systems connected been assigned the same private subnet, addresses within that subnet and with correct network masks and gateway assignments? Please list all network related assignments for each device or system.
For STM32 :
IP_ADDRESS[0] = 192;
IP_ADDRESS[1] = 168;
IP_ADDRESS[2] = 1;
IP_ADDRESS[3] = 12;
NETMASK_ADDRESS[0] = 255;
NETMASK_ADDRESS[1] = 255;
NETMASK_ADDRESS[2] = 255;
NETMASK_ADDRESS[3] = 0;
GATEWAY_ADDRESS[0] = 192;
GATEWAY_ADDRESS[1] = 168;
GATEWAY_ADDRESS[2] = 1;
GATEWAY_ADDRESS[3] = 1;

for PC
ipsetting3.jpg

4. What operating system (OS) is your desktop system currently using?
It's windows7

Thanks for helping me out.....any more clues ?

- - - Updated - - -

Here's my experiment with PC, laptop and this swicth
I set PC as 192.168.1.12, netmask 255.255.255.0 and gateway 192.168.1.1
Laptop. same netmask and gateway only IP = 192.168.1.10...

from PC, I can ping laptop, ping 192.168.1.10....is working, but I can not ping from laptop to PC,
request time out to 192.168.1.12.....may be, is it the same case with my STM32 board ?

Thanks

- - - Updated - - -

could it be firewall, I opened it just now and I can ping that computer...I'll retry again later and post...
 

could it be firewall, I opened it just now and I can ping that computer...I'll retry again later and post...

Yes, it absolutely could be a firewall issue, which is why I insisted on you testing your ability to ping from your desktop to your laptop and vice versa.

When you are able to ping from both systems, post the confirmation and we will proceed to the next step.


BigDog
 

I enable ICMP on desktop and I can ping now, so no problem with the switch and cables.....
 

Okay, now that we finally have a known viable test platform, unplug your STM32 dev board from the network.

Once it has been unplug and left unplugged, open an elevated command window on your Windows system.

Now type the following command "arp -h" and notice it is the help screen for the arp command.

Then, flush the arp tables with the following command "arp -d *" followed by "arp -a" and post the resulting information displayed.


BigDog
 

Here are my firewall setting on laptop inbound and outbound, I open them already....I used laptop for testing stm32...
firewall setting inbound.jpg
firewall setting.jpg
 

ok I give a try for arp....thanks...I'll post the result...

- - - Updated - - -

This is what I got :

Code:
C:\Users\antonius>arp -d

C:\Users\antonius>arp -a

Interface: 10.0.0.1 --- 0xa
  Internet Address      Physical Address      Type
  10.0.0.138            00-26-44-a0-e1-e6     dynamic

C:\Users\antonius>arp -d *

C:\Users\antonius>arp -a

Interface: 10.0.0.1 --- 0xa
  Internet Address      Physical Address      Type
  10.0.0.138            00-26-44-a0-e1-e6     dynamic
  239.255.255.250       01-00-5e-7f-ff-fa     static

Interface: 192.168.89.1 --- 0x14
  Internet Address      Physical Address      Type
  239.255.255.250       01-00-5e-7f-ff-fa     static

Interface: 192.168.145.1 --- 0x15
  Internet Address      Physical Address      Type
  239.255.255.250       01-00-5e-7f-ff-fa     static

C:\Users\antonius>

- - - Updated - - -

Where will I go from there ?
 

Now plug your STM32 dev board into the network and reset or power up the board, give it a few minutes to execute the firmware.

After a few minutes, attempt to ping the IP address you have assigned it from the Windows system.

Once the ping command has finished, enter the following command "arp -av" and post the results.


BigDog

- - - Updated - - -

To what devices have the following IP addresses listed in the ARP table been assigned?

10.0.0.138
192.168.89.1
192.168.145.1

Is the IP address 10.0.0.138 assigned to your laptop?

And why are they on a different subnets, in relationship to your STM32 dev board?


3. Have ALL devices and systems connected been assigned the same private subnet, addresses within that subnet and with correct network masks and gateway assignments? Please list all network related assignments for each device or system.
For STM32 :
IP_ADDRESS[0] = 192;
IP_ADDRESS[1] = 168;
IP_ADDRESS[2] = 1;
IP_ADDRESS[3] = 12;
NETMASK_ADDRESS[0] = 255;
NETMASK_ADDRESS[1] = 255;
NETMASK_ADDRESS[2] = 255;
NETMASK_ADDRESS[3] = 0;
GATEWAY_ADDRESS[0] = 192;
GATEWAY_ADDRESS[1] = 168;
GATEWAY_ADDRESS[2] = 1;
GATEWAY_ADDRESS[3] = 1;

BigDog
 

To what devices have the following IP addresses listed in the ARP table been assigned?

10.0.0.138
192.168.89.1
192.168.145.1

Is the IP address 10.0.0.138 assigned to your laptop?

And why are they on a different subnets, in relationship to your STM32 dev board?
========================
No 10.0.0.138 is the modem router address....
My laptop is 10.0.0.1 and it has two interfaces...Wifi and LAN, I put wifi on 10.x.x.x and LAN on 192.168.x.x

or ?

Ok, I'll give a try....I'll use switch right ?

- - - Updated - - -

Those devices, 192.168.89.1
192.168.145.1, I have no idea what they are..

Do you mean my subnet is 239.255.255.250 ...so I must change it on my STM32 ? thanks
Ok I'll give a try ...thanks

- - - Updated - - -

This is what I got after STM32 connected into the switch and switch into my laptop.... :
Code:
C:\Users\antonius>ping 192.168.1.12

Pinging 192.168.1.12 with 32 bytes of data:
Reply from 192.168.1.10: Destination host unreachable.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 192.168.1.12:
    Packets: Sent = 4, Received = 1, Lost = 3 (75% loss),

C:\Users\antonius>arp -av

Interface: 127.0.0.1 --- 0x1
  Internet Address      Physical Address      Type
  224.0.0.22                                  static
  239.255.255.250                             static

Interface: 10.0.0.1 --- 0xa
  Internet Address      Physical Address      Type
  10.0.0.138            00-26-44-a0-e1-e6     dynamic
  10.0.0.255            ff-ff-ff-ff-ff-ff     static
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.252           01-00-5e-00-00-fc     static
  239.255.255.250       01-00-5e-7f-ff-fa     static
  255.255.255.255       ff-ff-ff-ff-ff-ff     static

Interface: 192.168.1.10 --- 0xb
  Internet Address      Physical Address      Type
  192.168.1.1           00-00-00-00-00-00     invalid
  192.168.1.12          00-00-00-00-00-00     invalid
  192.168.1.255         ff-ff-ff-ff-ff-ff     static
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.252           01-00-5e-00-00-fc     static
  239.255.255.250       01-00-5e-7f-ff-fa     static

Interface: 0.0.0.0 --- 0xffffffff
  Internet Address      Physical Address      Type
  224.0.0.22            01-00-5e-00-00-16     static
  255.255.255.255       ff-ff-ff-ff-ff-ff     static

Interface: 192.168.89.1 --- 0x14
  Internet Address      Physical Address      Type
  192.168.89.255        ff-ff-ff-ff-ff-ff     static
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.252           01-00-5e-00-00-fc     static
  239.255.255.250       01-00-5e-7f-ff-fa     static

Interface: 192.168.145.1 --- 0x15
  Internet Address      Physical Address      Type
  192.168.145.255       ff-ff-ff-ff-ff-ff     static
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.252           01-00-5e-00-00-fc     static
  239.255.255.250       01-00-5e-7f-ff-fa     static

Interface: 0.0.0.0 --- 0xffffffff
  Internet Address      Physical Address      Type
  224.0.0.22            01-00-5e-00-00-16     static

C:\Users\antonius>

How do you reckon ?

- - - Updated - - -

192.168.89.1
192.168.145.1 they are VMWare Network Adapter1 and Adapter8

- - - Updated - - -

Code:
Interface: 0.0.0.0 --- 0xffffffff
  Internet Address      Physical Address      Type
  224.0.0.22            01-00-5e-00-00-16     static
  255.255.255.255       ff-ff-ff-ff-ff-ff     static

Is that the address of STM32 ? it's not the same with I put on the firmware setting ??
 

Few times I can see Mac address and IP address of this board but intermittent, why is that ?
What function should I run to make the board knowing a ping request from computer ??
 

Attempts to assist you have certainly been an exercise in frustration, too much frustration in fact.

It's been a bit like shooting at a moving target in the dark, blindfolded. You are never quite sure the state of anything or what changes have transpired since the last word was typed.

Troubleshooting these types of issues requires a certain level of structured discipline combined with methodical troubleshooting techniques.

Otherwise, issues which could normally be remedied in an hour or two, possibly even minutes, stretch into days, ten days in fact for your specific situation.

Few times I can see Mac address and IP address of this board but intermittent, why is that ?

The reasons for utilizing the Address Resolution Protocol (ARP) utility should be clear by now, your previously posted output indicates the assigned MAC address of the STM32 Ethernet interface appears to have been never properly exchanged with the switch during it's initial handshake:

C:\Users\antonius>arp -av

Interface: 127.0.0.1 --- 0x1
Internet Address Physical Address Type
224.0.0.22 static
239.255.255.250 static

Interface: 10.0.0.1 --- 0xa
Internet Address Physical Address Type
10.0.0.138 00-26-44-a0-e1-e6 dynamic
10.0.0.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static
255.255.255.255 ff-ff-ff-ff-ff-ff static

Interface: 192.168.1.10 --- 0xb
Internet Address Physical Address Type
192.168.1.1 00-00-00-00-00-00 invalid
192.168.1.12 00-00-00-00-00-00 invalid
192.168.1.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static

Interface: 0.0.0.0 --- 0xffffffff
Internet Address Physical Address Type
224.0.0.22 01-00-5e-00-00-16 static
255.255.255.255 ff-ff-ff-ff-ff-ff static

Interface: 192.168.89.1 --- 0x14
Internet Address Physical Address Type
192.168.89.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static

Interface: 192.168.145.1 --- 0x15
Internet Address Physical Address Type
192.168.145.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static

Interface: 0.0.0.0 --- 0xffffffff
Internet Address Physical Address Type
224.0.0.22 01-00-5e-00-00-16 static

Which could possibly indicate either error in the physical implementation of the RMII interface or the software implementation of RMII driver code, possibly improperly defined pins, configuration settings, etc. Perhaps, the driver code is still configured for MII, rather than RMII, it's difficult to pinpoint. Therefore, I would suggest double checking the RMII hardware interface, perhaps comparing it to known functioning similar examples on the Net, then progress to the RMII driver portion of the code and ensure the proper pins have been defined, clocking inputs and modes been configured.

What function should I run to make the board knowing a ping request from computer ??

According to the code comments the Ping function should be enable by default, I'm not aware of a provided Ping routine which can be called from the dev board code, although such a routine could be certainly written.


Do you mean my subnet is 239.255.255.250 ...so I must change it on my STM32 ? thanks
Ok I'll give a try ...thanks

Please do not thank me.

I never indicated nor suggested that 239.255.255.250 is a subnet, subnets do not have MAC addresses assigned to them, in fact it is a multicast address which I suspect is utilized by the UPnP protocol to facilitate network device discovery. It's most likely emanating from a router or Windows system, the assigned MAC address should be a clue. Both 224.0.0.22 and 224.0.0.252 are multicast addresses as well, the first is IGMP Protocol utilized in IGMP Report function and the second is mDNS Protocol, notice all three multicast addresses have been assigned MAC addressed all beginning with the same prefix, 01-00-5e, which are protocols often provided by a router device. Are you getting the picture?

224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static

It appears you have your router internal network port assigned an IP address within the 10.0.0.0 private network, while your Windows, Linux and STM32 device assigned an IP address within the 192.168.1.0 private network, when they should be assigned IP addresses within the same private subnet with the same subnet mask.

BigDog
 

let me recheck my RMII ....it's generated from STM32CubeMx and I set it as RMII already....???

- - - Updated - - -

I changed STM32 board IP to 10.0.0.20.....I can see it at ARP but still can not ping it...I don't understand ??
Code:
Interface: 127.0.0.1 --- 0x1
  Internet Address      Physical Address      Type
  224.0.0.22                                  static
  239.255.255.250                             static

Interface: 10.0.0.1 --- 0xa
  Internet Address      Physical Address      Type
  10.0.0.20             00-00-00-00-00-00     invalid
  10.0.0.77             00-0f-53-b1-02-41     dynamic
  10.0.0.138            00-26-44-a0-e1-e6     dynamic
  10.0.0.255            ff-ff-ff-ff-ff-ff     static
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.252           01-00-5e-00-00-fc     static
  239.255.255.250       01-00-5e-7f-ff-fa     static

Interface: 10.0.0.11 --- 0xb
  Internet Address      Physical Address      Type
  10.0.0.1              00-00-00-00-00-00     invalid
  10.0.0.20             00-00-00-00-00-00     invalid
  10.0.0.138            00-00-00-00-00-00     invalid
  10.0.0.255            ff-ff-ff-ff-ff-ff     static
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.252           01-00-5e-00-00-fc     static
  239.255.255.250       01-00-5e-7f-ff-fa     static

Interface: 0.0.0.0 --- 0xffffffff
  Internet Address      Physical Address      Type
  224.0.0.22            01-00-5e-00-00-16     static
  255.255.255.255       ff-ff-ff-ff-ff-ff     static

Interface: 192.168.89.1 --- 0x14
  Internet Address      Physical Address      Type
  192.168.89.255        ff-ff-ff-ff-ff-ff     static
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.252           01-00-5e-00-00-fc     static
  239.255.255.250       01-00-5e-7f-ff-fa     static

Interface: 192.168.145.1 --- 0x15
  Internet Address      Physical Address      Type
  192.168.145.255       ff-ff-ff-ff-ff-ff     static
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.252           01-00-5e-00-00-fc     static
  239.255.255.250       01-00-5e-7f-ff-fa     static

Interface: 0.0.0.0 --- 0xffffffff
  Internet Address      Physical Address      Type
  224.0.0.22            01-00-5e-00-00-16     static

- - - Updated - - -

I set my computer IP address as 10.0.0.11, subnet 255.255.255.0, gateway 10.0.0.1...I tested with my old EN28J60 with AVR it works...but not with this STM32 and DP83848....?
 

I changed STM32 board IP to 10.0.0.20.....I can see it at ARP but still can not ping it...I don't understand ??

No, what you are seeing is your attempt at pinging 10.0.0.20, notice there is not MAC address listed. The MAC address you configured in your STM32 code should be listed as the Physical Address for Internet Address 10.0.0.20 and Type Static, not Invalid.

Interface: 127.0.0.1 --- 0x1
Internet Address Physical Address Type
224.0.0.22 static
239.255.255.250 static

Interface: 10.0.0.1 --- 0xa
Internet Address Physical Address Type
10.0.0.20 00-00-00-00-00-00 invalid
10.0.0.77 00-0f-53-b1-02-41 dynamic
10.0.0.138 00-26-44-a0-e1-e6 dynamic
10.0.0.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static

Interface: 10.0.0.11 --- 0xb
Internet Address Physical Address Type
10.0.0.1 00-00-00-00-00-00 invalid
10.0.0.20 00-00-00-00-00-00 invalid
10.0.0.138 00-00-00-00-00-00 invalid
10.0.0.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static

Interface: 0.0.0.0 --- 0xffffffff
Internet Address Physical Address Type
224.0.0.22 01-00-5e-00-00-16 static
255.255.255.255 ff-ff-ff-ff-ff-ff static

Interface: 192.168.89.1 --- 0x14
Internet Address Physical Address Type
192.168.89.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static

Interface: 192.168.145.1 --- 0x15
Internet Address Physical Address Type
192.168.145.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static

Interface: 0.0.0.0 --- 0xffffffff
Internet Address Physical Address Type
224.0.0.22 01-00-5e-00-00-16 static

Therefore, the initial handshaking between your switch and the STM32 dev board either never occurred or failed to complete.

When a new device is plugged into the switch, the switch essentially queries the device for it's IP and MAC addresses, to add to its internal lookup table to determine which device is attached to which port.

BigDog
 

I have set the IP on STM32 :
Code:
/* init function */
void MX_LWIP_Init(void)
{
  IP_ADDRESS[0] = 10;
  IP_ADDRESS[1] = 0;
  IP_ADDRESS[2] = 0;
  IP_ADDRESS[3] = 20;
  NETMASK_ADDRESS[0] = 255;
  NETMASK_ADDRESS[1] = 255;
  NETMASK_ADDRESS[2] = 255;
  NETMASK_ADDRESS[3] = 0;
  GATEWAY_ADDRESS[0] = 10;
  GATEWAY_ADDRESS[1] = 0;
  GATEWAY_ADDRESS[2] = 0;
  GATEWAY_ADDRESS[3] = 1;
    /* Initilialize the LwIP stack */
  lwip_init();
 
 
  IP4_ADDR(&ipaddr, IP_ADDRESS[0], IP_ADDRESS[1], IP_ADDRESS[2], IP_ADDRESS[3]);
  IP4_ADDR(&netmask, NETMASK_ADDRESS[0], NETMASK_ADDRESS[1] , NETMASK_ADDRESS[2], NETMASK_ADDRESS[3]);
  IP4_ADDR(&gw, GATEWAY_ADDRESS[0], GATEWAY_ADDRESS[1], GATEWAY_ADDRESS[2], GATEWAY_ADDRESS[3]);  
  

  /* add the network interface */
  netif_add(&gnetif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &ethernet_input);
 
 
  /*  Registers the default network interface */
  netif_set_default(&gnetif);

  if (netif_is_link_up(&gnetif))
  {
    /* When the netif is fully configured this function must be called */
    netif_set_up(&gnetif);
  }
  else
  {
    /* When the netif link is down this function must be called */
       netif_set_down(&gnetif);
  }  
  

/* USER CODE BEGIN 3 */
    //HAL_UART_Transmit(&huart1, "Finished LWIP INIT \n", 22, 1000);
/* USER CODE END 3 */
}

and called on main :
Code:
int main(void)
{
struct netif gnetif;
  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_USART1_UART_Init();
  MX_LWIP_Init();
	//tcp_echoserver_init();

  /* USER CODE BEGIN 2 */
 HAL_UART_Transmit(&huart1, "HI There...LwIP STM32F107! \n", 30, 1000);
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */

How can I know, it's properly set up ?

- - - Updated - - -

ethernet RMII setup :
Code:
void HAL_ETH_MspInit(ETH_HandleTypeDef* heth)
{
  GPIO_InitTypeDef GPIO_InitStruct;
  if(heth->Instance==ETH)
  {
  /* USER CODE BEGIN ETH_MspInit 0 */

  /* USER CODE END ETH_MspInit 0 */
    /* Enable Peripheral clock */
    __HAL_RCC_ETH_CLK_ENABLE();
  
    /**ETH GPIO Configuration    
    PC1     ------> ETH_MDC
    PA1     ------> ETH_REF_CLK
    PA2     ------> ETH_MDIO
    PA7     ------> ETH_CRS_DV
    PC4     ------> ETH_RXD0
    PC5     ------> ETH_RXD1
    PB11     ------> ETH_TX_EN
    PB12     ------> ETH_TXD0
    PB13     ------> ETH_TXD1 
    */
    GPIO_InitStruct.Pin = GPIO_PIN_1;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
    HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

    GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_7;
    GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

    GPIO_InitStruct.Pin = GPIO_PIN_2;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

    GPIO_InitStruct.Pin = GPIO_PIN_4|GPIO_PIN_5;
    GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

    GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
    HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

  /* USER CODE BEGIN ETH_MspInit 1 */
    HAL_UART_Transmit(&huart1, "Finished ETH INIT \n", 20, 1000);
  /* USER CODE END ETH_MspInit 1 */
  }
}

- - - Updated - - -

I can't see ethernet init on main ??

- - - Updated - - -

I tested it with ENC28J60 and my AVR...

it's smooth
Code:
Interface: 10.0.0.11 --- 0xb
  Internet Address      Physical Address      Type
  10.0.0.1              00-00-00-00-00-00     invalid
  10.0.0.20             54-55-58-10-00-24     dynamic
  10.0.0.255            ff-ff-ff-ff-ff-ff     static
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.252           01-00-5e-00-00-fc     static
  239.255.255.250       01-00-5e-7f-ff-fa     static

Could it be my DP83848 not initialized properly ?

- - - Updated - - -

Is it possible, I'm using a wrong crystal...
I used 8MHz for the clock, I read from one resource, I need 25MHz crystal for STM32...and RMII ethernet ??
diagram.jpg
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top