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

strange initialization problem

I am using SPI communication between Analog device ADuC848 and some other chip. For this ADuC848 chip, I have a very strange initialization problem I am not sure if it relates to Keil or the chip itself.

I defined a struct like below
typedef struct { UINT8 cmdHeader; UINT8 cmdCRC; UINT8 outputmessage[SPIMESSAGE_SIZE]; UINT8 Num_Output_Byte; UINT8 Num_Input_Byte; SpiCode_T cmdType; BOOLEAN AccessToken; void (*cmdFunc)(void);
} SpiCmdStruct_T;

And then I initalize my cmd table like below
SpiCmdStruct_T cSpiCmdTbl[240] = {
{0, 0xac, "\0", 2, 0, SPI_QUERY, TRUE, NULL},
...
},

after I download the code to the chip, I found that in my cSpiCmdTbl only the first 112 (0x70) item match what I assigned. From item 113 to 239 (0x71 to 0xEF), all the values are totally wrong.

Anybody have an idea what is going on?

Thanks in advance.
DG

0