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

Problems with CRC table

I have a C8051F340 cygnal processor and a section of code that does a CRC calculation. The calculation uses a 256 variable 16 bit integer thats initialized at compile time. Like this:
static const uint16_t fcstab[256] = { initialization values };

The code compiles, but locks up before it gets to main with this variable and its initialization. If i take out the initialization and leave the variable simply declared, the code runs fine.

I've tried pdata, and idata keywords, but it seems like the array is too large. Any ideas? Thanks.

Parents
  • static const uint16_t fcstab[256] = { initialization values };
    Guessing that your uint16_t does not include a memory area qualifier, you are "initializing" the registers, the stack and each and every DATA and IDAT variable.

    "initializing" the stack in the middle of the code WILL blow whatever you are doing.

    Erik

    PS why have you declared the toolset 'none' the F340 (at least regarding tools) is a '51.

Reply
  • static const uint16_t fcstab[256] = { initialization values };
    Guessing that your uint16_t does not include a memory area qualifier, you are "initializing" the registers, the stack and each and every DATA and IDAT variable.

    "initializing" the stack in the middle of the code WILL blow whatever you are doing.

    Erik

    PS why have you declared the toolset 'none' the F340 (at least regarding tools) is a '51.

Children
No data