ISR enable is blocking the rest of main()

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

cross mob
Anonymous
Not applicable

 In my current PSoC 4200BLE project the enabling of an isr seems to "block" the rest of the main function.

   

In main there is a for loop after the ISR is enabled where I want to "print" to the UART some data calculated in the ISR, but the system naver reaches that part of the code:

   

CyGlobalIntEnable; 

   

isr1_Disable();

   

isr1_SetVector(InterruptHandler1);

   

isr1_Enable();                                                                                     

   

for(;;)

   

    {   

   

        UART_UartPutString("in main \n");

   

    }

   

If I don't enable the ISR, the message in the for loop is sent. But if I do enable the ISR, it is not.

0 Likes
7 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I would advise you to post the project -

   

 

   

    

   

          

   

“File”                                                             Creator

   

“Create Workspace Bundle”

   

   

 

   

Regards,. Dana.

0 Likes
Anonymous
Not applicable

 Sorry, the project bundle won't upload.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Any reason (error message) for the failling upload?

   

A cause for the non-working interrupt handler might be that you have forgotten to remove the cause for the interrupt, so that it is fired over and over, but that's just a guess. We need that project to help you, code snippets don't tell everything.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 try in internet explorer to upload project.chrome may not work sometimes

   

 

   

Regards,

   

Vikas.

0 Likes
Anonymous
Not applicable

Without some insight on your project; hard to do more than giving you a documentation pointer. Do you read the application note AN54460 about interrupts management ?

   

Do you know :

   

i) if your application crash in the ISR ?

   

ii) if your interrupt line (internal or external) is still active after ISR execution ?

   

iii) do you clear the interrupt source ?

   

... ... ...

   

 

   

Regards,

   

PNN

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

If the ISR is I2C related, and pullups not in place, and you attempt to

   

contact slave that can "hang" I2C. There is no timeout implemented

   

in standard.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 As Bob pointed, make sure that you are clearing the interrupt so that it does not fire again and again. Call isr1_ClearPending(); inside you interrupt handler function if you have missed it.

0 Likes