Terminal Emulation not working

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

Terminal Emulation not working

1,435 Views
mkrug
Contributor II

Hello,

 

I try to use the Terminal emulation of the Debugger in two way. Unfortunately both do not work:

  1. Using in Simulation Mode: I exactly use the TERMIO_Init() as it comes with the installation. If I use afterward:

      TERM_Direct(TERM_TO_WINDOW, "test.bin");
      TERMIO_PutChar('a');

      I did not get any output at all. I tried to change the setting of the Baudrate and the COM

      Port in the 'Configuration Connections ...' window. With not success. When I mark

     'Show Protocol' I always get:

      TERMINAL: Open serial port on COM1 baudrate 9600
      TERMINAL: Failed to open serial port COM1 with 9600

      When writing on the SCIDRL Register I can see in the Memory Window of the

     Simulation that something  happens because the 0x00 turns into red

2. Using on the real hardware:

     My real hardware has not SCI Lines that are accessable. However I thought with the

     Debugger I can use the SCI Module of the µC (mc9s12dg128b) exactly like there are

    accessable and redirect it to the Terminal window in the Debugger. However even

     when I select 'Add All' for the possible connections I get no output at all in the Terminal

      Window. If I change baudrate and COM Port with marked 'Show Protocol' I always

     get the same message as with the simulator:

      TERMINAL: Open serial port on COM1 baudrate 9600
      TERMINAL: Failed to open serial port COM1 with 9600

 

What is surprising to me is that at least in the simulator mode some of the

examples (did not try all) that comes with the installation works in the simulator

mode. However even when I think I copied line by line to my project it does not work.

 

I am using the 'free' Version of Codewarrior.

 

Does anyone have the Terminal window up and running and can please direct my

through the configuration

 

Best Regards
Markus

Labels (1)
Tags (1)
0 Kudos
3 Replies

556 Views
kef
Specialist I

Using terminal I/O in simulator is simple. Just 3 steps are required

 
1) copy and add to your project termio.c file from
c:\Program Files\Freescale\CWS12v5.1\(CodeWarrior_Examples)\HCS12X\GlobalAddressing\Sources\termio.c
Though it is from S12X examples, it will work also for S12DG128B
 
2) Add #include <stdio.h> to files, where you want to use printf from

 

3) Initialize SCi adding    TERMIO_Init(); call to your main or something.
That's all. From now you should be able to call printf and see your strings in terminal component window (Component->Open...).
 
 
Regarding printf over BDM. No, it has nothing to do with SCI module. Debuggers, which support it, are using some RAM cells as I/O flags and data. You set some flag, then when debuggers reads it, it will determine if you placed some data to print buffer or not and shows it in some window. The same works in reverse direction. Debugge writes your keypresses into RAM on your target and so on.
This "serial" I/O over BDM works in NoICE (www.noicedebugger.com) debugger. Codewarrior examples mention something like this for BDIK target connection. But it looks like this useful feature is not available for P&E multilink or TBDML connection.

0 Kudos

556 Views
phantomgz
Contributor III

Hi Kef, 

How about use your method with "Open Source BDM" and HCS08 ?

 

Cai.

0 Kudos

556 Views
kef
Specialist I

Unfortunately S08 simulator in classic IDE for some weird reasons is using P&E simulator, which is disabling ability to direct simulated SCI output to the terminal component. I know that in some very old release of CW it was working the same way for HC08 like it is working for S12.

 

Regarding "serial" I/O over BDM. It should be debuggers task, and not the feature of specific BDM connection. I'm not sure, but I doubt it is implemented for Open Source BDM, while it is not available for Multilink connection.

(HC11 Serial monitor connection from some old CW allowed not only to debug over SCI, but also allowed to do I/O to terminal component over the same SCI module. It could be way faster to have the same communicating using BDM pin).

0 Kudos