Hello,
I try to print double max value (DBL_MAX) on uart and I have hardfault interrupt.
I use newlib-nano with flag -u _printf_float.
I have the same issue with standard libc.
If I print "small" double, it works.
I use kds3.0 with gcc 4.8.
My targer is kl46z on freedom board.
Do you have any idea why it doesn't work ?
Thanks in advance,
Jeremy
Hello Alice,
Yes, your example meet my requirement.
I am using cortex m0+ and you seem test on cortex m4 (k22). Am I wrong ?
CM0+ doesn't have fpu, maybe something is wrong with link option ?
My link option are :
arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -O3 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -T "../MKL46Z256xxx4_flash.ld" -Xlinker --gc-sections -Wl,-Map,"FreedomKL46Z.map" --specs=nano.specs -u _printf_float -specs=nosys.specs -Xlinker -z -Xlinker muldefs -o "FreedomKL46Z.elf" -Wl,--start-group [*.o files] -lc -lgcc -Wl,--end-group -Lm
Thanks for your help,
Jeremy
Hello Jeremy,
I also use the board of FRDM-KL46.
Please add -specs=rdimon.specs into linker flag :
I also attached my project , you can test on your side .
Hope it helps
Have a great day,
Alice Yang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Jeremy,
Could you please show your code for print, for sorry i don't know
what's the "double max value" and "small" double .
BR
Alice
Hello Alice,
I try to print value with this line :
double doubleValue = DBL_MAX;
printf("doubleValue : %.16lE - %.16lf\n", doubleValue, doubleValue);
When I say "small" double, I mean doubleValue = 1.825 for example.
Double maximum value is DBL_MAX from float.h.
Jeremy
Hello Jeremy,
Sorry i do not know what do you want to do , i test on my side ,the result is that :
Does it can meet your requirement ?
If not , please describe it to me what the result you want to .
If yes, i will tell you how to configure on KDS .
BR
Alice