This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Value get changed in function arrgument (fixed memory location)

dear friend,

i have function fSaveData. which is called at depth of 5

void fSaveData( uint8x_t* ucArray, uint16x_t uiStartAddress, uint16x_t uiTotal_Bytes,uint8x_t ucResetFlag)

{

uint16x_t aa;
uint16x_t bb;
uint8x_t cc;
uint16x_t dd;
uint16x_t ee;
uint16x_t ee;
uint16x_t ff;
uint8_t gg[15]={0};

// code
//code

// withing that function i am calling one more function, depth of 6
fWrite2eeprom(ucArray,uiStartAddress,ucCummBytes,uiIndex,ucResetFlag);
//

}

as per http://www.keil.com/support/man/docs/c51/c51_le_funcparmsstack.htm
c51 had given fixed addred to each variable. but when i called function fWrite2eeprom
then my variable of function fSaveData get courrupts
this is happning frequently.

this may be case of stack overflow. but in every courrption i got same value in XRAM fixed location.

please help me on this! please ask if my question is not clear

yogesh

Parents
  • in my case function is only called in ISR, not in ground loop.

    see my interrupt

    in this interrupt function is fTimeinSec();//

    KISS, keep interrupts short and simple

    have your interrupt increment some variable and in main() use it and, correspondingly, decrement it

    how is gucOneMinuteCount defined? truly global, module local, local?

    it seems that with your construct fTimeinSec(); acn, just as well, be called in main

    Erik

Reply
  • in my case function is only called in ISR, not in ground loop.

    see my interrupt

    in this interrupt function is fTimeinSec();//

    KISS, keep interrupts short and simple

    have your interrupt increment some variable and in main() use it and, correspondingly, decrement it

    how is gucOneMinuteCount defined? truly global, module local, local?

    it seems that with your construct fTimeinSec(); acn, just as well, be called in main

    Erik

Children