Each core uses its corresponding STM module to generate an interrupt every 500ms, in order to see the three leds flashing at the same time it is necessary to give time to synchronize each core in order to see each led blink at the same time, this is achieve with the functions IfxCpu_emitEvent IfxCpu_waitEvent, for this example we are using a long time of 100ms, try to play with the return values of the second function to see in reality the amount of necessary time

Core 0

#include "Ifx_Types.h"
#include "IfxCpu.h"
#include "IfxScuWdt.h"
#include "Port/Std/IfxPort.h"
#include "Stm/Std/IfxStm.h"

/*interrupt priority number for STM0 comparator 0*/
#define IFX_INTPRIO_STM0_CMP0    10
/*Global variable to configure the STM0 Cmp0*/
IfxStm_CompareConfig Stm_Cmp_Config0;

IFX_ALIGN(4) IfxCpu_syncEvent g_cpuSyncEvent = 0;

void core0_main(void)
{
    IfxCpu_enableInterrupts();
    
    /* !!WATCHDOG0 AND SAFETY WATCHDOG ARE DISABLED HERE!!
     * Enable the watchdogs and service them periodically if it is required */
    IfxScuWdt_disableCpuWatchdog( IfxScuWdt_getCpuWatchdogPassword() );
    IfxScuWdt_disableSafetyWatchdog( IfxScuWdt_getSafetyWatchdogPassword() );
    
    /* Wait at least 100ms for CPU sync event */
    IfxCpu_emitEvent( &g_cpuSyncEvent );
    IfxCpu_waitEvent( &g_cpuSyncEvent, 100 );

    /*configure the pin */
    IfxPort_setPinMode( &MODULE_P00, 5, IfxPort_Mode_outputPushPullGeneral );
    IfxPort_setPinPadDriver( &MODULE_P00, 5, IfxPort_PadDriver_cmosAutomotiveSpeed1 );

    /*set the stm compare structure to its initial values: */
    IfxStm_initCompareConfig( &Stm_Cmp_Config0 );

    Stm_Cmp_Config0.ticks = IfxStm_getTicksFromMilliseconds( &MODULE_STM0, 500 );
    Stm_Cmp_Config0.comparator = IfxStm_Comparator_0;
    Stm_Cmp_Config0.comparatorInterrupt = IfxStm_ComparatorInterrupt_ir0;
    Stm_Cmp_Config0.triggerPriority = IFX_INTPRIO_STM0_CMP0;
    Stm_Cmp_Config0.typeOfService = IfxSrc_Tos_cpu0;  /*we are working on CPU0*/
    /*Configure the comparator to see for 500ms and enable its corresponding interrupt
     * using its corresponding Service Request Node (SRN) */
    IfxStm_initCompare( &MODULE_STM0, &Stm_Cmp_Config0 );

    while(1)
    {

    }
}

/*The program will jump here immediately after the STM0 timer reach the ticks established ion CMP0.
 The interrupt service routine is declared using the macro IFX_INTERRUPT, a name Isr_Stm0_Cmp0 is given,
 indicate the vector table is the number 0 corresponding to CPU0 and the priority number
 vector table and priority is what will really match with the interrupt request*/
IFX_INTERRUPT( Isr_Stm0_Cmp0, 0, IFX_INTPRIO_STM0_CMP0 )
{
    /*we do something like flip a led */
    IfxPort_togglePin( &MODULE_P00, 5 );
    /*it is neccesary to clear the module (STM0 CMP0) interrupt flag*/
    IfxStm_clearCompareFlag( &MODULE_STM0, Stm_Cmp_Config0.comparator );
    /* reload the comparator with the last value plus the same amount of ticks to keep
     * setting the comparator flag at the same frequency */
    IfxStm_increaseCompare( &MODULE_STM0, Stm_Cmp_Config0.comparator, Stm_Cmp_Config0.ticks );
}

Core 1

#include "Ifx_Types.h"
#include "IfxCpu.h"
#include "IfxScuWdt.h"
#include "IfxPort_Io.h"
#include "Stm/Std/IfxStm.h"

/*interrupt priority number for STM1 comparator 0*/
#define IFX_INTPRIO_STM1_CMP0    10
/*Global variable to configure the STM0 Cmp0*/
IfxStm_CompareConfig Stm_Cmp_Config1;

extern IfxCpu_syncEvent g_cpuSyncEvent;

void core1_main(void)
{
    IfxCpu_enableInterrupts();
    
    /* !!WATCHDOG1 IS DISABLED HERE!!
     * Enable the watchdog and service it periodically if it is required
     */
    IfxScuWdt_disableCpuWatchdog(IfxScuWdt_getCpuWatchdogPassword());
    
    /* Wait for CPU sync event */
    IfxCpu_emitEvent(&g_cpuSyncEvent);
    IfxCpu_waitEvent(&g_cpuSyncEvent, 100);

    /*configure the pin */
    IfxPort_setPinMode( &MODULE_P00, 7, IfxPort_Mode_outputPushPullGeneral );
    IfxPort_setPinPadDriver( &MODULE_P00, 7, IfxPort_PadDriver_cmosAutomotiveSpeed1 );

    /*set the stm compare structure to its initial values: */
    IfxStm_initCompareConfig( &Stm_Cmp_Config1 );

    Stm_Cmp_Config1.ticks = IfxStm_getTicksFromMilliseconds( &MODULE_STM1, 500 );
    Stm_Cmp_Config1.comparator = IfxStm_Comparator_0;
    Stm_Cmp_Config1.comparatorInterrupt = IfxStm_ComparatorInterrupt_ir0;
    Stm_Cmp_Config1.triggerPriority = IFX_INTPRIO_STM1_CMP0;
    Stm_Cmp_Config1.typeOfService = IfxSrc_Tos_cpu1; /*we are working on CPU1*/
    /*Configure the comparator to see for 500ms and enable its corresponding interrupt
     * using its corresponding Service Request Node (SRN) */
    IfxStm_initCompare( &MODULE_STM1, &Stm_Cmp_Config1 );

    while(1)
    {

    }
}

/*The program will jump here immediately after the STM1 timer reach the ticks established ion CMP0.
The interrupt service routine is declared using the macro IFX_INTERRUPT, a name Isr_Stm1_Cmp0 is given,
indicate the vector table is the number 1 corresponding to CPU1 and the priority number
vector table and priority is what will really match with the interrupt request*/
IFX_INTERRUPT( Isr_Stm1_Cmp0, 1, IFX_INTPRIO_STM1_CMP0 )
{
    /*we do something like flip a led */
    IfxPort_togglePin( &MODULE_P00, 7 );
    /*it is neccesary to clear the module (STM0 CMP0) interrupt flag*/
    IfxStm_clearCompareFlag( &MODULE_STM1, Stm_Cmp_Config1.comparator );
    /* reload the comparator with the last value plus the same amount of ticks to keep
     * setting the comparator flag at the same frequency */
    IfxStm_increaseCompare( &MODULE_STM1, Stm_Cmp_Config1.comparator, Stm_Cmp_Config1.ticks );
}

Core 2

#include "Ifx_Types.h"
#include "IfxCpu.h"
#include "IfxScuWdt.h"
#include "IfxPort_Io.h"
#include "Stm/Std/IfxStm.h"

/*interrupt priority number for STM2 comparator 0*/
#define IFX_INTPRIO_STM2_CMP0    10
/*Global variable to configure the STM0 Cmp0*/
IfxStm_CompareConfig Stm_Cmp_Config2;

extern IfxCpu_syncEvent g_cpuSyncEvent;

void core2_main(void)
{
    IfxCpu_enableInterrupts();
    
    /* !!WATCHDOG1 IS DISABLED HERE!!
     * Enable the watchdog and service it periodically if it is required
     */
    IfxScuWdt_disableCpuWatchdog(IfxScuWdt_getCpuWatchdogPassword());
    
    /* Wait for CPU sync event */
    IfxCpu_emitEvent(&g_cpuSyncEvent);
    IfxCpu_waitEvent(&g_cpuSyncEvent, 100);

    /*configure the pin */
    IfxPort_setPinMode( &MODULE_P00, 9, IfxPort_Mode_outputPushPullGeneral );
    IfxPort_setPinPadDriver( &MODULE_P00, 9, IfxPort_PadDriver_cmosAutomotiveSpeed1 );

    /*set the stm compare structure to its initial values: */
    IfxStm_initCompareConfig( &Stm_Cmp_Config2 );

    Stm_Cmp_Config2.ticks = IfxStm_getTicksFromMilliseconds( &MODULE_STM2, 500 );
    Stm_Cmp_Config2.comparator = IfxStm_Comparator_0;
    Stm_Cmp_Config2.comparatorInterrupt = IfxStm_ComparatorInterrupt_ir0;
    Stm_Cmp_Config2.triggerPriority = IFX_INTPRIO_STM2_CMP0;
    Stm_Cmp_Config2.typeOfService = IfxSrc_Tos_cpu2; /*we are working on CPU2*/
    /*Configure the comparator to see for 500ms and enable its corresponding interrupt
     * using its corresponding Service Request Node (SRN) */
    IfxStm_initCompare( &MODULE_STM2, &Stm_Cmp_Config2 );

    while(1)
    {

    }
}

/*The program will jump here immediately after the STM2 timer reach the ticks established ion CMP0.
The interrupt service routine is declared using the macro IFX_INTERRUPT, a name Isr_Stm2_Cmp0 is given,
indicate the vector table is the number 2 corresponding to CPU2 and the priority number
vector table and priority is what will really match with the interrupt request*/
IFX_INTERRUPT( Isr_Stm2_Cmp0, 2, IFX_INTPRIO_STM2_CMP0 )
{
    /*we do something like flip a led */
    IfxPort_togglePin( &MODULE_P00, 9 );
    /*it is neccesary to clear the module (STM2 CMP0) interrupt flag*/
    IfxStm_clearCompareFlag( &MODULE_STM2, Stm_Cmp_Config2.comparator );
    /* reload the comparator with the last value plus the same amount of ticks to keep
     * setting the comparator flag at the same frequency */
    IfxStm_increaseCompare( &MODULE_STM2, Stm_Cmp_Config2.comparator, Stm_Cmp_Config2.ticks );
}