Hi,
At first glance, I would say it's simply an optimization problem:
Your variable "number" is not volatile, and it is only affected once.
Therefore, the compiler may completely remove it and its affectation, leaving your main function almost reduced to a simple "return"... And the main function is not supposed to end.
Always put a "while(1);" at the end of "main".
Always declare your 'debug variables' ("number" in your case) as global volatile, and reduce the optimization level of the compiler to zero when you want to watch very simple code like this.
Here is the test I've made:
1. open this example: (that contains a while(1) in main)
<Ride>\Examples\ARM\REva\STM32F103_Toggle\STM32F103_toggle.rprj
2. reduce opti level to zero in the compiler options. (to prevent opti)
3. add UART0_putchar library in the linker options. (to have _sbrk)
4. add this code before the main function:
#include <stdlib.h>
volatile float number=5.5;
volatile float number2=3.5;
volatile char numStr[] = "123.5";
5. Add this code at the start of the main function:
number2=number*3;
number=atoff(numStr);
number2=number*3;
6. compile, start debug, add "number" and "number2" to the list of watches.
7. step three times and observe the variables "number" and "number2" being modified.
I hope it helps. If not, please send us a complete project that shows the problem. (support@raisonance.com)
Best Regards,
Vincent