I need to be able to use the debugger in real-time running the target board at full speed.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I need to be able to use the debugger in real-time running the target board at full speed.

1,239 Views
joecode
Contributor I

Can I use Code Warrior and  a BDM to monitor a 9S12 target board running at full speed. This is a single chip design programmed in assembly.

I need to be able to monitor ram locations and ports while the target is running.

I have read that the MCU can handle this, but I can't figure out how to get this working in Codewarrior.

 

Is this possible? I am using Codewarrior Special Edition and the USBDM from PGO.

 

Thanks,

Joe

Labels (1)
0 Kudos
Reply
7 Replies

1,075 Views
trytohelp
NXP Employee
NXP Employee

Hi Robert,

What is the interface used ?

What is the device 9s12 ?

Do you want to access ram memory and ports while the board is running ?

      So capture some data ?


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,075 Views
joecode
Contributor I

Hi Pascal,

I am using an inexpensive USB BDM for evaluation. This is the one sold by EVBPlus.

I am using this with Codewarrior Special Edition right now for evaluation.

Yes, I want to capture data during full speed operation of the MCU using the built in BDM hardware of the chip.

I want to be able to display this data in the Codewarrior debugger if possible.

I am using the MC9S12DG256 chip.

I need to be able to see port values and some ram values without interrupting the target operation.

Do I need a different BDM to do this?

Do I need a different version of Codewarrior to do this?

Can this be done at all?

Thanks,

Joe

0 Kudos
Reply

1,075 Views
trytohelp
NXP Employee
NXP Employee

Robert,

In addition to Radek info.

The periodical refresh updates the value of variables.

Now you can set a watchpoint (which is similar to a breakpoint) on a variable or memory.

You can define Read and/or Write access to stop the application.

You can add a command too and save some memory value for instance.

You will find more information in the Debugger_HC12.pdf manual under the installation folder \CWS12v5.1\Help\PDF.

Perform a search for watchpoint.

Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,075 Views
RadekS
NXP Employee
NXP Employee

Hi Robert,

It is possible.

You don’t need different version of CW.

About debugger)

It depends how you use your board.

You mentioned that you have Dragon board. Unfortunately I am not expert on that product, but..

Dragon boards are delivered with D-Bug12 firmware. This is code in MCU which simulates debugger trough serial line. This has advantage that you don’t need external debugger. Disadvantage of D-Bug12 is that this code has to be executed on the same core as main application and non-intrusive operations are quite limited.

On other side, we could use MCU with D-Bug12 as external debugger for second board (MCU). However I suppose that is not your case.

External debuggers communicates with MCU trough BDM interface. Since MCU has special debug module, access trough BDM could be almost “non-intrusive”. We could read/write memory without any intervention of CPU. This is big advantage of external debugger solution.

So, I would like to recommend using any external BDM interface (external debugger) as solution for proper work.

I could recommend for example:

USB Multilink Universal

http://www.pemicro.com/products/product_viewDetails.cfm?product_id=15320137

Note: USB BDM Multilink is no longer produced, but still good choice.

As inexpensive version you could use also any OSBDM/USBDM interface:

http://www.pemicro.com/OSBDM

http://usbdm.sourceforge.net

http://www.technologicalarts.ca/shop/store/details/573/21/microcontrollers/9s12/usb-bdm-pod-for-s08,...

In CW debugger window (hiwave.exe), please click right button on requested variable/memory view and select Mode-Periodical-set your update rate. After that you cloud let run MCU and variable/memory view will be periodically updated almost without any intervention from CPU side.

Optionally you could also connect BDM interface to already running code and select Hotsync (Attach) instead of Connect (Reset). In that case, source view will be not synchronized with running target, but for basic registers/memory inspection it is valuable feature.

Note: Hotsync is name of button for PEmicro(OSBDM) driver. It is possible that USBDM will have different name for that feature or Hotsync is not possible (I am not sure for now).


I hope it helps you.

Have a great day,
RadekS

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,075 Views
joecode
Contributor I

Excellent Radek - you are a genius - it works great! - thank you!

One last question. What is the best way to display a ram variable that I want to watch while the target is running?

Should I add something in the DATA window, what would that syntax be? Lets say my assembly variable is called CNT and is located at $1000.

Can I do the periodical watch in a visualization tool? I don't see how to do this in the properties of a vis tool?

Thank you for your help,

Joe

0 Kudos
Reply

1,075 Views
trytohelp
NXP Employee
NXP Employee

Robert,

There are several ways to display the value of variables:

    - inside Data Component

    - in Visualization Tool, ...

The key question is what are the information you want capture ?

1- The periodical refresh can be used to refresh at defined time the variables listed under Data component.

However it's a periodical refresh and not display each changed value.

If the defined time is 1second, the data will be refreshed every second.

To enable it you need to select the Data Component and with pop-up menu select Mode + Periodical ...

Now you can define an update rate.

Run the application.

2- If you want capture only write access you need to use another solution.

In this case the watchpoint is probably a better solution.

The watchpoint can be set on variable name in the Data component or in the Memory component too.

Inside Data the watchpoint is dedicated to a specific variable whereas under Memory you can define a watchoint on memory area (range).

How to set it:

    - select variable or memory area,

    - pop-up menu + Set watchpoint.

Open the Watchpoint configuration: Run menu + Control Point...

Click on Watchpoints Tab.

In the Watchpoint configuration you can define some options as stop on read, write or read/write, condition and add a command.

The command will be executed.

In the command option you can set continue - in this case the application restarts after command execution.

The command could be a single debugger command or a call a command file.

By this way you can save the value of a variable for instance by using:

    fprintf (test.txt,"%s %2d","The value of the counter is:",counter)

The content of the file test.txt is: The value of the counter is: 25

3- Visualization too.

You can add a new component and display what you want here.

You will find more information in the Debugger_HC12.pdf manual (\CWS12v5.1\Help\PDF)

Page 497: Book IV - Commands and Environment Variables

Page 143: Visualization Tool Component


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,075 Views
RadekS
NXP Employee
NXP Employee

You have at least two simple options:

  1. You could attach to MCU, localize 0x1000 in memory map, mark by mouse appropriate length of variable (e.g two bytes for int), click right button select Mode-Periodical-set your update rate.
  2. You could attach to MCU, right click in Data:1 (or Data:2) window and choose Add expression…, write variable name (CNT) and select update mode for this view according previous step. Debugger must know such variable, therefore loading symbols may be necessary prior this option.
  3. You could use commands for read variable/memory (DB, DW, DL), for read register (RD), for save memory content into file (SAVE), for start logging (LF) for add expression (ADDXPR),…
    Sequence of these command could be stored in cmd file and executed by CMDFILE command. This way we could also automates some procedures…

For more details about these commands, please look Debugger Commands in debugger help menu or check "c:\Program Files (x86)\Freescale\CWS12v5.1\Help\PDF\Debugger_HC12.pdf" document.


I hope it helps you.

Have a great day,
RadekS

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply