link error termio_putchar undefined

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

link error termio_putchar undefined

ソリューションへジャンプ
1,890件の閲覧回数
steph
Contributor I

bonjour,

 

je voudrais utiliser la bibliothèque "stdio.h" pour utiliser la fonction printf mais a la compilation j'ai une erreur de lien L1822 :

symbol TERMIO_Putchar in file C:\Program Files (x86)\Freescale\CWS12v5.1\lib\HC12c\lib\ansixli.lib is undefined


en entete de mon fichier j'ai  bien déclaré : #include <stdio.h>

 

merci de m'indiquer comment résoudre ce probleme

 

Stéphane

ラベル(1)
0 件の賞賛
返信
1 解決策
1,442件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello,

I think that this is because you are using printf, scanf, stdin and/or stdout. This happens because functions like printf or scanf need the functions for using the SCI in the microcontroller; this functions are TERMIO_Init for initializing the serial port, the initialization sets a baud rate ;

TERMIO_PutChar for sending a char and TERMIO_GetChar for receiving a byte. This functions are located in a file named Termio.c ; In your project sources add the file Termio.c located under the installation directory in “..\{your CW insall}\lib\hc12c\src”

If you wish to use your own SCI routines with printf, scanf, stdin and/or stdout, you can copy the file named termio.c, and replace the code in each function with your own code, keeping only the names of the functions. Also you need to copy the file termio.h which is located in the lib directory, you can leave this file as it is.

this works on my side. can this also work for you?

=================================================

this answer is for you, if it helps, please click on "Correct Answer " button. thanks!

Best Regards,

Zhang Jun

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,443件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello,

I think that this is because you are using printf, scanf, stdin and/or stdout. This happens because functions like printf or scanf need the functions for using the SCI in the microcontroller; this functions are TERMIO_Init for initializing the serial port, the initialization sets a baud rate ;

TERMIO_PutChar for sending a char and TERMIO_GetChar for receiving a byte. This functions are located in a file named Termio.c ; In your project sources add the file Termio.c located under the installation directory in “..\{your CW insall}\lib\hc12c\src”

If you wish to use your own SCI routines with printf, scanf, stdin and/or stdout, you can copy the file named termio.c, and replace the code in each function with your own code, keeping only the names of the functions. Also you need to copy the file termio.h which is located in the lib directory, you can leave this file as it is.

this works on my side. can this also work for you?

=================================================

this answer is for you, if it helps, please click on "Correct Answer " button. thanks!

Best Regards,

Zhang Jun

0 件の賞賛
返信
1,442件の閲覧回数
steph
Contributor I

hello,

sorry i'm very late for your answer.

thanks for it . I look the TERMIO file . i see that use "while" instruction, so it doesn't interesting me because i try to not use this instruction with the microcontroleur. usually, when there is a communications problem it blocks the program.

0 件の賞賛
返信