float printing error in PE

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

float printing error in PE

跳至解决方案
6,544 次查看
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

标签 (1)
1 解答
6,234 次查看
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!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

8 回复数
6,234 次查看
syedidris
Contributor III

Thanks to DavidS​ and ZhangJennie

Now its working,:smileyhappy:

0 项奖励
回复
6,234 次查看
syedidris
Contributor III

DavidS​ plz, can you suggest any solution?

0 项奖励
回复
6,235 次查看
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!
-----------------------------------------------------------------------------------------------------------------------

6,235 次查看
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 项奖励
回复
6,235 次查看
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 项奖励
回复
6,235 次查看
syedidris
Contributor III

Zhang,

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

float error.PNGfloat error2.PNG

0 项奖励
回复
6,235 次查看
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 项奖励
回复
6,235 次查看
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 项奖励
回复