Question
STM32F Unexpected Hardfault cause by code not reached
Hi ! I'm working on a STM32F429VET, with keil as an IDE.
My problem is the next, this code which is NOT reached (because it need a command from the terminal to be). Make my entire program crash in contact of loop, causing an IACCVIOL if i let this part of the code commented, works fine if i uncomment it. Anybody have encounter similiar behavior ? I dont get it at all.
void adc_measure(uint16_t channel, uint8_t *result)
{
measureInProgress = true;
adc_init(channel);
HAL_TIM_Base_Start_IT(&htim2);
// while (measure_pending_count < NB_MEASURES)
// {
//
// adc_read();
// __disable_irq(); // Prevent race condition
// measure_pending_count++;
// __enable_irq();
//
// }
HAL_ADC_Stop(&hadc1);
float measure = adc_compute_value(channel); // convert the value toward needed unit (mA or V)
//snprintf((char *)result, RESULT_PRECISION, "%f", measure);
}
