Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
All support for Intel NUC 7 - 13 systems has transitioned to ASUS. Read latest update.
16489 Discussions

Issues with scanf function


Hi there, I am trying to implement the remote update program with the 10M50 DECA board. I follow AN741, except Nios II processor application executes in-place from Altera On-chip Flash (UFM) instead of from QSPI. I follow AN730. I have enough onchip memory to run the program but when I run the remote update program my terminal doesn't show anything. First line in the code is


printf("Hello from Nios II!\n");


I don't even see that printed. I removed all the code and only have printf and scanf functions and realized nothing works when scanf is in the program. If I remove scanf, the terminal shows Hello from Nios II and the program can run except I need scanf to select. I do not have small c library or reduced device drivers enabled. None of those are checked in the bsp editor.


I started trying to replace scanf with alt_getchar to test to make sure sending from PC to board can work and alt_getchar does work. I can send characters and see it on the terminal. I started trying to replace alt_getchar but got stuck at


scanf("%2x%2x%2x%2x",&receivedHex[0],&receivedHex[1],&receivedHex[2],&receivedHex[3]); /*Get 4 bytes from UART Terminal*/

since I don't know if the send file function for the Remote Update Terminal.exe Altera provides sends the rpd file in hex ascii or binary. I rather not change the scanf to alt_getchar but I can't seem to even get the printf string to show up in my terminal if scanf is found anywhere in the program. Very confused at the moment. Any help would be much appreciated. Thanks for your help in advance


0 Kudos
1 Reply

I just tested the same steps on the 10M08SAE144 Evaulation kit and scanf does not seem to work when I have the Nios II processor application executed from Altera On chip Flash (UFM). Any help would be much appreciated!! All the small c library and optimization is turned off.

0 Kudos