Forum Discussion
NIOS II - UART scanf limitation
Hi,
First of all the scanf() family of routines is supported in the Normal C but NOT in the Small C library, so please make sure to use the normal C library. Using the execute in place on an EPCS16 may cause some delay, I do suspect the delay to be the cause but there is no evidence. Any way can you please re-write it as the following and see the result? getting a string should be more efficient.
#include <stdio.h>
int main()
{
char RX[8];
scanf("%s", &RX);
}- ASeif6 years ago
New Contributor
Thanks you for sharing your opinion.
Yes, normal C is used here.
scanf with string also was not working. But for sake of curiosity, would you please explain why string is more efficient than character?
BTW, an important note is that serial communication sends out a binary value in each bytes in packet. Therefore, working with string maybe have some problems because of unwanted termination.