Forum Discussion
Altera_Forum
Honored Contributor
15 years agoSOPC builder
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:.3 Replies
- Altera_Forum
Honored Contributor
--- 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. - Altera_Forum
Honored Contributor
thanks to you. I will try it.
- Altera_Forum
Honored Contributor
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.