STM32F407VG联网笔记(基于rtthread studio)
0、部分原理图
1、创建工程
2、配置CUBEMX
2.1、配置时钟
2.2、配置串口uart2
2.3配置ETH
[对应原理图进行配置](## 0、部分原理图)
2.4、保存
3、修改board.h配置
3.1、修改时钟为HSE
3.2、打开BSP_USING_ETH
4、实现PHY复位函数
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2021-11-03 YPD the first version
*/
#include <board.h>
#include <rtdevice.h>
#define RESET_IO GET_PIN(D, 10)
void phy_reset(void)
{
rt_pin_write(RESET_IO, PIN_LOW);
rt_thread_mdelay(50);
rt_pin_write(RESET_IO, PIN_HIGH);
}
int phy_init(void)
{
rt_pin_mode(RESET_IO, PIN_MODE_OUTPUT);
rt_pin_write(RESET_IO, PIN_HIGH);
return RT_EOK;
}
INIT_APP_EXPORT(phy_init);