pgo

Changing initial execution point in codewarrior (for HC12)

Discussion created by pgo on Aug 24, 2006
Latest reply on Aug 28, 2006 by Daniel Lundin
I'm considering using codewarrior for undergraduate teaching but one thing that puts me off is the rather complicated C startup code. This is very offputting to a newbie and in this case I would have a class of about 170 of them! This is different to several other products I've used e.g. IAR embedded workbench usually 'resets' to the start of main().

This seems to have been acknowledged somewhat by the fact that when initially starting the debugger it displays main() rather than startup(). Of course when you start single-stepping it then immediately drops into the startup code. This also occurs if you reset the program.

So (finally) my question:
Is is possible to arrange things so that the C startup code is not so 'visible'. My attempts so far haven't been successful. I've tried a few approaches involving modifying the cmd files.

My attempts so far (and why they don't work):

Change Postload.cmd so it sets a temporary breakpoint at main() and then runs the code. This actually works leaving the program at the start of main after succesfully running the startup code BUT it only has this effect at loading not when reset.

Change Reset.cmd in the above manner. This has the major problem that you often don't have a breakpoint register available i.e. you are already using two breakpoints, so it fails.

Any ideas would be appreciated.

What I would really like would be an option in the tools to do the above properly - it wouldn't be very difficult. Dear Metrowerks developers - any chance of this?

Outcomes