Question
Hard fault that happens only with debug, and using pause/start buttons
Hi,
i have an issue, where i implemented using DMA. The DMA works seemingly without issues, but when debugging and using the start/pause buttons, the hard fault happens.
Would the be a smart way to *simulate* a pause/start of a debug session??
EDIT:
I found out, that this issue only happens when the interrupt is activated:
volatile uint16_t adcArray[12]
void DMA1_Channel2_IRQHandler(){
ADC_TEST_2_ON
// Transfer complete
if( READ_BIT(DMA1->IFCR, DMA_IFCR_CTCIF2) ){
DMA1->IFCR |= (DMA_IFCR_CTCIF2); // Clear bit transfer complete
// tempFETBits = 0;
// battVoltBits = 0;
// throttleBits = 0;
// buttonSensBits = 0;
tempFETBits = adcArray[0];
ADC_TEST_2_OFF;
}
// Transfer error
if( READ_BIT(DMA1->IFCR, DMA_IFCR_CTEIF2) ){
DMA1->IFCR |= (DMA_IFCR_CTEIF2); // Clear bit
//TODO: save event
while(1);
}
ADC_TEST_2_OFF;
}
