cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

jepaz
New Contributor II

My application involves two separate status registry blocks one of them is working perfectly, I cant manage to make the other one work I keep getting the error:

   

undefined reference as if it was not declared at all. 

   

I compared both Stat.Reg files and noticed the one that gives the error is greyed out after the if #if !defined( block

   

not sure what can be done about this

   

the build report says I still have one more status registry free to use.

   

the only command I am using is Read();

   

 

   

thanks for the help

0 Likes
1 Solution
JoMe_264151
Expert II

There is a message right before the error. "Unused parts have been optimized out..." This is exactly what has happened: yout LUTb does not deliver different values, so it has been optimized out, leaving the status register without any input. So the status register "EndsReg" was optimized-out too. Fill some values into LUTb and all is well.

   

 

   

Bob

View solution in original post

0 Likes
6 Replies
JoMe_264151
Expert II

All we could do is guessing. Can you please post your complete project or a shortened version that shows the error so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes
JoMe_264151
Expert II

I downloaded your project and successfully compiled it with 78% usage of flash memory. Setting the build configuration from "Debug" to "Release" compiled using 56% flash.

   

I realized that some of your components are a bit old. I'm using Creator 4.0 SP1 and could update your components to latest version.

   

I am not sure what the error on your side might be.

   

 

   

Bob

0 Likes
jepaz
New Contributor II

sorry I had erased the error line of code I was calling the endstop=endsReg_Read(); command inside the infinite for loop on the main block

0 Likes
JoMe_264151
Expert II

So can you upload again the non-working project?

   

 

   

Bob

0 Likes
JoMe_264151
Expert II

There is a message right before the error. "Unused parts have been optimized out..." This is exactly what has happened: yout LUTb does not deliver different values, so it has been optimized out, leaving the status register without any input. So the status register "EndsReg" was optimized-out too. Fill some values into LUTb and all is well.

   

 

   

Bob

View solution in original post

0 Likes
jepaz
New Contributor II

Thank You Bob,

   

I appreciate it

0 Likes