Link Error   : L1822: Symbol TERMIO_PutChar .... undefined

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Link Error   : L1822: Symbol TERMIO_PutChar .... undefined

8,388件の閲覧回数
BoloMestre
Contributor I
I am using the command  
 
printf(c_PWD,"#x",NumDec);
 
 to convert a Decimal for Hexadecimal and when compiling an error below it appears:
 
Link Error   : L1822: Symbol TERMIO_PutChar in file ..\CodeWarrior CW12_V3.1\lib\HC12c\lib\ansibi.lib is undefined
 
I am using the mc9s12ne64 and CW3.1
 
What I must make?
 
 
 
ラベル(1)
0 件の賞賛
返信
6 返答(返信)

1,628件の閲覧回数
CrasyCat
Specialist III

Hello

Where are you trying to write to?
Do you want to write to the target SCI port?

In that case just add the file {Install}\lib\hc12c\src\termio.c to your project.

If you want to redirect stdout anywhere else, you will have to provide an implementation of the low level write function in your own termio.c.

I hope this helps.  

CrasyCat

0 件の賞賛
返信

1,628件の閲覧回数
itisravi
Contributor II

Hi,

 

Been  wading through various posts about printf, PRINTF (for the simulator/debugger) and termio.

 

My setup:

CW 5.9.0

PE 2.98 for HCS12SX

MCU:smileyfrustrated:12XDP512

 

I have a softek kit for my MCU. i use SCI0 to connect to a peripheral device. The SCI0 code is autogenerated by PE.

While debugging,  i needed to see what's arriving at my SCI0. I therefore use the Terminal Component as a Virtual SCI.All good.

 

I aslo need to call printf at various points in my code (for debugging only) and see the output on   Terminal. So i add the termio.c mentined in the previous post. Works fine, the output appears on the same Terminal used above.

 

My questions:

1.I did not modify termio.c so it's apparently using SCI0. Does this mean all printfs are also redirected to the SCI0 uart as well? I don't want this to happen.

 

2.If yes, then i need to change the  SCI_ADDR in  termio.c to point to another (unused) uart. Where can i find the address of my uarts? The current defintion is :

 #define SCI_ADDR 0x00c8

 

3.Do i need to add a new Terminal component to see the printfs in case point 1 is true?

 

Thanks.

0 件の賞賛
返信

1,628件の閲覧回数
itisravi
Contributor II

UPDATE:

 

Think i made a mistake. The Terminal component seems to work only in simulation mode! Not while debuggin on the softked board. How do i see what's being received on my SCI0?

 

0 件の賞賛
返信

1,628件の閲覧回数
CrasyCat
Specialist III

Hello

 

If you are debugging on real hardware you need to connect your board SCI0 connector with one of the PC serial port using a RS232 cable.

   Once this is done, you need to configure the Terminal.

  - Click right inside of the terminal window

  - Select "Configure Connections ..."

  - In the "Configure Terminal Connection" dialog set "Default Configuration" to "Serial Port"

  - Set "Serial Port" and "Baud Rate" according to your configuration (in the provided termio.c, baud rate is configured

     to 9600 Baud. 

 

To go back to our initial question, yes printf will be sent to terminal using SCI0.

If you want to use an alternate serial port, you need to use another serial port on your chip.

 

Please refer to the microcontroller reference manual to find our address of the other serial port.

 

If you intend to use another serial port for printf, make sure to connect this SCI with your Host PC serial port.

 

CrasyCat

0 件の賞賛
返信

1,628件の閲覧回数
itisravi
Contributor II

"If you intend to use another serial port for printf, make sure to connect this SCI with your Host PC serial port."

 

Thanks, that seems to do the trick

0 件の賞賛
返信

1,628件の閲覧回数
alex_spotw
Contributor III
Hi:

The problem is that the linker is looking to the TERMIO_PutChar function to print the characters, but you have not defined that function.

I would suggest to use the sprintf function, that allows to print into a string, and then use whatever function you define to print that string into a serial port, LCD, wireless port, etc.

For example,

sprintf(c_PWD,"#x",NumDec);
Sent_to_Serial_Port(c_PWD);

Regards,

Alex
0 件の賞賛
返信