Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers

SOPC builder

Altera_Forum
Honored Contributor II
867 Views

hi, my problem is that i'm trying to get floating point numbers in nios; i had done my program yesterday and it was succesfull when it generated, but in nios it was giving 0 when i wrote numbers with printf. 

that's why i found some documents today and i had changed my sopc builder's cpu settings with adding floating point hardware and check the division factor but nothing else and then i push generate button but it had failed 

 

Error: Failed to refresh PTF file 

 

and know all the sopc programs give the same error, and i can't do anything. could you say what can i do:confused:.
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
205 Views

Hi 

 

I've done programs with NIOS II with FP custom instructions and they've work fine. Remember that in order to use printf you have to use something like %4.2 (4 integer digits and 2 decimal). 

 

Try to create a new C/C++ application with the program and the PTF file generated.
0 Kudos
Altera_Forum
Honored Contributor II
205 Views

thanks to you. I will try it.

0 Kudos
Altera_Forum
Honored Contributor II
205 Views

 

--- Quote Start ---  

my problem is that i'm trying to get floating point numbers in nios; i had done my program yesterday and it was succesfull when it generated, but in nios it was giving 0 when i wrote numbers with printf. 

--- Quote End ---  

Double check that the "enable small c library" option is not selected in your BSP settings. The small C library does not including floating point support for printf.
0 Kudos
Reply