global variables stopping program execution | Cypress Semiconductor
global variables stopping program execution
We have a program developed (PSoC Creator) by a consultant that runs on a CY8C3244PVI-133 chip. It ran properly on an earlier compiler (late 2013), but now stops at the first program line where a global variable is used. He has defined these (4) global variables immediately above the main.c routine as follows:
We are building this project under PSoC Creator 3.0 SP2 (10/2/14) and it builds fine. But running it under the debugger fails the first time one of the above variables is assigned (whether hardcorded at a numeric value, or calculated from simple arithmetic). Is it now illegal to define global variables this way (Keil 9.51)? We have tried everything we can think of to solve this problem but the program halts as soon as any of these global variables is used in a line of code, without any explanation other than that the program stopped at that line (and the global variable value shows as 0 on a mouseover within the debugger after program halt, even though it may be a simple assignment). For example, like this:
gfAnalogRange = MAX_ANALOG_VAL - MIN_ANALOG_VAL;
Both MAX_ANALOG_VAL and MIN_ANALOG_VAL are correct on a mouseover (4220 and 212, respectively). The program halts on this line. If we hardcode the value for gfAnalogRange as:
gfAnalogRange = 4008.0;
the program halts on that line which is a simple assignment. Anyone know what is happening here? Thank you.