CoreMark就行手机里的安兔兔,跑分越高,性能越牛逼;现在MCU跑个分成为一种时尚了,在CoreMark官方页,STM32F446的跑分高达602。
配置串口2作为信息打印输出,因为它连接到了ST-Link的虚拟串口:
时钟当然是配置最高180MHz了;
在usart.c加入以下代码实现串口printf重映射:
#ifdef __GNUC__
/* With GCC/RAISONANCE, small printf (option 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__ */
/**
* @brief Retargets the C library printf function to the USART.
* @param None
* @retval None
*/
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,1000);
return ch;
}
先试试printf能不能愉快的打印:
CoreMark的移植教程官方有权威的指导手册:
先看看IAR的表现,我的是7.8版本;
注意IAR的优化配置:
602,和官方数据一致;
再看看Keil的,优化配置如下:
470,和IAR不是一个档次,Keil本是ARM亲儿子,优化方面居然不如第三方的IAR;
不知是否哪里设置有问题,相差如此之大;
CoreMark就行手机里的安兔兔,跑分越高,性能越牛逼;现在MCU跑个分成为一种时尚了,在CoreMark官方页,STM32F446的跑分高达602。
配置串口2作为信息打印输出,因为它连接到了ST-Link的虚拟串口:
时钟当然是配置最高180MHz了;
在usart.c加入以下代码实现串口printf重映射:
#ifdef __GNUC__
/* With GCC/RAISONANCE, small printf (option 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__ */
/**
* @brief Retargets the C library printf function to the USART.
* @param None
* @retval None
*/
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,1000);
return ch;
}
先试试printf能不能愉快的打印:
CoreMark的移植教程官方有权威的指导手册:
先看看IAR的表现,我的是7.8版本;
注意IAR的优化配置:
602,和官方数据一致;
再看看Keil的,优化配置如下:
470,和IAR不是一个档次,Keil本是ARM亲儿子,优化方面居然不如第三方的IAR;
不知是否哪里设置有问题,相差如此之大;