Function Call problem

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Function Call problem

474件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by swisstronics on Wed Aug 10 03:13:15 MST 2011
When I call the function "CallFunction" from the main I add the pointer NANDElecSignature which points on location 0x10004010. In the CallFunc the received value for the pointer is 0x10004000 and the values are stored to wrong locations. This problem only exists with char pointer not with short or int pointers. Does anybody know this problem? I'm working with Keil MDK-ARM4.21 and the ULink debugger and the LPC1114/302.

#include "LPC11xx.h"                        /* LPC11xx definitions */
void CallFunc(unsigned char *hallo)
{
unsigned int gugus;
gugus = 0;
hallo[0] =gugus++;
hallo[1] =gugus++;
hallo[2] =gugus++;
hallo[3] =gugus++;
}

/* Main Program */
int main (void)
{
  unsigned char NANDElecSignature[8];

 
  SystemInit();
  CallFunc(NANDElecSignature);
  while(1)
  {
  }
}
0 件の賞賛
返信
1 返信

466件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Europe on Wed Jan 18 03:40:59 MST 2012
Hello, I have tested your example and could not reproduce the problem.
See the attached project. If the problem still occurs could you please add some screenshots that show the wrong content of NANDElecSignature?
0 件の賞賛
返信