Using Thermistor but pow() and log() functions inaccessible.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RiAs_1660756
Level 4
Level 4
25 sign-ins 25 replies posted 10 replies posted

I am using PSoC Creator 3.3 CP2 (3.3.0.7343) on Win 7.  My chip is a CY8C4125PVI-482 and I want to use the Thermistor calculator.  

   

Building fails with the following messages:

   

M0120 Build error: undefined reference to `log'

   

M0120 Build error: undefined reference to `pow'

   

M0120 Build error: The command 'arm-none-eabi-gcc.exe' failed with exit code '1'.

   

I have created a new project with only the thermistor with no optimisations.  The code is:

   
#include <project.h>  int main() {     uint32 resistance = 5000;          CyGlobalIntEnable; /* Enable global interrupts. */      for(;;)     {         My_Nice_Thermistor_GetTemperature(resistance);         resistance++;         if(resistance > 300000)             resistance = 5000;     } }
   

I've tried 'include'ing <math.h> but that isn't it.  I guess there's a library missing; but what one?!

   

If I download the sample for CY8C3866AXI-040 (CE95381) it builds fine.  But that's 8051 not ARM so doesn't help me much.

   

All help received with pathetic gratitude by PSoC newcomer.

   

- Richard.

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the forum, Richard!

   

In Creator go to Project -> Build Settings -> Linker -> General

   

Add "m" (without the quotes) into Additional Libraries. This will add the math library "Libm.a" to your project.

   

 

   

Happy coding

   

Bob

View solution in original post

0 Likes
5 Replies