I have one Problem and hope you can help me with this. I have written lots of software on Windows-Based PCs. But now I am writing my very first software for a Mikrocontroller. So I have one beginner Problem.
I Use the Metrowerks Special Edition Compiler for HC(S)12 Version 3.1 and the TBDML background debug cable. My Controller is a HCS12DG256 on a PCB from Elektronikladen. This one: http://elmicro.com/en/cards12.php
In the Memory is a Monitor-Software installed, which redirects all vectors to RAM. The Interrupt -Vector is redirected in the range from TP_RAMTOP to TP_RAMTOP-189. In this Range I have to write one Jump-Instruction to the Function for each Interrupt Service Routine.
I want to debug the software in RAM. So what do I have to do to place the software in the RAM and use the redirected Interrupt-Vector.
Of course the big disadvantage of RAM is that you have to reload it every time from startup.
If you do want to use the monitor and RAM you should place a table in RAM that contains jump (JMP) instructions to your interrupt handlers. To put this and your code in RAM you should use a linker parameter file to identify the segments where the code and table are placed.
The problem is: I don’t see the switch in the Metrowerks IDE to set the location of the software. Before I used the Metrowerks Compiler, I used the Compiler from Imagecraft. In this IDE I could easily define all the things I need, but the TBDML doesn’t support debugging with Imagecraft / NoICE. So I switched to Metrowerks. But this IDE is probably a big to huge for a beginner.
Posted: Tue May 24, 2005 3:35 pm
Ok, I understand - don't forget that you hav hardware breakpoints that work in flash too.
The linker parameter file is where you tell CodeWarrior where to put stuff. The default for code will be flash but by simply selecting a user segment that goes into RAM you can change this.
The default CW projects define a standard linker file for you to begin with
RAM will probably be defined as a segment at
RAM INTO READ_WRITE 0x2000 TO 0x3FFF
so all you have to do is to put your user code segment (say CODE_RAM) into that segment
CODE_RAM INTO RAM
in the placement section.
Posted: Tue May 24, 2005 4:06 pm
Guys, there is now a port of TBDML to the No-ice debugger, I will have a look for a link.
Posted: Tue May 24, 2005 9:02 pm
I checked I found an email from John at NoIce, and it is supported, drop them a line on the subject.
Posted: Wed May 25, 2005 7:18 am
OK, thanks for response.
I have altered the Linker-File and created three sections in the RAM:
RAM = READ_WRITE 0x1000 TO 0x1FFF; RAM_CODE = READ_ONLY 0x2000 TO 0x2FFF; RAM_DEFAULT = READ_ONLY 0x3000 TO 0x3FFF;
And I used the sections like this:
PLACEMENT _PRESTART, /* Used in HIWARE format: jump to _Startup at the code start */ STARTUP, /* startup data structures */ ROM_VAR, /* constant variables */ STRINGS, /* string literals */ VIRTUAL_TABLE_SEGMENT, /* C++ virtual table segment */ NON_BANKED, /* runtime routines which must not be banked */ COPY /* copy down information: how to initialize variables */ /* in case you want to use ROM_4000 here as well, make sure that all files (incl. library files) are compiled with the option: -OnB=b */ INTO RAM_CODE; DEFAULT_ROM INTO RAM_DEFAULT; DEFAULT_RAM INTO RAM; END
Is that OK?
Now I have another Problem. The HiWave debugger didn’t find the source code. In the Child-Window with the name “Source” is no code visible. Just a Message “no source reference found”.
The Command Window Prints these Messages:
!Command < attributes CACHESIZE 1000 !bckcolor 50331647 !font 'Courier New' 9 BLACK !AUTOSIZE on !ACTIVATE Data:2 Command Procedure Data:1 Source Register Assembly Memory done C_layout.hwl Loading Target ... SETCOMM DRIVER NOPROTOCOL NOPERIODICAL "tbdml_gdi12.dll" SETCOMM COMPORT LPT "TBDML #1" Startup command file does not exist. Startup command file does not exist. RUNNING STOPPING Preload command file does not exist. executing D:\DATA\Microcontroller\HC12\bin\Simulator.bpt !savebp off HALTED done D:\DATA\Microcontroller\HC12\bin\Simulator.bpt executing D:\DATA\Microcontroller\HC12\bin\Simulator.mrk !MARKPOINTS SAVE OFF done D:\DATA\Microcontroller\HC12\bin\Simulator.mrk Postload command file does not exist. in>
I will send a Mail to NoICE if the “Metrowerks experiment” fails
Posted: Sun Jun 05, 2005 6:06 am
my personal “Metrowerks experiment” failed. This IDE is a lot to huge for a beginner. Now I’m using the Imagecraft Compiler, again. John Hartman from NoICE told me that the TBDML will be supported in Version 8.4, which will be released in a few days.
Thanks for the Help.