Function parameters allocated at same address

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

Function parameters allocated at same address

Jump to solution
813 Views
dordestojicevic
Contributor II

Hi everyone,

 

I have a problem with one function and function parameters. I am using:

- CodeWarrior for MCU

     Version: 10.6

     Build Id:140329

with Hearst Board with S12ZVC on it.

 

I have a function like this:

 

void detrend(uint16 *nfft, sint32 newelement, sint16 *timedata, sint32 average)

 

Problematic are nfft and timedata. To nfft I pass the address of single variable, to timedata I pass the beginning of an array.

 

nfft itself is always allocated in the address range of an array pointed by timedata.

 

The same thing occurs when I use regular function local variable instead of pointer for nfft, only then this local variable is allocated in the address range of the array pointed by timedata.

 

Any ideas?

 

Thanks

Labels (1)
1 Solution
742 Views
dordestojicevic
Contributor II

Hi Jennie,

meanwhile I figured it out. I was overflowing the memory.

How to find this out is to declare those global. Then during compiling you would get an error. If those are local, it would just overwrite not really noticing you about anything.

Would be a nice feature to have a warning for this.

View solution in original post

2 Replies
742 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

hi Dorde,

To investigate your problem correctly and efficiently, please provide us the follows:

1. demo project

2. how to reproduce your problem step by step with your demo project.

thanks for your cooperation!


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
743 Views
dordestojicevic
Contributor II

Hi Jennie,

meanwhile I figured it out. I was overflowing the memory.

How to find this out is to declare those global. Then during compiling you would get an error. If those are local, it would just overwrite not really noticing you about anything.

Would be a nice feature to have a warning for this.