• 大小: 7.1MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-01
  • 语言: 其他
  • 标签: stm32  lwip  tcp客户端  

资源简介

在修改官方移植lwip的基础上,搭建tcp客户端,来进行数据的收发,硬件基础:stm32f407+lan9303

资源截图

代码片段和文件信息

/**
  ******************************************************************************
  * @file    main.c
  * @author  MCD Application Team
  * @version V1.1.0
  * @date    31-July-2013
  * @brief   Main program body
  ******************************************************************************
  * @attention
  *
  * 

© COPYRIGHT 2013 STMicroelectronics


  *
  * Licensed under MCD-ST Liberty SW License Agreement V2 (the “License“);
  * You may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
  *
  *        http://www.st.com/software_license_agreement_liberty_v2
  *
  * Unless required by applicable law or agreed to in writing software 
  * distributed under the License is distributed on an “AS IS“ BASIS 
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *
  ******************************************************************************
  */

/* Includes ------------------------------------------------------------------*/
#include “stm32f4x7_eth.h“
#include “netconf.h“
#include “main.h“
#include “tcp_echoserver.h“
#include “serial_debug.h“
#include 
#include “tcp_server.h“
#include “tcp_client.h“

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
#define SYSTEMTICK_PERIOD_MS  10

/*--------------- LCD Messages ---------------*/
#if defined (STM32F40XX)
#define MESSAGE1   “    STM32F40/41x     “
#elif defined (STM32F427X)
#define MESSAGE1   “     STM32F427x      “
#endif
#define MESSAGE2   “  STM32F-4 Series   “
#define MESSAGE3   “ TCP echoserver Demo“
#define MESSAGE4   “                    “

/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
__IO uint32_t LocalTime = 0; /* this variable is used to create a time reference incremented by 10ms */
uint32_t timingdelay;

/* Private function prototypes -----------------------------------------------*/
void LCD_LED_Init(void);

/* Private functions ---------------------------------------------------------*/

/**
  * @brief  Main program.
  * @param  None
  * @retval None
  */
int main(void)
{
  /*!< At this stage the microcontroller clock setting is already configured to 
       168 MHz this is done through SystemInit() function which is called from
       startup file (startup_stm32f4xx.s) before to branch to application main.
       To reconfigure the default setting of SystemInit() function refer to
       system_stm32f4xx.c file
     */

  NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);

#ifdef SERIAL_DEBUG
  DebugComPort_Init();  
#endif

  /*Initialize LCD and Leds */ 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-10-08 14:55  tcp_client\EWARM\
     文件       61195  2013-07-31 09:48  tcp_client\EWARM\Project.ewd
     文件       60464  2013-07-31 09:48  tcp_client\EWARM\Project.ewp
     文件         161  2013-07-31 09:48  tcp_client\EWARM\Project.eww
     文件       24689  2013-07-31 09:54  tcp_client\EWARM\startup_stm32f40xx.s
     文件       25687  2013-07-31 09:54  tcp_client\EWARM\startup_stm32f427x.s
     文件        1594  2013-07-31 09:48  tcp_client\EWARM\stm32f4xx_flash.icf
     目录           0  2016-11-05 09:58  tcp_client\inc\
     文件        8060  2013-07-31 09:54  tcp_client\inc\lwipopts.h
     文件        4654  2016-10-08 18:06  tcp_client\inc\main.h
     文件        2198  2013-07-31 09:54  tcp_client\inc\netconf.h
     文件        1973  2013-07-31 09:54  tcp_client\inc\serial_debug.h
     文件        3167  2016-11-01 11:54  tcp_client\inc\stm32f4x7_eth_bsp.h
     文件        5223  2013-07-31 09:54  tcp_client\inc\stm32f4x7_eth_conf.h
     文件        3732  2013-07-31 09:54  tcp_client\inc\stm32f4xx_conf.h
     文件        2182  2013-07-31 09:54  tcp_client\inc\stm32f4xx_it.h
     文件        2521  2016-11-05 09:58  tcp_client\inc\tcp_client.h
     文件        1723  2013-07-31 09:48  tcp_client\inc\tcp_echoserver.h
     文件        2491  2016-11-04 16:12  tcp_client\inc\tcp_server.h
     目录           0  2016-10-28 09:27  tcp_client\MDK-ARM\
     文件       73971  2016-10-28 09:27  tcp_client\MDK-ARM\Project.uvgui.jinhao
     文件       38695  2016-10-08 18:52  tcp_client\MDK-ARM\Project.uvopt
     文件       70429  2016-10-08 18:52  tcp_client\MDK-ARM\Project.uvproj
     文件       30381  2013-07-31 09:48  tcp_client\MDK-ARM\startup_stm32f427x.s
     文件       29894  2013-07-31 09:48  tcp_client\MDK-ARM\startup_stm32f4xx.s
     目录           0  2016-11-05 09:59  tcp_client\MDK-ARM\STM324xG_EVAL\
     文件       19769  2016-11-04 16:14  tcp_client\MDK-ARM\STM324xG_EVAL\api_lib.crf
     文件         793  2016-11-04 16:14  tcp_client\MDK-ARM\STM324xG_EVAL\api_lib.d
     文件       23532  2016-11-04 16:14  tcp_client\MDK-ARM\STM324xG_EVAL\api_lib.o
     文件       19769  2016-11-04 16:14  tcp_client\MDK-ARM\STM324xG_EVAL\api_msg.crf
     文件         793  2016-11-04 16:14  tcp_client\MDK-ARM\STM324xG_EVAL\api_msg.d
............此处省略237个文件信息

评论

共有 条评论