HardFault_Handler, SIGTRAP trace/breakpoint trap
Hello everyone!
I am trying to read sensor data from an FSR402 using a STM32WB55CG in DMA with a temperature sensor as well.
For now I am mostly focusing on the FSR to also make the conversion from voltage to newtons.
After implementing the code for the conversion the programmed stopped working saying this:
Program received signal SIGTRAP, Trace/breakpoint trap.
HardFault_Handler () at ../Core/Src/stm32wbxx_it.c:84
84 {I really don't know how to deal with all of this. I have already read something about the GDB server which I have never used as this would be my first time doing this type of project. However I notice that for the GDB I would need some connector that I do not have.
I will also attach a photo of my code where I am doing the conversion for the sensor.
/* USER CODE BEGIN 0 */
uint32_t ADC_BUFF[2], val[2], temperature, fsrResistance, fsrConductance, fsrForce;
float vsense = 3.3/4096;
float resistor = 10000;
float voltageIN = 3300;
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc){
for(int i =0; i<2; i++){
val[i] = ADC_BUFF[i];
}
temperature = ((ADC_BUFF[1] * vsense - 0.76)/ 0.0025) + 25;
fsrResistance = ((voltageIN - ADC_BUFF[0])*resistor)/ADC_BUFF[0]; // Ohms
fsrConductance = 1000000/fsrResistance; //microOhms
if(fsrConductance <= 1000){
fsrForce = fsrConductance/80;
} else{
fsrForce = fsrConductance - 1000;
fsrForce /= 30;
}
HAL_Delay(1000); // DELAY OF 1 SECOND
}
/* USER CODE END 0 */If you guys had any idea how I could solve this, I would be really grateful!
