R7F701278 (RH850/C1M-A1) interrupt service routine not working

Hi,

I am working on this microcontroller. It does not have support by smart configurator. Hence, I am using smart configurator for RH850/C1M-A2 (R7F701275) to generate driver files as the H/W and S/W manual is the same.

I have configured OS timer OSTM0 in interval timer mode and enabled the OSTM0TINT via smart configurator.

However, after adding the files - intvector_PE1.c, intc_PE1.c and Config_OSTM0.c, Config_OSTM0.h, Config_OSTM0_user.h into my project, the programme runs but does not enter the ISR.

The ISR routine programme is as follows:

..

..

int intr=0;

#pragma interrupt r_Config_OSTM0_interrupt_pe1(enable=false, channel=25, fpu=true, callt=false)
void r_Config_OSTM0_interrupt_pe1(void)
{
    /* Start user code for r_Config_OSTM0_interrupt_pe1. Do not edit comment generated here */
    intr+=1;
    /* End user code. Do not edit comment generated here */
}
..
..
..

I have checked that the ISR:  r_Config_OSTM0_interrupt_pe1() is correctly mapped to channel 25.

I am also doing EI() for setting interrupts during initialization.

Why is the program not executing the ISR?

THANKS FOR THE SUGGESTIONS THAT YOU CAN GIVE ME.

Parents
  • You need to uncomment this interrupt channel in DeviceName_irq_PE1.h otherwise this IRQ is redirected to unused ISR channel 

  • Hi DimitarK,

    I am not using any external interrupts to control the OS timer. My programme executes OSTM0_Start() function which sets the TS bit after INTOSTM0TINT setting as below:

    void r_Config_OSTM0_enable_pe1_interrupt(void)
    {
    /* Set INTOSTM0TINT setting */
    INTC1.EIC25.BIT.EIRF25 = _INT_REQUEST_NOT_OCCUR;
    INTC1.EIC25.BIT.EIMK25 = _INT_PROCESSING_ENABLED;
    }

    void R_Config_OSTM0_Start(void)
    {
    /* Clear OSTM0 interrupt request and enable operation */
    r_Config_OSTM0_enable_pe1_interrupt();
    /* Enable OSTM0 operation */
    OSTM0.TS.UINT8 = _OSTM_COUNTER_START;
    }

  • The code you share enable interrupt but this interrupt still doesn't exist in interrupt table - you need to "add" this interrupt number to interrupt table. To do that you need to uncomment in DeviceName_irq_PE1.h the interrupt you enabled 

  • I do not have any such file in my programme as seen here nor this file was generated by the smart configurator.

    Nevertheless, I will check my programme if this interrupt has been commented somewhere and get back to you.

  • I did not find any other location. Even in the smart configurator for RH850/C1MA2 this file is not getting generated if I select OSTM0.

    In the manual, IRQ is defined as external interrupt and OSTM0 is a part of EI vector table which allots vector 25 for OSTM0.

    The ISR is defined as below in the file r_cg_intvector._PE1.c

    ..

    ..

    /* OSTM0 interrupt (OSTM0TINT); */
    extern void r_Config_OSTM0_interrupt_pe1(void);
    /* OSTM1 interrupt (OSTM1TINT); */
    extern void eiint26(void);
    /* OSTM2 interrupt (OSTM2TINT); */
    extern void eiint27(void);
    /* OSTM3 interrupt (OSTM3TINT); */
    extern void eiint28(void);

    ..

    ..

    I am defining the ISR in Config_OSTM0_user.c file. I cannot see any declarations apart from these vector function declarations as extern. IS THAT AN ISSUE?

    The interrupt table is as follows:

    #pragma section const "EIINTTBL_PE1"
    void * const INT_Vectors_PE1[] = {

    ..

    ..

    ..

    /* SINT7 interrupt; */
    (void *)eiint24,
    /* OSTM0 interrupt (OSTM0TINT); */
    (void *)r_Config_OSTM0_interrupt_pe1,
    /* OSTM1 interrupt (OSTM1TINT); */
    (void *)eiint26,
    /* OSTM2 interrupt (OSTM2TINT); */
    (void *)eiint27,
    /* OSTM3 interrupt (OSTM3TINT); */
    (void *)eiint28,

    ..

    ..

    ..

    Is there something that I am missing here?

  • Thank you.

    I will try this at once.

  • Hi,

    I did the same as given in the link. It showed error: cannot find external symbol  "r_Config_OSTM0_interrupt_pe1".

    My project previously had a sub project within it. Hence, I suspect this issue. To rectify, I created a new project with all files in the main project itself and no sub projects. It now looks like this:

    However, here I am facing a new issue in cstart.asm

    It shows that s.data.R is undefined. I looked through the CC-RH user manual. But the cstart.asm code there is exactly the same.

    Manual link:

    CC-RH Compiler User's Manual (renesas.com)

    Is there some other issue also?

    Thanks

  • Hi,

    The issue is now resolved. Turns out that in linker settings of CC-RH I had to map ROM and RAM simply by

    .data=.data.R

    Thanks Slight smile

Reply Children
No Data