Question
When MotionMC calls back to MotionMC_SaveCalInNVM, reading from the supplied pointer causes a Hard Fault.
My call back code looks like this:
char MotionMC_SaveCalInNVM(unsigned short int datasize, unsigned int *data)
{
// This function is called when a call to MothionMC_Initialize(sampletime,0) is made with
// data set to zero.
uint8_t i;
unsigned int *data_local;
data_local = data;
for(i = 0; i < datasize; i++)
{
otter_mag_cal_nvm[i] = *data_local;
data_local++;
}
return (char)0;
}...in debug, this code hard faults when the loop reaches 106. Far short of the st.com's MotionMC passed "datasize" of 184. The code has been tested to make sure the array otter_mag_cal_nvm[] is not at fault. For this testing the line "otter_mag_cal_nvm[0] = *data_local;" was used instead and the hard faults still occurred on the 106th iteration.
