
拿到RA4M2-SENSOR板,就想测试一下它的性能参数!看数据手册写的性能很彪悍,现在就用coremark来测试测试!!
开始进入正题!!!!!
1。首先要去coremark官网下载coremark源码,这个是个人都会,不解释了。
2。将下载来的coremark源码放在一个文件夹里
我的如下所示:

3。将coremark添加到KEIL工程


4。修改coremark里面的宏定义

#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 TICKS_PER_SECONDS 1000
#include "hal_data.h"
#define CORETIMETYPE uint32_t
#define GETMYTIME(_t) (*_t = HAL_GetTick())
#define EE_TICKS_PER_SEC TICKS_PER_SECONDS

#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
#define ITERATIONS 4000 // ���ֵ��Ҫ��֤�ܹ���������10�룬������дһ��ֵ�����в���10��ᱨ����ٻ�����
#define MAIN_HAS_NOARGC 1 // coremark main��ʹ�÷���ֵ
只需要修改上面两处宏定义既可以了。
5。主函数添加核心代码
#include "hal_data.h"
#include "LED.h"
#include "Systick.h"
#include "usart0.h"
#include "usart9.h"
#include "shell.h"
//#include "ebtn_app.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 */
hal_systick_init();
UART0_Init();UART9_Init();
//ebtn_APP_Key_INIT();
//shell_init();
/**** Set the time variable of the calendar ****/
Calendar_TimeVariable_Set(2025,8,31,19,33,00);
printf("RA4M2 Sensor coremark跑分:\r\n");
coremark_main();
while(1)
{
//shell_process();
//printf("现在时间�? %d�?d�?d�?d�?d�?d秒\r\n",ptime.year,ptime.month,ptime.day,ptime.hour,ptime.min,ptime.second);
//printf("现在时间�? %d�?d�?02d�?02d�?02d�?02d秒\r\n",datetime.year,datetime.month,datetime.day,datetime.hour,datetime.min,datetime.second);
//HAL_Delay(1000);
}
#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

5。打开串口助手

CoreMark 1.0 : 117.498458 / GCCClang 19.0.0git -Omax / STACK
可以看到RA4M2 的coremark最终跑分为117分
非常的强劲!!!!
附近是coremark的hex文件,你们自己下载验证
*附件:RA4M2_coremark.zip
详情看视频