cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 5, 3 & 1

AlVa_264671
New Contributor II

Hi everyone

   

 

   

I would like to know which can be the reason a project work OK with debug  build setting  but fail when release option. is set.

   

Thank you for any help.

0 Likes
4 Replies
Bob_Marlowe
Expert II

The usual cause are missing "volatile" declarations for global variables that are changed in an interrupt handler.

   

 

   

Bob

0 Likes
AlVa_264671
New Contributor II
        Thank you Bob!   
0 Likes
AlVa_264671
New Contributor II

Hi Bob

   

Which are the unusual cases ?

   

I have 3 ISR  on each of the two project included in the workspace.

   

I check all the volatile variable declaration out and them are OK and declared with "extern" on each  .c file where they need to be used.

   

I  have already posted to you this workspace in  a previous post.

   

I set the release build setting for each of two project.

   

I verified that the sensor project work OK with Release set.

   

"The Gateway project does not."

   

But the funny or not funny thing is  that the  Gateway project  with debug set work OK with the Sensor project with release set.

   

Please see attached project.

   

 

   

Thank you for your help Bob

0 Likes
Bob_Marlowe
Expert II

The difference between debug and release modes is mainly the optimization level. Release mode is usually smaller and runs faster than debug mode. This can lead to race conditions.

   

You can set the optimization for every file separately: right click on the file in workspace explorer and select build properties, so you may find the file in error.

   

 

   

Bob

0 Likes