Hello, are there any restrictions of codesize within a codeblock?
For examle the first code doesn't work:
if ( value ){ . . many Codelines . }
If i shorten the code above, then it works. i couldn't find out the border to the codesize within the block.
But this Code works correct:
if ( value ){ myfunction(); } void myfunction (void){ . . many Codelines . }
In both cases i don't get any error-messages from the compiler, while compiling.
Thanks for help Christian Tauschek
No, the OP did imply a problem with the compiler, and not when running the code.
He described two work-arounds, and noted that: "In both cases i don't get any error-messages from the compiler, while compiling."
Hello to all, now i've found out the problem. If the code exceeds 2048 Bytes, then it doesn't work. If my code has exactly 2048 Byte, then it works and it is enough to insert only one _nop_ to crash the Code. I am trying the demo. But i thought, i will get a compiler-message if the demo-codesize ist exceeded. But i didn't.
If the code exceeds 2048 Bytes, then it doesn't work.
... "the code" being the contents of that "code block", I'll asumme...
So you just found by experience what the compiler directive "ROM" (a.k.a. "Code Rom Size" in the uVision dialog) is for. You either have to pick ROM(LARGE) for that module, or cut your functions smaller.