ARM Technical Support Knowledge Articles

POINTER ASSIGNMENT CRASHES IN THE CONTIGUOUS MODE

Applies to: C51 C Compiler

Answer


Information in this article applies to:


QUESTION

Pointer assignments (as shown below) crash the uVision debugger when using the DS80390 in the contiguous mode with either the LARGE or COMPACT memory models. However, it works fine in the small memory model. How do I resolve this problem?

typedef struct myStruct
{
  unsigned int a;
  unsigned char *pB;
} myStruct;

void myFunc(myStruct *c, unsigned int d, unsigned char *e)
{
  c->a = d;

  /* debugger crashes here */
  c->pB = e;
}

void main(void)
{
  myStruct m;
  unsigned char arr[10]="12345678";

  myFunc(&m, 1, &arr[1]);
  // in the debugger m.pB is the start address of the string "2345678"

  while(1);
}

ANSWER

This problem has been corrected in the latest C51 release. You may download the latest updates from http://www.keil.com/update/.

Article last edited on: 2004-04-15 12:19:22

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential