STM32F407+LWIP

Publisher:Lihua521Latest update time:2018-08-21 Source: eefocusKeywords:STM32F407  LWIP Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. About using peripheral library and chip selection

Need to define USE_STDPERIPH_DRIVER and STM32F40_41xxx

Specifically defined in stm32f4xx.h or configured in Target Options


2. About clock configuration

This project uses an external crystal oscillator of 8M

Therefore, it is necessary to modify the external crystal oscillator and PLL related macro definitions

Configuration in stm32f4xx.h

#define HSE_VALUE ((uint32_t)8000000)

Configuration in system_stm32f4xx.c

#define PLL_M 8


3. Porting lwip, no RTOS

The first step is to initialize ETH_MAC_DMA and PHY chip. Here we test it in project f407_eth.

Step 2: Add lwip file

The src file contains the files in the lwip official library:

lwip-1.4.1\src

The port contains the official ST transplant file:

STM32F4x7_ETH_LwIP_V1.1.1\Utilities\Third_Party\lwip-1.4.1\port\STM32F4x7

Migrate network application files:

STM32F4x7_ETH_LwIP_V1.1.1\Project\Standalone\udp_echo_client

Step 3: Modify some files

main.h is changed to 

                            net_config.h configures IP/MAC/NETMASK/GW/DHCP, etc. DHCP is not used here

When there is no operating system, you need to initialize systick to use lwip as the time base. Initialize it in the main function and implement SysTick_Handler

ethernetif.c is the file that needs to be ported when there is no RTOS (st has already done it), which is actually initialization, sending, receiving       


Keywords:STM32F407  LWIP Reference address:STM32F407+LWIP

Previous article:STM32 system clock CAN UART
Next article:Using 12M external crystal oscillator with stm32 under IAR

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号