cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC Creator & Designer Software

New Contributor II

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
Reply
1 Solution
Esteemed Contributor II

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
Reply
5 Replies
Esteemed Contributor II

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
Reply
Honored Contributor II

Richard,

   

as alternative you may also consider fast thermistor calculator, which was made for higher precision and speed than Cypress's stock component is providing:

   

http://www.cypress.com/forum/psoc-community-components/fast-thermistor-calculator

0 Likes
Reply
New Contributor II

Thank you Bob and Odissey1 for your suggestions.  It's nice to be back on the rails!

   

Oddly, adding the "m" didn't fix the original project but did fix my minimalist project.  I had to rebuild the project from scratch with the "m" added from the start.  Otherwise I got a different raft of compiler objections.

   

I'll look into Odissey1's work later as it's interesting and useful for another occasion.  This current project is just a toe-in-the-water exercise that is a thermal monitor to go in one of our products as an add-on.  It needs accuracy of about 2 degrees at best!  But it gives me a chance to get some practical experience with the PSoC goodies.

   

Once again, guys, many thanks for your assistance.

   

- Richard.

0 Likes
Reply
Esteemed Contributor II

You're always welcome, Richard.

   

 

   

Bob

0 Likes
Reply
Anonymous
Not applicable

Hi..i am a new user here. I was also looking for same thing and find the answer as given below, so you should follow this,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.

   

 

   

pcb assembly

0 Likes
Reply