| 昨天晚上收到ST社区的NUCLEO-F413ZH开发板(STM32官网),首先感谢ST公司和ST社区论坛给的这次评测机会,开箱之后参照 “风子”移植“CoreMark”的步骤移植了一下(需要的朋友请移步 【F769IDISCOVERY评测】Coremark移植教程与跑分测试),前面的步骤基本都是参照他的帖子做的,先上图   
 我只跑出了 170分左右,比官方的少了不少,不知道哪里处理的不对。。。
 
 移植过程,使用滴答定时器作为计时时钟,使用usart3作为串口输出,使用Cube生成的模板,然后修改Main.c中的main函数为:
 
 然后修改“core_portme.c”中的宏定义如下复制代码void hardware_init(void)
//int main(void)
{
  /* USER CODE BEGIN 1 */
//        uint8_t buf[]="I'm Nucleo F413ZH ! \r\n";
//        static uint32_t times=0;
  /* USER CODE END 1 */
  /* MCU Configuration----------------------------------------------------------*/
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();
  /* Configure the system clock */
  SystemClock_Config();
  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_SPI3_Init();
  MX_USART3_UART_Init();
  MX_TIM14_Init();
  /* USER CODE BEGIN 2 */
        //HAL_TIM_Base_Start_IT(&htim14);
  /* USER CODE END 2 */
  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
//  while (1)
//  {
//  /* USER CODE END WHILE */
//  /* USER CODE BEGIN 3 */
////        printf("I'm ths %d times \r\n",times++);
////          HAL_Delay(1500);
//  }
  /* USER CODE END 3 */
        printf("Core Mark start ... \r\n");
        printf("Please wait ... \r\n");
}
 然后删除了“plat_hardware.c”里的函数,只保留了这个函数,用于获取Tick复制代码/* Define : TIMER_RES_DIVIDER
        Divider to trade off timer resolution and total time that can be measured.
        Use lower values to increase resolution, but make sure that overflow does not occur.
        If there are issues with the return value overflowing, increase this value.
        */
#define NSECS_PER_SEC CLOCKS_PER_SEC
#define CORETIMETYPE clock_t 
//#define GETMYTIME(_t) (*_t=clock())
#define GETMYTIME(_t) (*(_t)=(clock_t)HAL_GetTick())
#define MYTIMEDIFF(fin,ini) ((fin)-(ini))
#define TIMER_RES_DIVIDER 1
#define SAMPLE_TIME_IMPLEMENTATION 1
//#define EE_TICKS_PER_SEC (NSECS_PER_SEC / TIMER_RES_DIVIDER)
#define EE_TICKS_PER_SEC 1000
 移植基本完成,附上完整工程(包含Cube的工程)。。。复制代码clock_t clock(void)
{
  return (clock_t)HAL_GetTick();
}
 
 
 
 
 
 
 相关文档: 
 
 
 
 
 
 
 | 
keil:
IAR:
是编译软件的优化,还是程序内部的优化?我用的MDK 5.06的编译器,Cube默认优化等级 03 ....
不知道哪里设置的不对...
IDE 优化,我上面的keil和IAR都是最高等级的优化结果。
晚上回家试试~