Topic : Scanf and sscanf are now available for the STM8?

Forum : ST7/STM8

Original Post
Post Information Post
May 5, 2014 - 12:10pm
Guest

According to RKit-STM8 release note scanf and sscanf are now available for the STM8. Is that true? We are going to update our software because of sscanf support.

Replies
Post Information Post
+1
0
-1
May 12, 2014 - 11:21am
Raisonance Support Team

Yes, STM8 scanf and sscanf have been available for more than one year.

+1
0
-1
May 27, 2014 - 10:02am
Guest

Thaks for reply. We have updated our software to enterprise. Then I try to use sscanf but I got errors:


Copyright (c) KEOLABS S.A.S. 1987-2013. All rights reserved. Raisonance is a KEOLABS brand.
***ERROR 100 : UNRESOLVED EXTERNAL
SYMBOL : FULLB_SCI(GETCHAR)
***ERROR 100 : UNRESOLVED EXTERNAL
SYMBOL : USART_DR(GETCHAR)
***ERROR 100 : UNRESOLVED EXTERNAL
SYMBOL : USART_SR(GETCHAR)
LINK/LOCATE RUN COMPLETE, 3 ERRORS FOUND.
Error Code: 0x1

This is code I have used:

char _time [] = "15:15:00";
int hour, minute, second;
sscanf(_time, "%02d:%02d:%02d", &hour, &minute, &second);

Can You give me some points how to use sscanf?

+1
0
-1
June 2, 2014 - 5:30pm
Raisonance Support Team

Hello,

sscanf is using the getchar protocol,

FULLB_SCI, USART_DR and USART_SR are objects which are managed by the SCI name (ride7-> local settings -> Advanced ST7/STm8 options -> Processor).
Could you provide us the name of the STM8 device you are using and the SCI name associated to this one?

You can also try, as workaround, to add to your project :

char getchar () {}

Best regards,