1
\$\begingroup\$

I have made a PCB with an STM32F407 processor and I have been used DP83848 Ethernet PHY. For STM32F407 processor. I have selected RMII settings.

enter image description here

enter image description here

The pinouts for the RMII settings.

enter image description here

Red rings got to the processor. The blue ring shows RESET. It need to be logic 1 (HIGH) for the Ethernet PHY to start. The green ring shows a LED lamp that flashes when something happen on the internet cable e.g I ping an IP-address.

enter image description here

The oscillator is at 50 Mhz and I don't know why it should go inside my processor. This is from the datasheet DS8626 of the ST-microcontroller. https://www.st.com/resource/en/datasheet/dm00037051.pdf

enter image description here

I think this is OK to just write 50 MHz for Ethernet PTP?

enter image description here

I have connected my RJ45 connector like this

enter image description here

enter image description here

Other tiny pins of the Ethernet PHY

enter image description here

Pins that are not used are:

enter image description here

Special pinns:

enter image description here

Some pins have Pull-up and pull-down. I have pull-downs on all input pins of the ethernet PHY.

enter image description here

Last picture is the LwIP configuration. Were I select the IP address and the ram address at 0x20014000 with a size of 1600 bytes. My RAM address goes from 0x2000000 to 0x20020000 e.g 128 kB.

enter image description here

enter image description here

/* USER CODE BEGIN 0 */

extern struct netif gnetif;

int main(){
/* USER CODE END 0 */

  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

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

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

  /* USER CODE BEGIN Init */

  /* USER CODE END Init */

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

  /* USER CODE BEGIN SysInit */

  /* USER CODE END SysInit */

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_FSMC_Init();
  MX_DCMI_Init();
  MX_SPI2_Init();
  MX_TIM1_Init();
  MX_TIM3_Init();
  MX_ADC1_Init();
  MX_CAN1_Init();
  MX_RTC_Init();
  MX_TIM4_Init();
  MX_DMA_Init();
  MX_UART5_Init();
  MX_LWIP_Init();
  /* USER CODE BEGIN 2 */
  
  /* Activate DP83848 */
  HAL_GPIO_WritePin(ETH_RESET_GPIO_Port, ETH_RESET_Pin, GPIO_PIN_SET);

  while (1)
  {
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */

      ethernetif_input(&gnetif);

      sys_check_timeouts();
  }

Result:

Nothing happens when I ping

enter image description here

Only the LED D1 flashes when I ping. So that means the pin LED_ACT/COL at my Ethernet PHY goes from HIGH to LOW when something happening at the ethernet cable. Right?

enter image description here

enter image description here

Question:

What should I do in STM32CubeIDE to make my processor work with the Ethernet PHY? What have I missed?

I have follow this manual that shows how to connect a processor to the network using LwIP and an external Ethernet PHY.

https://controllerstech.com/stm32-ethernet-1-connection/

\$\endgroup\$
6
  • \$\begingroup\$ Not quite sure where to start here ... What part number is your RJ45 jack? \$\endgroup\$
    – Tom L.
    Apr 17, 2022 at 9:42
  • \$\begingroup\$ @TomL. 710-74990101212 Here: eu.mouser.com/ProductDetail/Wurth-Elektronik/… \$\endgroup\$
    – euraad
    Apr 17, 2022 at 10:41
  • 1
    \$\begingroup\$ Do you have a development board with Ethernet? If so, test your code on that 1st. Do you see the MAC address in Wireshark? Even without an IP stack, there should be some communication between your board and the switch/PC. \$\endgroup\$
    – Lior Bilia
    Apr 17, 2022 at 12:57
  • \$\begingroup\$ I think you are going to have to start with the basics and step through each issue. Triple validate against reference schematics, then validate phy to MCU, then phy to network, and so on. There is just simply too much here to process for drive by answers unfortunately. It's the type of problem best solved methodically and with colleagues if they are available. I don't know about lwip, but in freertos you can debug to view phy connectivity. \$\endgroup\$ Apr 17, 2022 at 13:00
  • \$\begingroup\$ @LiorBilia I have a custom board. \$\endgroup\$
    – euraad
    Apr 17, 2022 at 13:05

2 Answers 2

2
\$\begingroup\$

I found the answer now. Here is the solution:

https://community.st.com/s/question/0D73W000001oJX8SAM/detail

Easy! Step by step.

\$\endgroup\$
3
  • \$\begingroup\$ euraad - Hi, This is a "link-only" answer and one reason those aren't allowed is because they become useless if the link dies. And the link to the solution you self-answered has now died :( I checked the Wayback Machine (Internet Archive) and it isn't there. Unfortunately, without having the title of the thread you originally linked, I can't help you by searching for that thread on the reorganised ST forum and fixing the link for you. Can you please try to (a) update the link in this answer to a working one, and (b) Include the essential parts of the linked solution into your answer? Thanks. \$\endgroup\$
    – SamGibson
    Jul 18, 2023 at 20:26
  • 1
    \$\begingroup\$ I will update the link...or give the answer if ST have fixed the issue. They told me that this year week 23, they are going to update the firmware of ST for just LwiP \$\endgroup\$
    – euraad
    Jul 19, 2023 at 8:38
  • \$\begingroup\$ (For those readers who find this topic and see the link in the question is broken, I think (not sure) that this is the equivalent new link on the reorganised ST forum - in case that helps someone.) \$\endgroup\$
    – SamGibson
    Nov 9, 2023 at 22:59
1
\$\begingroup\$

you should check that you are following the IP schema for your router if you connected to it.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Could you edit and expand upon your answer? \$\endgroup\$ Jan 3, 2023 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.