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

Overcoming error 172???

Hi

When i type this,

struct cmd_pkt{
int type;
int OGF;
int OCF;
int len;
unsigned int far data_pkt[256];
};

struct cmd_pkt c_pkt;

After I complied it, it prompt me with this error.
Error 172: '?DT?BT_COMMAND': segment too bigt (act = 526, max = 128)

The maximum value that I can put before getting this error is 40.

What causes this error? Can this error be overcome?


When I tried this(meaning without the structure),

unsigned int far data_pkt[256]

it did not give me any error. Why?

I'm using the MCBx51 V2.1 Prototype Board with the 80251 chip..

Thanks in advance.

Parents Reply Children
  • Note that the point of a structure is that you can group elements one after another in memory all together. If you were able to specify different memory areas for each member, then the elements of the structure would not be placed in memory in order.

    Note that this is how and ANSI and ISO standards define the behavior of structs in C. Perhaps you should look at a good C programming book.

    Jon

  • By removing the 'far' it also did not help.

    When u say "You could make the whole structure 'far', but not just one member of it!" , do you mean that i do this:

    struct cmd_pkt {
    unsigned int far type;
    unsigned int far OGF;
    unsigned int far OCF;
    unsigned int far len;
    unsigned int far data_pkt[40];
    };

    Thanks..