float printing error in PE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

float printing error in PE

Jump to solution
1,297 Views
syedidris
Contributor III

Hi ,

We are working on KL03 processor (with KDS 3.0.0). We learnt how to make processor expert code and just trying to make simple hello_world printing code. Its working fine but float value is not printing so we change the properties of code as per screenshot, then it is showing some errors,

Our project code is as per the attachment.

Please guide how to print float value in PE code.

Original Attachment has been moved to: print.zip

Labels (1)
1 Solution
987 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

David's demo is great. just for supplement, with PE+KSDK, to print floating number,  make sure to have floating enabled in preprocessor.

pastedImage_0.png


Have a great day,
Jennie Zhang


-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

8 Replies
987 Views
syedidris
Contributor III

Thanks to DavidS​ and ZhangJennie

Now its working,:smileyhappy:

0 Kudos
987 Views
syedidris
Contributor III

DavidS​ plz, can you suggest any solution?

0 Kudos
988 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

David's demo is great. just for supplement, with PE+KSDK, to print floating number,  make sure to have floating enabled in preprocessor.

pastedImage_0.png


Have a great day,
Jennie Zhang


-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

988 Views
DavidS
NXP Employee
NXP Employee

Hi Syed,

Something was not right with your project and I couldn't easily get it working and am short on time.

Attached is my FRDM-KL03 KDS_3.0+KSDK_1.3+PE and setup to do floating point.

Please review the project Properties and code to how I have it working.

Regards,

David

0 Kudos
988 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

I ever made video of how to how to use printf to print floating value in KDS3.0

see attached.

can this help you?


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
988 Views
syedidris
Contributor III

Zhang,

we tried your method but still It's giving the error.

float error.PNGfloat error2.PNG

0 Kudos
988 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello syed,

To use printf() with floating point, the option "-u _printf_float" needs to be added to the linker options,

about the detail information please refer to here :

printf() and scanf() with GNU ARM Libraries | MCU on Eclipse

Hope it helps

Alice

0 Kudos
988 Views
syedidris
Contributor III

Hi Alice,

thanks for your reply.

I added "-u _printf_float" in properties of our project, but it's not working as you can see in my project code.

0 Kudos