Forum Discussion
Altera_Forum
Honored Contributor
10 years agoHello,
I have narrowed the problem down to a specific location in the newlib file vfprintf.c. At line 1987 there is a statement " _uquad /= 10;" at that point, if the processor executes this function with _uquad = 12, _uquad becomes null instead of 2, this is the culprit causing the second digit of the printf output to be wrong. The reason why is a mistery for me. If i try an integer divide in the main routine, it works perfectly and is executed in the hardware divider of the processor. The divide in the vfprintf.c was compiled to a software divide, when newlib was created. It is this routine that is not working properly (i think). I assume that recompiling newlib for my current configuration might be the solution but i have no clue how to do this. In the project makefile there is a section that starts with ifneq ($(COMPILE_NEWLIB),) i think i need to activate this section. But i a add COMPILE_NEWLIB 1 to the# symbols defined in the properties window of my project the newlib is not compiled. Could anybody tell me if 1) If compiling Newlib is the solution to my problem. 2) How to trigger the newlib compile in from eclipse (i am just a beginner) Thanks in advance for all the help I can get. John.