Hi,
I'm using the MCBSTM32E board with STM32F103ZE uC.
If I declare an enumeration type as 'static' in a function or as a global variable then the compiler signals no error or warning but the application simply does not run.
typedef enum{ first=1, second=2 }TeMyEnum; void vMyFunc(){ static TeMyEnum eMyEnum=second; }
Where do I go wrong?
Thanks Henk
What do you mean by, "simply does not run."
The only thing that would stop the program running is if the processor is not running.
Almost certainly, the program is running - just not as you expected. Quite possibly, it is crashing.
What Debugging have you done to find out exactly what is really happening?
Are you running in the Simulator, or real hardware?
Running real hardware
WEIRD!
If I write some application then downloading it, it automatically starts to run. (set in the flash configuration). However, pressing the RESET button does not restart the application. (The Leds don't light up).
But...
Whe using some static variable then the download does not start the application but when I press the RESET button is DOES start!
weird...weird...weird...
Do I miss something regarding the RESET situation?
Henk
I suspect you are looking at a lot of red herrings.
Most likely, there is something wrong with your memory setup (and/or Stack setup), and your program is crashing due to invalid memory accesses...
"I think the board stays in bootmode"
Again, why do you think that?
What debugging have you done to confirm that hypothesis?
Remember: nobody else can see your code; nobody else can probe your system - we rely entirely on the information that you provide!
How are you downloading?
First things first:
>Most likely, there is something wrong with your > memory setup (and/or Stack setup), and your program > is crashing due to invalid memory accesses...
I think you could be right. It seems like a memory problem. I'm new to this ARM stuff. My project includes the STM32F10x.s and my main.c file only includes stm32f10x.h.
I think that is sufficient for proper stack e.t.c. initialisation.
I assume that when selecting the correct processortype in uVision that memory settings will be okay?
I download using the ULINK-ME interface shipped with the board.
Of course not - it is entirely dependent on your application. Did you enable all errors/warnings in the compiler/linker settings?
View all questions in Keil forum