Tool/software: Code Composer Studio
Hi,
I have created and instantiated the below structure in separate header file in my CCS application but when I try to assign a value to any of the structure elements I get bus fault, so what is the issue here.
HEADER FILE Contents:
struct CPUParameter {
unsigned char name[26];
unsigned char PN[27];
uint32_t BaudRate;
uint8_t DataBits;
uint8_t StopBits;
uint8_t Parity;
uint8_t ID;
struct IOModule *ioModule[MAX_NUM_MODULES];
};
struct CPUParameter *CPUPara;
C FILE contents
void CPU_RESETPRMTRS(){
CPUPara->CPUSWFALUT = 0;
unsigned char tempPN[27] = "1985SE-F24-SR01-F512-C03-24";
uint16_t i;
for(i = 0; i < sizeof(tempPN); i++){
CPUPara->PN[i] = tempPN[i];
}
for(i = 0; i < sizeof(CPUPara->name); i++){
// clear the old name
CPUPara->name[i] = ' ';
}
unsigned char tempName[26] = "controller";
for(i = 0; i < sizeof(tempName); i++){
CPUPara->name[i] = tempName[i];
}
}
