I am using IAR embedded workbench for MSP430 v5.60.7, which is IAR embedded workbench version 6.6. I am using C99.
I am trying to override __program_start() with my own symbol, a function called __unit_test_main(). I have gone to the linker config tab and checked the box "override default program entry", selected the "entry symbol" option and typed in __unit_test_main. This compiles and links however it does not run in the simulator. I get the message "User error: Illegal opcode found on address 0x0". When I try to run this on the target it just doesn't work - the controller goes into low power mode.
The PC and SP are both initialized to 0x00 at startup.
So what else do I need to do/define to get the PC and SP initialized properly?
My unit test main function is trivial right now, here's the whole file its in:
#include <cstdio>
void __unit_test_main(void);
void __unit_test_main(void)
{
printf("Hello World");
for(;;)
{
}
}