Forum Discussion
ETang2
Occasional Contributor
4 months agoNiosV and juart-terminal
I had a project which works fine under niosII. I upgrade all the project with niosv and all seems fine except printing values in juart-terminal. Here is the main code : #include <stdio.h> #inclu...
- 4 months ago
Summary:
- printf(%f) always prints 0, even if the variable contains valid floating-point number.
Change the On-Chip Ram size from decimal (such as 167.5KB / 167500 bytes) to binary (such as 167KiB / 171008 bytes). - Character é is printed wrongly.
Change the active code page of Windows's command prompt from 437 to 65001 (UTF-8)
- printf(%f) always prints 0, even if the variable contains valid floating-point number.
LiangYuG_Altera
Contributor
4 months agoHi ETang2
Changing the code page solve the accentuated problem.
Good to hear that.
I had the code line you proposed but i'm not sure to understand the result.
My objective is to see whether this issue is only affecting printf(%f). On laymen's terms, your situation is akin to can use the raw data for calculation, just cannot printf(%f).
- Since the debugger shows a valid floating-point number, that means the raw data inside OCRAM/EMIF is intact.
- With your latest results, the raw data when perform printf(%ld) proves this point.
- However, I am not expecting the long invalid floating point number from "Concentration de CO2".
My suspect is on the software side.
- Can you export your BSP settings as a Tcl script, and share it here? I wish to review the your BSP setting, and see if I can make my working example to fail as yours.
- Can you try my example hello.c? Simplify away the I2C transaction to a immediate value, how will your system react?
Regards,
Liang Yu