HardFault Handler changing Clock Frequency
Good morning,
I am trying to read from adc two signals by first saving the signal with a certain clock frequency and then changing it using another one, i.e. changing the AHB clock divider. Going to debug it crashes on hard fault handler, regardless of the clock change but even trying to do two buffer reads and moving them to other variables it can't get into the second switch case. Any ideas? Thanks in advance
CODE
while (1)
{
u++;
switch(u)
{
case 1:
//SystemClock_ConfigDOWN();
for(i=0;i<ADC_BUF_SIZE/2;i++)
{
buf1[i] = (uint16_t)(adcBuf[i]&0x0000FFFF);
buf2[i] = (uint16_t)(adcBuf[i]>>16);
}
break;
case 2:
//SystemClock_ConfigUP();
for(i=0;i<ADC_BUF_SIZE/2;i++)
{
buf3[i] = (uint16_t)(adcBuf[i]&0x0000FFFF);
buf4[i] = (uint16_t)(adcBuf[i]>>16);
}
break;
default:
__NOP();
}
return 0;
}
