STM32F4UART_Printf

所属分类:处理器开发
开发工具:Visual C++
文件大小:61KB
下载次数:1
上传日期:2016-05-16 22:35:52
上 传 者shqxiaoquan
说明:  STM32F4实现用来用户输出数据,对初学者有很大的帮助,我珍惜很长一段时间,我们大家一起学习。
(STM32F4 implemented to a user output data, a great help for beginners and cherish for a long time, we have to learn together.)

文件列表:
STM32F4UART_Printf\EWARM\Project.ewd (36907, 2015-11-12)
STM32F4UART_Printf\EWARM\Project.ewp (29065, 2015-11-12)
STM32F4UART_Printf\EWARM\Project.eww (161, 2015-11-12)
STM32F4UART_Printf\EWARM\startup_stm32f411xe.s (22660, 2015-11-12)
STM32F4UART_Printf\EWARM\stm32f411xe_flash.icf (1358, 2015-11-12)
STM32F4UART_Printf\Inc\main.h (3735, 2015-11-12)
STM32F4UART_Printf\Inc\stm32f4xx_hal_conf.h (16292, 2015-11-12)
STM32F4UART_Printf\Inc\stm32f4xx_it.h (3136, 2015-11-12)
STM32F4UART_Printf\MDK-ARM\Project.uvoptx (4728, 2015-11-12)
STM32F4UART_Printf\MDK-ARM\Project.uvprojx (20090, 2015-11-12)
STM32F4UART_Printf\MDK-ARM\startup_stm32f411xe.s (26512, 2015-11-12)
STM32F4UART_Printf\Src\main.c (8694, 2015-11-12)
STM32F4UART_Printf\Src\stm32f4xx_hal_msp.c (5060, 2015-11-12)
STM32F4UART_Printf\Src\stm32f4xx_it.c (5565, 2015-11-12)
STM32F4UART_Printf\Src\system_stm32f4xx.c (9908, 2015-11-12)
STM32F4UART_Printf\SW4STM32\startup_stm32f411xe.s (22204, 2015-11-12)
STM32F4UART_Printf\SW4STM32\STM32F4xx-Nucleo\.cproject (11571, 2015-11-12)
STM32F4UART_Printf\SW4STM32\STM32F4xx-Nucleo\.project (4937, 2015-11-12)
STM32F4UART_Printf\SW4STM32\STM32F4xx-Nucleo\STM32F411RETx_FLASH.ld (4425, 2015-11-12)
STM32F4UART_Printf\SW4STM32\syscalls.c (3024, 2015-11-12)
STM32F4UART_Printf\TrueSTUDIO\startup_stm32f411xe.s (22204, 2015-11-12)
STM32F4UART_Printf\TrueSTUDIO\STM32F4xx-Nucleo\.cproject (21587, 2015-11-12)
STM32F4UART_Printf\TrueSTUDIO\STM32F4xx-Nucleo\.project (7227, 2015-11-12)
STM32F4UART_Printf\TrueSTUDIO\STM32F4xx-Nucleo\.settings\com.atollic.truestudio.debug.hardware_device.prefs (219, 2015-11-12)
STM32F4UART_Printf\TrueSTUDIO\STM32F4xx-Nucleo\STM32F411RE_FLASH.ld (4508, 2015-11-12)
STM32F4UART_Printf\TrueSTUDIO\STM32F4xx-Nucleo\STM32F4xx-Nucleo.elf.launch (5489, 2015-11-12)
STM32F4UART_Printf\TrueSTUDIO\syscalls.c (3053, 2015-11-12)
STM32F4UART_Printf\TrueSTUDIO\STM32F4xx-Nucleo\.settings (0, 2015-11-17)
STM32F4UART_Printf\SW4STM32\STM32F4xx-Nucleo (0, 2015-11-17)
STM32F4UART_Printf\TrueSTUDIO\STM32F4xx-Nucleo (0, 2015-11-17)
STM32F4UART_Printf\EWARM (0, 2015-11-17)
STM32F4UART_Printf\Inc (0, 2015-11-17)
STM32F4UART_Printf\MDK-ARM (0, 2015-11-17)
STM32F4UART_Printf\Src (0, 2015-11-17)
STM32F4UART_Printf\SW4STM32 (0, 2015-11-17)
STM32F4UART_Printf\TrueSTUDIO (0, 2015-11-17)
STM32F4UART_Printf (0, 2015-11-17)

/** @page UART_Printf UART Printf example @verbatim ******************** (C) COPYRIGHT 2015 STMicroelectronics ******************* * @file UART/UART_Printf/readme.txt * @author MCD Application Team * @version V1.1.3 * @date 13-November-2015 * @brief Description of the UART Printf example. ****************************************************************************** * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** @endverbatim @par Example Description This example shows how to use the STM32 Nucleo boards Virtual Com port feature. The STM32 Nucleo boards integrate the ST-LINK/V2.1 interfacing with the PC and offering the following capabilities: – Debug and programming port – Virtual com port interface – Mass storage interface – USB power management request for more than 100 mA power Once connected to your PC via the ST-LINK port, the STM32 Nucleo board is enumerated as a serial communication port USART2 and listed under Ports (COM & LPT) of Windows Device Manager. This implementation shows how to retarget the C library printf function to the UART in order to output the printf message on the Hyperterminal using USART2 interface connected to ST-LINK MCU in order to support Virtual Com Port. The communication port USART2 is configured as follows: - BaudRate = 9600 baud - Word Length = 8 Bits - One Stop Bit - ODD parity - Hardware flow control disabled (RTS and CTS signals) - Receive and transmit enabled To identify the Nucleo board VCP, you have just to perform the follwing actions on your Windows PC: - Click Start, and enter Device Manager into the Search field. Click Device Manager . - Double-click Ports (COM & LPT). - Find the Nucleo board VCP: STMicroelectronics STLink Virtual COM Port (COM..) To receive the printf output message on the Hyperterminal, apply this configuration on your serial terminal: - Port name = COM.. (already identified on Device Manager) - Word Length = 7 Bits - One Stop Bit - Odd parity - BaudRate = 9600 baud - flow control: None @note Care must be taken when using HAL_Delay(), this function provides accurate delay (in milliseconds) based on variable incremented in SysTick ISR. This implies that if HAL_Delay() is called from a peripheral ISR process, then the SysTick interrupt must have higher priority (numerically lower) than the peripheral interrupt. Otherwise the caller ISR process will be blocked. To change the SysTick interrupt priority you have to use HAL_NVIC_SetPriority() function. @note The application needs to ensure that the SysTick time base is always set to 1 millisecond to have correct HAL operation. @note The clock setting is configured to have the max product performance (max clock frequency) so not optimized in term of power consumption. @par Directory contents - UART/UART_Printf/Inc/stm32f4xx_hal_conf.h HAL configuration file - UART/UART_Printf/Inc/stm32f4xx_it.h Interrupt handlers header file - UART/UART_Printf/Inc/main.h Main program header file - UART/UART_Printf/Src/stm32f4xx_it.c Interrupt handlers - UART/UART_Printf/Src/main.c Main program - UART/UART_Printf/Src/stm32f4xx_hal_msp.c HAL MSP module - UART/UART_Printf/Src/system_stm32f4xx.c STM32F4xx system clock configuration file @par Hardware and Software environment - This example runs on STM32F411xEx devices. - This example has been tested with STMicroelectronics STM32F4xx-Nucleo RevC boards and can be easily tailored to any other supported device and development board. - STM32F4xx-Nucleo RevC Set-up - Connect the Nucleo board to your PC with a USB cable type A to mini-B to ST-LINK connector (CN1). - Please ensure that the ST-LINK connector CN2 jumpers are fitted. @par How to use it ? In order to make the program work, you must do the following : - Open your preferred toolchain - Rebuild all files and load your image into target memory - Run the example *

© COPYRIGHT STMicroelectronics

*/

近期下载者

相关文件


收藏者