how to benchmark xmc 7200 eval kit using modus toolbox.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
tazz
Level 3
Level 3
100 sign-ins 10 questions asked 25 replies posted

give detail steps to porting to bare metal microcontroller.

0 Likes
1 Solution
Bhamy
Moderator
Moderator
Moderator
100 replies posted 10 likes given 10 likes received

Hi @tazz ,

For the error with workload please check the requirement about each workload and check if the device is compatible to it. This error is related to CoreMark library which is out of scope for Infineon support.

Include  cy_systick.h and check if you still get the warnings. Make sure you have included all the header files which I have mentioned in my previous response.

Best regards,

Bhamy Narasimha Shenoy

View solution in original post

0 Likes
14 Replies
Bhamy
Moderator
Moderator
Moderator
100 replies posted 10 likes given 10 likes received

Hi @tazz ,

XMC7200 eval kit is already supported with ModusToolBox 3.0. There are several examples projects available which can be pulled using Project creator. Kindly let me know more details on the specific requirements or expectations for your projects which cannot be found on the standard installation of ModusToolBox 3.0.

Best regards,

Bhamy Narasimha Shenoy 

0 Likes
Bhamy
Moderator
Moderator
Moderator
100 replies posted 10 likes given 10 likes received

Hi @tazz ,

Did you get chance to review my previous response?

Best regards,

Bhamy Narasimha Shenoy

0 Likes
tazz
Level 3
Level 3
100 sign-ins 10 questions asked 25 replies posted

hi when porting  coremark pro to bare metal xmc  7200 ,i am getting these error.

 

enerating compilation database file...
-> ./build/compile_commands.json
Compilation database file generation complete
Building 193 file(s)
Linking output file mtb-example-hal-rtc-basics.elf
c:/users/tanand3/modustoolbox/tools_3.0/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: C:/doit/RTC_Basics/build/APP_KIT_XMC72_EVK/Debug/mith/al/th_al.o: in function `al_signal_start':
C:\doit\RTC_Basics/mith/al/th_al.c:252: undefined reference to `clock_gettime'
c:/users/tanand3/modustoolbox/tools_3.0/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: C:/doit/RTC_Basics/build/APP_KIT_XMC72_EVK/Debug/mith/al/th_al.o: in function `al_signal_finished':
C:\doit\RTC_Basics/mith/al/th_al.c:297: undefined reference to `clock_gettime'
c:/users/tanand3/modustoolbox/tools_3.0/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: C:/doit/RTC_Basics/build/APP_KIT_XMC72_EVK/Debug/mith/al/th_al.o: in function `al_signal_now':
C:\doit\RTC_Basics/mith/al/th_al.c:334: undefined reference to `clock_gettime'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [../mtb_shared/core-make/release-v3.0.3/make/core/build.mk:435: C:/doit/RTC_Basics/build/APP_KIT_XMC72_EVK/Debug/mtb-example-hal-rtc-basics.elf] Error 1
make: *** [../mtb_shared/core-make/release-v3.0.3/make/core/main.mk:376: secondstage_build] Error 2
"C:/Users/TAnand3/ModusToolbox/tools_3.0/modus-shell/bin/make CY_MAKE_IDE=eclipse CY_IDE_TOOLS_DIR=C:/Users/TAnand3/ModusToolbox/tools_3.0 CY_IDE_BT_TOOLS_DIR= -j8 all" terminated with exit code 2. Build might be incomplete.

11:13:53 Build Failed. 8 errors, 0 warnings. (took 5s.521ms)

0 Likes
Bhamy
Moderator
Moderator
Moderator
100 replies posted 10 likes given 10 likes received

Hi @tazz ,

It looks like some errors linking the sources from the Coremark pro. Can you please provide me some details on what are your requirement with XMC7200?

Best regards,

Bhamy Narasimha Shenoy

0 Likes
tazz
Level 3
Level 3
100 sign-ins 10 questions asked 25 replies posted

hi

GETMYTIME (&initial ) is not supported on modus toolbox version 3.0 , in place of this which function should I use?

regards

0 Likes
Bhamy
Moderator
Moderator
Moderator
100 replies posted 10 likes given 10 likes received

Hi @tazz ,

There is a SysTick timer running along with CPU. Please refer to below document for the API available to access it:

https://infineon.github.io/mtb-pdl-cat1/pdl_api_reference_manual/html/group__group__arm__system__tim...

Let me know if need some more information.

Best regards

Bhamy Narasimha Shenoy 

0 Likes
tazz
Level 3
Level 3
100 sign-ins 10 questions asked 25 replies posted

hi I going benchmarking xmc 7200 eval kit using coremrk pro (CPU Benchmark – CoreMark-PRO – EEMBC Embedded Microprocessor Benchmark Consortium) link attached .

code is build 'debug' , but we not getting any output on consol.

kindly send the code for it.

regards

 

0 Likes
Bhamy
Moderator
Moderator
Moderator
100 replies posted 10 likes given 10 likes received

Hi @tazz ,

For console messages/ printf to get through UART one can use retargetio library.

Below is the link and description of the library : 

https://github.com/Infineon/retarget-io

You may use library manager to add this library to your project and then follow the below steps:

  1. Add #include "cy_retarget_io.h"

  2. Call cy_retarget_io_init(CYBSP_DEBUG_UART_TX, CYBSP_DEBUG_UART_RX, CY_RETARGET_IO_BAUDRATE);

    CYBSP_DEBUG_UART_TX and CYBSP_DEBUG_UART_RX pins are defined in the BSP and CY_RETARGET_IO_BAUDRATE is set to 115200. You can use a different baud rate if you prefer.

  3. Start printing using printf()   

Kindly let me know if you have any issues with it.

Best regards,

Bhamy Narasimha Shenoy

0 Likes
tazz
Level 3
Level 3
100 sign-ins 10 questions asked 25 replies posted

thank you for response, but I am looking for some "benchmark code" which we can run on xmc 7200 eval kit.

thanks 

regards

 

0 Likes
Bhamy
Moderator
Moderator
Moderator
100 replies posted 10 likes given 10 likes received

Hi @tazz ,

I am able to compile the CoreMark Pro and execute the workload with XMC7200 controller. Please look at the below results for core workload: 

-  Info: Starting Run...
-- Workload:core=490760323
-- core:time(ns)=167084
-- core:contexts=1
-- core:iterations=1
-- core:time(secs)= 167.084
-- core:secs/workload= 167.084
-- core:workloads/sec=0.00598501
Info: This run was executed with verification turned on! For performance results, use -v0.
-- core:UID=10000
-- core:fails=0
-- core:time(ticks)=167083
-- core:count=1
-- core:repeats=0
-- core:v1=0
-- core:v2=0
-- core:v3=0
-- core:v4=0
-- core:f1=0.000000e+00
-- core:f2=0.000000e+00
-- core:f3=0.000000e+00
-- core:f4=0.000000e+00
-- core:secs/repeat=     inf
-- core:repeats/sec=       0
-- core:time(secs)= 167.083
-- core:secs/item= 167.083
-- core:items/sec=0.00598505
-- Items:total(ticks)=167083
-- Items:total(secs)= 167.083
-- Done:core=490760323

 

I followed the porting guide documentation from CoreMark Pro and below are some of the changes I added in the CoreMark Pro sources to make it compatible with XMC7200:

  • For printf function add the below code to al_main function
#include "cyhal.h"
#include "cybsp.h"
#include "cy_retarget_io.h"


void	al_main( int argc, char* argv[]  )
{
	argc=argc; /*avoid compiler warning */
	argv=argv; /*avoid compiler warning */
	cy_rslt_t result;

	/* Initialize the device and board peripherals */
	result = cybsp_init();

	/* Board init failed. Stop program execution */
	if (result != CY_RSLT_SUCCESS)
	{
		CY_ASSERT(0);
	}

    /* Enable global interrupts */
    __enable_irq();


...
}
  •  Add the time related implementation to th_al.c 
int clock_gettime (clockid_t clock_id, struct timespec *tp);
volatile uint32_t tickcount = 0;

int clock_gettime (clockid_t clock_id, struct timespec *tp)
{
	(void)clock_id;
	tp->tv_nsec = tickcount*1000000;
	tp->tv_sec = tickcount/1000.0;
}

void systick_callback(void)
{
	tickcount++;
}

void	al_main( int argc, char* argv[]  )
{
...
    Cy_SysTick_Init( CY_SYSTICK_CLOCK_SOURCE_CLK_IMO, ((1000)/1000000.0)*8000000); //For 1ms reload
    Cy_SysTick_SetCallback	(0, &systick_callback);
    Cy_SysTick_Enable();
...
}
  • Change the configurations for MITH and abstraction layers as below:
#define HAVE_STRDUP 0
#define USE_SINGLE_CONTEXT 1
  • In this stage please check if the sources are getting compiled without any error
  • To run the workload, add the example code from the CoreMark Pro workload directory to project and also add the related benchmark sources to the project. For example if you want to run the core workload, then copy content from workloads/core/core.c to main.c in the project and add benchmarks/core directory to the project. 
  • Recompile the sources and check the serial terminal for the results.

Kindly follow the procedure and let me know if you have some issues with it.

Best regards,

Bhamy Narasimha Shenoy 

0 Likes
tazz
Level 3
Level 3
100 sign-ins 10 questions asked 25 replies posted

THANK YOU  for your response, on console i am getting this error.

regards

Screenshot 2023-03-30 111013.png

0 Likes
tazz
Level 3
Level 3
100 sign-ins 10 questions asked 25 replies posted

and getting these errors also 

mith/al/th_al.c:99:25: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration]
99 | #define GETMYTIME(_t) clock_gettime(CLOCK_REALTIME,_t)
| ^~~~~~~~~~~~~
mith/al/th_al.c:252:2: note: in expansion of macro 'GETMYTIME'
252 | GETMYTIME (&initial );
| ^~~~~~~~~
mith/al/th_al.c: In function 'al_main':
mith/al/th_al.c:810:7: warning: implicit declaration of function 'Cy_SysTick_Init' [-Wimplicit-function-declaration]
810 | */ Cy_SysTick_Init( CY_SYSTICK_CLOCK_SOURCE_CLK_IMO, ((1000)/1000000.0)*8000000); //For 1ms reload
| ^~~~~~~~~~~~~~~
mith/al/th_al.c:810:24: error: 'CY_SYSTICK_CLOCK_SOURCE_CLK_IMO' undeclared (first use in this function)
810 | */ Cy_SysTick_Init( CY_SYSTICK_CLOCK_SOURCE_CLK_IMO, ((1000)/1000000.0)*8000000); //For 1ms reload
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mith/al/th_al.c:810:24: note: each undeclared identifier is reported only once for each function it appears in
mith/al/th_al.c:811:4: warning: implicit declaration of function 'Cy_SysTick_SetCallback' [-Wimplicit-function-declaration]
811 | Cy_SysTick_SetCallback (0, &systick_callback);
| ^~~~~~~~~~~~~~~~~~~~~~
mith/al/th_al.c:812:4: warning: implicit declaration of function 'Cy_SysTick_Enable' [-Wimplicit-function-declaration]
812 | Cy_SysTick_Enable();
| ^~~~~~~~~~~~~~~~~
mith/al/th_al.c: In function 'clock_gettime':
mith/al/th_al.c:756:1: warning: control reaches end of non-void function [-Wreturn-type]

 

0 Likes
Bhamy
Moderator
Moderator
Moderator
100 replies posted 10 likes given 10 likes received

Hi @tazz ,

For the error with workload please check the requirement about each workload and check if the device is compatible to it. This error is related to CoreMark library which is out of scope for Infineon support.

Include  cy_systick.h and check if you still get the warnings. Make sure you have included all the header files which I have mentioned in my previous response.

Best regards,

Bhamy Narasimha Shenoy

0 Likes
tazz
Level 3
Level 3
100 sign-ins 10 questions asked 25 replies posted

thank you

0 Likes