I am using my own board and CW 10.7. I have find that one variable is causing this problem.
But it is weird because it is not for all MCU. Just influence couple of them.
When the variable is global then it is not 100% functioning.
When the variable is local then it is working fine.
Here is my part of code which one is sometimes causing the problem:
#include <hidef.h> /* for EnableInterrupts macro */
#include <mcf51qm32.h>
#define true 1
#define false 0
unsigned char cEraseConfigSector;
/***************************************************/
void main(void) {
/***************************************************/
//unsigned char cEraseConfigSector;
cEraseConfigSector = true; //this code causes reseting the MCU
for(;;) {
while(1);
} /*endless loop*/
} /*end of main*/
/***************************************************/
and here is modified OK code:
#include <hidef.h> /* for EnableInterrupts macro */
#include <mcf51qm32.h>
#define true 1
#define false 0
//unsigned char cEraseConfigSector;
/***************************************************/
void main(void) {
/***************************************************/
unsigned char cEraseConfigSector;
cEraseConfigSector = true;//here it is ok because the variable is local
for(;;) {
while(1);
} /*endless loop*/
} /*end of main*/
/***************************************************/
Could you please advice what can be wrong that global variable is sometimes causing reset of the MCU?
BR,
Jozef