本人菜鸟一个!
以前用keil MDK环境,最近ARM中国打电话到公司,不能用keil了!
然后准备换,网上找了下eclipse的,环境很复杂!
然后发现
STM32CUBEIDE也是基于eclipse的,就把工程弄到STM32CUBEIDE中,但怎么都不OK
自己从新从STM32CUBEMX到STM32CUBEIDE建工程,发现可以烧录进去,LED跑起来了,但是printf函数怎么都不行!
网上找的
#include "stdio.h"
#ifdef __GNUC__
/* With GCC, small printf (op
tion LD Linker->Libraries->Small printf
set to 'Yes') calls __io_putchar() */
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif /* __GNUC__ */
PUTCHAR_PROTOTYPE
{
/* Place your implementation of fputc here */
/* e.g. write a character to the EVAL_COM1 and Loop until the end of transmission */
HAL_UART_Transmit( huart2, (uint8_t *) ch, 1, 0xFFFF);
return ch;
}
也不行,几种方式都试过了,不知道哪里有问题!
哪位大神给个可行的代码,谢谢~~