cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

New Contributor II

Hi Sir ,

      Now I  am using CY8C4547AZI-445  for a project . I have exported  the project to IAR 8.3. Now I have a probem ,when download and debug  ,it prompt flashloader error. And not be able to access timing interruption,when place a breakpoit .

      I have paid a lot of time to find out the cause .Now I get it ,but don't know why. 

     

    In i_ODUtim1ms.c ,there is one function:

   CY_ISR(Time1ms_ISR)

   {

       if (Timer_1ms_INTR_MASK_CC_MATCH == Timer_1ms_GetInterruptSourceMasked()) // Check interrupt source

       {

           Timer_1ms_ClearInterrupt(Timer_1ms_INTR_MASK_CC_MATCH); // Clear interrupt and then process Capture interrupt

           return;

        }

       Timer_1ms_ClearInterrupt(Timer_1ms_INTR_MASK_TC);       // Clear interrupt and then process Terminal Count interrupt

       i_ODUtim1ms();

   }

      I have cut the code and paste it to main.c , all the problem have solved . If  I debug the program using Psoc Creator 4.2 ,and

there is no problem .

     I think may be there  is something different in the complier ,but I can't find out it . Could you please kindly help me?

     Thanks.

0 Likes
Reply
1 Solution
New Contributor II

Hi Ankita ,

     I am sure I  have followed all the steps. Now I have found that  if I define a dummy variable like unsigned char m=0; in  CY_ISR(Time1ms_ISR), and it works .

    I am sorry that the project is in the customer's computer , so I cann't share it to you .

    Thanks.

View solution in original post

0 Likes
Reply
4 Replies
Employee

Hi,

Can you please try the following code snippet:

CY_ISR(Time1ms_ISR)

   {

       if (Timer_1ms_INTR_MASK_CC_MATCH == Timer_1ms_GetInterruptSourceMasked()) // Check interrupt source

       {

           Timer_1ms_ClearInterrupt(Timer_1ms_INTR_MASK_CC_MATCH); // Clear interrupt and then process Capture interrupt

          

        }

else

{

       Timer_1ms_ClearInterrupt(Timer_1ms_INTR_MASK_TC);       // Clear interrupt and then process Terminal Count interrupt

       i_ODUtim1ms();

}

   }

Basically not to use "return" in isr body, using "else" instead.

Then compile the code in Creator and export it to IAR by following the steps as given in Help section of PSoC Creator.

Thanks,

Ankita

0 Likes
Reply
New Contributor II

Hi Ankita,

    It does not work.

0 Likes
Reply
Employee

I hope you have followed all the steps mentioned in Help Section of Creator for Exporting a PSoC4 project to IAR.

Please share the Creator project.

0 Likes
Reply
New Contributor II

Hi Ankita ,

     I am sure I  have followed all the steps. Now I have found that  if I define a dummy variable like unsigned char m=0; in  CY_ISR(Time1ms_ISR), and it works .

    I am sorry that the project is in the customer's computer , so I cann't share it to you .

    Thanks.

View solution in original post

0 Likes
Reply