rt-thread support network port (STM32F407VG + LAN8720A)

CubeMX configuration

Mainly configure MCO1, ETH and clock

Modify Kconfig

Add the following content to the "On-chip Peripheral Drivers" menu in rt-thread-lts-v3.1.x \ bsp \ stm32 \ stm32f407-anchor \ board \ Kconfig

    config PHY_USING_LAN8720A
        bool

    config BSP_USING_ETH
        bool "Enable ETH"
        select RT_USING_NETDEV
        select RT_USING_LWIP
        select PHY_USING_LAN8720A
        default y

env modify configuration

Run menuconfig in env and select "Enable ETH"

Generate code

Execute scons --target = iar in env to generate code that IAR can debug

Implement the phy_reset function

void phy_reset(void)
{
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_RESET);
    HAL_Delay(55);
    HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_SET);
    HAL_Delay(55);
}

 

Intelligent Recommendation

RT-Thread adds finsh component support

Open the corresponding macro Rewrite the rt_hw_console_getchar function The task of this function is to return the received data, using a non-stop scanning method, so the corresponding serial port int...

Configure RT-Thread support C ++ features

Configure RT-Thread support C ++ features We know that RT-Thread supports C ++. When we embedded programming, we often have the need for C-C ++ mixed programming, but I find that after simply opening ...

Add RT-Thread system support in STM32CubeIDE

Start STM32CubeIDE and click on Help in the menu Click From Url... Click New and enterhttps://www.rt-thread.org/download/cube/RealThread.RT-Thread.pdsc After Check and OK, check RealThread and click O...

RT-Thread—Remap serial port to rt_kprintf

Article Directory Remapping rt_kprintf () function definition Custom rt_hw_console_output () Remapping When you are learning C language, the most usedprintf()Function, its function is to print the inc...

[RT-Thread] Serial port of device model

Recently, I have been studying and reading the device model of RT-Thread, and taking some insights into a note is also a study summary. For the ideas involved in the device model, software layering, i...

More Recommendation

Serial port initialization process in rt-thread

Embedded system: rt-thread Development board: STM32F429 The program structure of the embedded operating system is complex, so the serial port initialization process is not as intuitive as the bare met...

RT-Thread Stduio adds a serial port 3

1. Add serial port 3 in board.h 2. Test code Punctuality Atom Elite Edition  ...

STM32F407 uses RT-thread to port LWIP

reference:Network protocol stack driver porting 1: Environment Chip: STM32F407 Development Board: Punctual Atom Exploration Edition PHY:LAN8720A Interface: RMII STM32F407 comes with an Ethernet module...

How to port RT-thread system to stm32

1. Introduction to RT-thread T-Thread (Real Time-Thread) is an embedded real-time multi-threaded operating system. In the RT-Thread system, task scheduling is implemented through threads. RT-Thread is...

RT-THREAD serial port TXDMA BUG

The above code is executed on RT-Thread, Our expectation should be that the first line outputs 16 '1', the second line outputs 16 '2' ... Chain 5 output 16 5. However, in fact, the data output by the ...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top