How do I use log10 in the 1246 project

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

How do I use log10 in the 1246 project

3,379 Views
Tome-mbedded
Contributor II

Tomembedded_0-1712492738077.png

In obtaining the value of illumination, it needs to obtain the measured value by logarithm. But I write it this way, but the compilation error.The header file math.h is already included

Tomembedded_1-1712492948636.png

Tomembedded_2-1712492987115.pngTomembedded_3-1712493019206.png

Tomembedded_4-1712493087847.png

 

How do I solve this problem?

 

 

0 Kudos
Reply
11 Replies

3,338 Views
nxf77486
NXP TechSupport
NXP TechSupport

Hello,

 

Thank you for contacting NXP support.

Can you please help me with some extra details:

  1. What is the NXP product you are using?
  2. What SDK version are you using?

In the meantime I can suggest some steps in order to solve this

Can you please try to fix the parser

nxf77486_0-1712609174444.png

 

And please let me know if this help you out with this problem.

0 Kudos
Reply

3,316 Views
Tome-mbedded
Contributor II

hi nxf77486

Thank you for your reply

I'm using nxp's JN5189 chip.

The IDE version is MCUXpressoIDE_11.8.0_1165

The SDK Version used is Release Version:2.6.12 JN5189DK6)

The routine I use is JN-AN-1246

I tried to fix the parser the way you said. After the repair is complete, recompile and report the same error. Is there any other way to solve this problem?

 

0 Kudos
Reply

3,278 Views
nxf77486
NXP TechSupport
NXP TechSupport

Hello,

Can you please help me to add the following compilation flag  "-lm".

And please let me know if this help solve you issue.

0 Kudos
Reply

3,252 Views
Tome-mbedded
Contributor II

hi, 

Where to add this compilation flag?

I added in the following position, but the compiler reported the same error

Tomembedded_0-1712833512529.png

Tomembedded_0-1712833646378.png

 

 

0 Kudos
Reply

3,231 Views
nxf77486
NXP TechSupport
NXP TechSupport

Hello,

 

Sure, can you please add the compilation flag on the following location, and please let me know the results.

nxf77486_0-1712856211471.png

 

0 Kudos
Reply

3,108 Views
Tome-mbedded
Contributor II

hi ,

My IDE cannot find this option, what should I do?

Tomembedded_0-1713320358487.png

 

0 Kudos
Reply

3,083 Views
nxf77486
NXP TechSupport
NXP TechSupport

Hello,

 

Ok, I understand this, can you please help me updating your MCUXpresso IDE this could be the cause why you probably do not see this option.

0 Kudos
Reply

2,963 Views
Tome-mbedded
Contributor II

hello,

I updated the IDE version, but I couldn't find this option, and the compiler still reported the same error. How else can we solve this problem?

Tomembedded_0-1713886024913.png

Tomembedded_1-1713886094206.png

 

 

0 Kudos
Reply

2,955 Views
nxf77486
NXP TechSupport
NXP TechSupport

Hello,

Thank you for the change on the MCUXpresso IDE.

I understand that the view is different, but in this ZigBee example can you please help me by opening the C/C++ General and go to Formatter view you should see something similar as the image attached, please click on Enable project specific setting and then Apply an close.

Please let me know if this worked.

nxf77486_0-1713894409395.png

 

0 Kudos
Reply

2,869 Views
Tome-mbedded
Contributor II

thank you,

I followed your steps, but the compiler reported the same error

Tomembedded_0-1714114797773.png

Tomembedded_1-1714114918204.png

You can use JN1246 routine, call the log function, can compile through?

Look forward to your reply.

 

0 Kudos
Reply

2,782 Views
nxf77486
NXP TechSupport
NXP TechSupport

Hello,

After reviewing this on further detail. It is possible that you can create your own library and add there the log10 function? This because this seem to not been defined on the block.

As far as I understand you created your own function to obtain the value of illumination. So in this case will be required to use an alternative due to the restrictions on the project.

0 Kudos
Reply