Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.

We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.

Thank you for your understanding.


This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Program with initialised global variables does not run

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