Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9182038
  • 博文数量: 1728
  • 博客积分: 12961
  • 博客等级: 上将
  • 技术积分: 19870
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-09 11:25
个人简介

偷得浮生半桶水(半日闲), 好记性不如抄下来(烂笔头). 信息爆炸的时代, 学习是一项持续的工作.

文章分类

全部博文(1728)

文章存档

2024年(4)

2023年(26)

2022年(112)

2021年(217)

2020年(157)

2019年(192)

2018年(81)

2017年(78)

2016年(70)

2015年(52)

2014年(40)

2013年(51)

2012年(85)

2011年(45)

2010年(231)

2009年(287)

分类: 其他平台

2018-05-25 14:46:35

其实严格说来, sw4stm32 qis其实就是 eclipse de的改装版。 

1. 首先使用 stm32
cubeMX 设定模式, 并生成 工程以及代码。

2. 使用 sw4stm32 打开工程, 编译调试

note: debug configuration修改 debugger 的 Mode setup wei software system reset,。 才能调试。

使用 STM32Cube/Repository/STM32Cube_FW_F4_V1.21.0/Projects/STM32F401RE-Nucleo/Examples/UART 的范例来作串口手法
即main.c 末尾只要加入代码  即可实现printf输出。 


点击(此处)折叠或打开

  1. /* Private function prototypes -----------------------------------------------*/
  2. #ifdef __GNUC__
  3.   /* With GCC, small printf (option LD Linker->Libraries->Small printf
  4.      set to 'Yes') calls __io_putchar() */
  5.   #define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
  6. #else
  7.   #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
  8. #endif /* __GNUC__ */
  9. /**
  10.   * @brief Retargets the C library printf function to the USART.
  11.   * @param None
  12.   * @retval None
  13.   */
  14. PUTCHAR_PROTOTYPE
  15. {
  16.   /* Place your implementation of fputc here */
  17.   /* e.g. write a character to the EVAL_COM1 and Loop until the end of transmission */
  18.   HAL_UART_Transmit(&huart_shell, (uint8_t *)&ch, 1, 0xFFFF);

  19.   return ch;
  20. }


阅读(7546) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~