Function Call problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Function Call problem

477 次查看
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 回复

469 次查看
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 项奖励
回复