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
解決済! 解決策の投稿を見る。
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
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
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.