Hello,
I made some unit tests in the SW using some sections with
#ifdef UNIT_TEST
<test variables 1>;
<test variables 2>;
<test variables 3>;
#endif /* UNIT_TEST */
After building the HEX file (in s19 format), there are changes in it, which are not allowed. The define UNIT_TEST is used only in the test Tool.
I presume that, this define is not accepted (but the test section is) from CodeWarrior and CW generates code.
The memory map is new generated but also not changed (there is no any build date in it) even some SW changes are made.
I use CodeWarrior for MCU, Version: 10.6, Build Id:140329 for microcontroller HCS08. No other changes in the framework or in the project are performed.
Thanks
Vlad
Hi,
in addition, if variable1, variable2, variable3 are global variables, make sure they are not optimized compiler.
to avoid optimization, add this code in prm file:
ENTRIES
variable1, varaible2, variable3
END
if the problem persists, I would like to suggest you create a demo project for your issue and post it here. thus we can check it directly.
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Vla
Where did you define UNIT_TEST? Usually we define the macro in Project Properties-> C/C++ Build-> Settings-> HCS08 Compiler -> Preprocessor, please see the screenshot below.
Please remove it from this panel if you do not need it in release reversion of your software.
It is easy to know the macro exists, just place some illegal code inside the “#ifdef…… #endif”. If the macro definition is already removed completely, there should be no error like below. If the error appears, there must be somewhere defined the macro.
If your variables or functions defined inside “#ifdef…… #endif” are not appearing in the new generated MAP file, they should not be included in S-record file either. Please compare the S-record files to know what is changed before and after removing the macro definition.
Hope it helps!
Best Regards
Fiona Kuang
Technical Information & Commercial Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------