STM32F107虚拟串口USB转串口

所属分类:单片机开发
开发工具:C/C++
文件大小:1769KB
下载次数:2
上传日期:2019-12-11 18:07:19
上 传 者wangdaoyun2537
说明:  STM32F107USB转串口透传源代码,需要从ST官网上下载ST专用的USB虚拟串口专用程序,把USB接口虚拟成一个串口来使用。
(STM32F107USB to serial port transparent transmission of source code, you need to download the ST dedicated USB virtual serial port special program from the ST official website, the USB interface into a serial port to use.)

文件列表:
STM32F107 (0, 2014-01-13)
STM32F107\Libraries (0, 2014-01-13)
STM32F107\Libraries\CMSIS (0, 2014-01-13)
STM32F107\Libraries\CMSIS\CM3 (0, 2014-01-13)
STM32F107\Libraries\CMSIS\CM3\CoreSupport (0, 2014-01-13)
STM32F107\Libraries\CMSIS\CM3\CoreSupport\core_cm3.c (17273, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\CoreSupport\core_cm3.h (85714, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport (0, 2014-01-13)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST (0, 2014-01-13)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\Release_Notes_for_STM32F10x_CMSIS.html (19836, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x (0, 2014-01-13)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup (0, 2014-01-13)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\TrueSTUDIO (0, 2014-01-13)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\TrueSTUDIO\startup_stm32f10x_cl.s (12522, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\TrueSTUDIO\startup_stm32f10x_hd.s (13193, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\TrueSTUDIO\startup_stm32f10x_ld.s (9746, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\TrueSTUDIO\startup_stm32f10x_ld_vl.s (10195, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\TrueSTUDIO\startup_stm32f10x_md.s (10195, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\TrueSTUDIO\startup_stm32f10x_md_vl.s (10660, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\TrueSTUDIO\startup_stm32f10x_xl.s (13239, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm (0, 2014-01-13)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_cl.s (15761, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_hd.s (15498, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_ld.s (12371, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_ld_vl.s (13651, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_md.s (12760, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_md_vl.s (14068, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_xl.s (15950, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7 (0, 2014-01-13)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7\startup_stm32f10x_cl.s (12943, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7\startup_stm32f10x_hd.s (13042, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7\startup_stm32f10x_ld.s (9698, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7\startup_stm32f10x_ld_vl.s (10445, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7\startup_stm32f10x_md.s (10154, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7\startup_stm32f10x_md_vl.s (10941, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7\startup_stm32f10x_xl.s (13143, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\iar (0, 2014-01-13)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\iar\startup_stm32f10x_cl.s (16629, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\iar\startup_stm32f10x_hd.s (16231, 2010-07-05)
STM32F107\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\iar\startup_stm32f10x_ld.s (12653, 2010-07-05)
... ...

/******************** (C) COPYRIGHT 2010 STMicroelectronics ******************** * File Name : readme.txt * Author : MCD Application Team * Version : V3.2.1 * Date : 07/05/2010 * Description : Description of the USB Virtual_COM_Port Demo. ******************************************************************************** * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. *******************************************************************************/ Example description =================== In modern PCs, USB is the standard communication port for almost all peripherals. However many industrial software applications still use the classic COM Port (UART). The Virtual COM Port Demo provides a simple solution to bypass this problem; it uses the USB-FS-Device as a COM port by affecting the legacy PC application designed for COM Port communication. This Virtual COM Port Demo provides the firmware examples for the STM32F10xxx family. Note that with this demo only the following configuration are supported: -> 7bit data with parity (Even or Odd). -> 8bit data with and without parity. This demo is using two different methods for the IN and OUT transfers in order to manage the data rate difference between USB and USART buses: - OUT transfers (from Host to Device): When a packet is received from the host on the OUT pipe (EP3), the Endpoint callback function is called when the transfer is complete and all the received data are then sent through USART peripehral in polling mode. This allows all incoming OUT packets to be NAKed till the current packet is completely transferred through the USART interface. - IN transfers (from Device to Host): For IN data, a large circular buffer is used. USART and USB respectively write and read to/from this buffer independently. USART RXNE interrupt is used to write data into the buffer. This interrupt has the highest priority, which allows to avoid overrun and data loss conditions. USB IN endpoint (EP1) is written with the received data into the SOF interrupt callback. Into this callback, a frame counter counts the number of passed frames since the last time IN endpoint was written. This allows to write IN endpoint at seperated frames when enough data are present in the data buffer. To modify the number of frame between IN write operations, modify the value of the define "VCOMPORT_IN_FRAME_INTERVAL" in "usb_endp.c" file. To allow high data rate performance, SOF interrupt is managed with highest priority (thus SOF interrupt is checked before all other interrupts). More details about this Demo implementation is given in the User manual "UM0424 STM32F10xxx USB development kit", available for download from the ST microcontrollers website: www.st.com/stm32 Directory contents ================== + \inc: contains the Demo firmware header files + \EWARMv5: contains pre-configured projects for EWARM5 toolchain + \RIDE: contains pre-configured projects for RIDE toolchain + \MDK-ARM: contains pre-configured projects for MDK-ARM toolchain + \HiTOP: contains pre-configured projects for HiTOP toolchain + \TrueSTUDIO: contains pre-configured projects for TrueSTUDIO toolchain + \src: contains the Demo firmware source files Hardware environment ==================== This example runs on STMicroelectronics STM3210B-EVAL, STM3210C-EVAL and STM3210E-EVAL evaluation boards and can be easily tailored to any other hardware. To select the STMicroelectronics evaluation board used to run the example, uncomment the corresponding line in platform_config.h file. - STM3210B-EVAL Set-up - Jumper JP1 (USB disconnect) should be connected in position 2-3. - Connect a null-modem female/female RS232 cable between the DB9 connector CN6 and Host (PC) serial port. - STM3210E-EVAL Set-up - Jumper JP14 (USB disconnect) should be connected in position 2-3. - Connect a null-modem female/female RS232 cable between the DB9 connector CN12 and Host (PC) serial port. - STM3210C-EVAL Set-up - Jumper JP17 (I2C_SCK) should be connected. - Jumpers JP19 and JP18 should be not connected. - Connect a null-modem female/female RS232 cable between the DB9 connector CN6 and Host (PC) serial port. How to use it ============= + MDK-ARM - Open the VirtualCOMPort.uvproj project - In the build toolbar select the project config: - STM3210B-EVAL: to configure the project for STM32 Medium-density devices - STM3210C-EVAL: to configure the project for STM32 Connectivity-Line devices - STM3210E-EVAL: to configure the project for STM32 High-density devices - STM3210E-EVAL_XL: to configure the project for STM32 XL-density devices - Rebuild all files: Project->Rebuild all target files - Load project image: Debug->Start/Stop Debug Session - Run program: Debug->Run (F5) + EWARM5 - Open the VirtualCOMPort.eww workspace. - In the workspace toolbar select the project config: - STM3210B-EVAL: to configure the project for STM32 Medium-density devices - STM3210C-EVAL: to configure the project for STM32 Connectivity-Line devices - STM3210E-EVAL: to configure the project for STM32 High-density devices - STM3210E-EVAL_XL: to configure the project for STM32 XL-density devices - Rebuild all files: Project->Rebuild all - Load project image: Project->Debug - Run program: Debug->Go(F5) + RIDE - Open the VirtualCOMPort.rprj project. - In the configuration toolbar(Project->properties) select the project config: - STM3210B-EVAL: to configure the project for STM32 Medium-density devices - STM3210C-EVAL: to configure the project for STM32 Connectivity-Line devices - STM3210E-EVAL: to configure the project for STM32 High-density devices - STM3210E-EVAL_XL: to configure the project for STM32 XL-density devices - Rebuild all files: Project->build project - Load project image: Debug->start(ctrl+D) - Run program: Debug->Run(ctrl+F9) + HiTOP - Open the HiTOP toolchain, a "using projects in HiTOP" window appears. - Select open an existing project. - Browse to open the VirtualCOMPort.htp: - under STM32F10B_EVAL directory: to select the project for STM32 Medium-density devices. - under STM32F10C_EVAL directory: to select the project for STM32 Connectivity-Line devices. - under STM32F10E_EVAL directory: to select the project for STM32 High-density devices - under STM32F10E_EVAL_XL directory: to select the project for STM32 XL-density devices - "Download application" window is displayed, click "cancel". - Rebuild all files: Project->Rebuild all - Click on ok in the "download project" window. - Run program: Debug->Go(F5). + TrueSTUDIO - Open the TrueSTUDIO toolchain. - Click on File->Switch Workspace->Other and browse to TrueSTUDIO workspace directory. - Click on File->Import, select General->'Existing Projects into Workspace' and then click "Next". - Browse to the TrueSTUDIO workspace directory and select the project: - STM3210B-EVAL: to load the project for STM32 Medium-density devices - STM3210C-EVAL: to load the project for STM32 Connectivity line devices - STM3210E-EVAL: to load the project for STM32 High-density devices - STM3210E_EVAL_XL: to load the project for STM32 XL-density devices - Rebuild all project files: Select the project in the "Project explorer" window then click on Project->build project menu. - Run program: Select the project in the "Project explorer" window then click Run->Debug (F11) NOTE: - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers where the Flash memory density ranges between *** and 128 Kbytes. - High-density devices are STM32F101xx and STM32F103xx microcontrollers where the Flash memory density ranges between 256 and 512 Kbytes. - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where the Flash memory density ranges between 512 and 1024 Kbytes. - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. ******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE******

近期下载者

相关文件


收藏者