AnsweredAssumed Answered

HC12: How to minimize amount of code in non-banked rom

Question asked by Anders Johansson on Oct 14, 2006
Latest reply on Oct 23, 2006 by Steve Melnikoff
From my understanding of how CW 3.1 for HCS12 locates memory segments,
I believe that at least the following segments end up in non-banked rom.
 
* Vector table
* Startup code
* Startup code data structure
* Arithmetic run-time functions
* Constants, declared with CONST
* Autoinitialized variables
 
What do I need to do to make sure most of these, if not all,
 (OK I give up on the vectortable)
are located in banked memory of my choice?
 
I need this to be able to upload a new version of the running program
to a free memory bank, without crashing the already running program.
 
Then at my convenience:
* I will reprogram a "pointer to firmware to run after reset"
* Cause a COP timeout to reset
After the reset, the new version will run, effectively swapping to a updated
program after only a 1 second downtime.
 
This entire concept seems impossible due to the fact that CW 3.1
always puts the above mentioned memory segments in non-banked memory,
which prevents the "new version" from being uploaded since it
needs memory that is in use by the already running program.
 
After being in contact with Freescale support I have been told that CW 4.5
has an option to select a "minimal startup routine", that will minimize the
amount of code placed in non-banked memory, but it will not remove everything.
 
All comments and advice are very much appreciated.
 
Thanks,
Anders J

Message Edited by CrasyCat on 2007-04-13 01:40 PM

Outcomes