We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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.
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.