coremark是专业用来评估MCU单片机性能的第三方开源软件库。
本期就来移植coremark到RA4E2来测试一下coremark的跑分性能!!!!!!
1。首先从coremark官网下载coremark源码。

2。下载后,复制下面文件到一个文件夹内

3。打开之前创建好的串口工程,将coremark添加到KEIL工程里


4。修改主要核心代码


#ifndef COMPILER_VERSION
#ifdef GNUC
#define COMPILER_VERSION "GCC"VERSION
#else
#define COMPILER_VERSION "Please put compiler version here (e.g. gcc 4.1)"
#endif
#endif
#ifndef COMPILER_FLAGS
#define COMPILER_FLAGS "-Omax"// 这个值根据实际的编译优化选项进行填写
#endif
#ifndef MEM_LOCATION
#define MEM_LOCATION "STACK"
#endif
选取最大优化等级,Omax,对应KEIL里

主函数如下:
#include "hal_data.h"
#include "usart9.h"
#include "shell.h"
#include "ebtn_app.h"
#include "Serial.h"
#include "coremark.h"
FSP_CPP_HEADER
void R_BSP_WarmStart(bsp_warm_start_event_t event);
FSP_CPP_FOOTER
extern void coremark_main(void);
/*******************************************************************************************************************//**
-
main() is generated by the RA Configuration editor and is used to generate threads if an RTOS is used. This function
-
is called by main() when no RTOS is used.
*********************************************************************************************************************/
void hal_entry(void)
{
/ TODO: add your own code here */
UART9_Init();hal_systick_init();
shell_init();
ebtn_APP_Key_INIT();
printf("\r\n>RA4E2性能跑分coremark分数\r\n");
coremark_main();
while(1)
{
SerialDecode();
/*
switch(key_count)
{
case 1:
led2_off();
led1_on();HAL_Delay(200);
led1_off();HAL_Delay(200);
break;
case 2:
led1_off();
led2_on();HAL_Delay(200);
led2_off();HAL_Delay(200);
break;
case 3:
led1_on();led2_on();HAL_Delay(200);
led1_off();led2_off();HAL_Delay(200);
break;
case 4:
led1_on();led2_off();HAL_Delay(200);
led1_off();led2_on();HAL_Delay(200);
break;
case 5:
led1_on();led2_on();
break;
default:
led1_off();led2_off();
break;
}
*/
}
#if BSP_TZ_SECURE_BUILD
/* Enter non-secure code */
R_BSP_NonSecureEnter();
#endif
}
/*******************************************************************************************************************//**
-
This function is called at various points during the startup process. This implementation uses the event that is
-
called right before main() to set up the pins.
-
@param[in] event Where at in the start up process the code is currently at
**********************************************************************************************************************/
void R_BSP_WarmStart (bsp_warm_start_event_t event)
{
if (BSP_WARM_START_RESET == event)
{
#if BSP_FEATURE_FLASH_LP_VERSION != 0
R_FACI_LP->DFLCTL = 1U;
#endif
}
if (BSP_WARM_START_POST_C == event)
{
R_IOPORT_Open(&IOPORT_CFG_CTRL, &IOPORT_CFG_NAME);
#if BSP_CFG_SDRAM_ENABLED
R_BSP_SdramInit(true);
#endif
}
}
#if BSP_TZ_SECURE_BUILD
FSP_CPP_HEADER
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable ();
/* Trustzone Secure Projects require at least one nonsecure callable function in order to build (Remove this if it is not required to build). */
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable ()
{
}
FSP_CPP_FOOTER
#endif

烧录代码到板子

打开串口助手
查看coremark分数

可以看到RA4E2最终跑分为CoreMark 1.0 : 174.026539
174分,中规中矩!!!!!!
附件是coremark文件,直接烧录即可通过串口查看分数
*附件:RA4E2_coremark.zip