Experts, I have a 'C' program that contains an array of around 10 unsigned int's. If I initialise it during the declaration, the code never enters main() (I placed a breakpoint on the first instruction inside my main() but it never got hit). unsigned int array[10]={0,0,0,0,0,0,0,0,0,0}; // does not work.
If I remove the initialisation part, it works. Why? MCU = C8051F340 (Silabs) Keil version = C51 COMPILER V7.10 Assembler command line flags: XR GEN DB EP NOMOD51 Compiler command line flags: PW(80) SB LC OT(9,Size) CD DB OE DF(__F340_VER__) Large Linker command line flags: RS(256) PL(68) PW(78) IX
Thanks.
Regards, Ganesh
startup.c no such thing it is startup.a51
But turning off the watchdog is normally not something you want to do. In real life, the watchdog is something you should be ready to pay extra for, because you really do want your hardware to be restarted in case something goes wrong. there is a caveat: the Keil 'preprocessing' do not kick the puppy and thus with these chips you need to muzzle the puppy in startup.a51 and release it at the top of main
Erik
It is always problematic to have a watchdog that runs too fast. For most applications it will be ok to have a watchdog timeout of 1-10 seconds. For a processor that can't decompress all variables within one watchdog cycle, Keil really should consider releasing a version of the library that kicks the watchdog during the startup operations. A watchdog works best if it can be turned on as soon as possible - best is that it is turned on by a fuse, so it is turned on before the first instruction is processed.
Keil really should consider releasing a version of the library that kicks the watchdog during the startup operations. that would require, lots and lots of versions. A watchdog works best if it can be turned on as soon as possible - best is that it is turned on by a fuse, so it is turned on before the first instruction is processed. I do not have a problem with a WD that can be turned off, if turning it off is complex enough to make the likelyhood of runaway doing so is less then 1/1000000
"that would require, lots and lots of versions." Not at all. All they need is for the RTL to call a helper function for kicking, and expecting you to supply such a function.
there is a caveat: the Keil 'preprocessing' do not kick the puppy and thus with these chips you need to muzzle the puppy in startup.a51 and release it at the top of main
Try reading the instructions in init.a51 instead.
Here: http://www.keil.com/support/man/docs/c51/c51_ap_init.htm
Handling of a Watchdog is specifically mentioned...
(in almost the way that Per suggested)