(MCU: STM32F407 [Discovery Board]), ChibiOS 2.6.1
Code: Select all
void adccb(ADCDriver *adcp, adcsample_t *buffer, size_t n)
{
(void) buffer; (void) n;
/* Note, only in the ADC_COMPLETE state because the ADC driver fires an
intermediate callback when the buffer is half full.*/
if (adcp->state == ADC_COMPLETE) {
chBSemSignal(&AdcSema);
}
}
Here is the GDB stacktrace:
Code: Select all
#0 port_halt () at ../../os/ports/GCC/ARMCMx/chcore.c:50
#1 0x08000a76 in chDbgPanic (msg=0x80049c8 "SV#4") at ../../os/kernel/src/chdebug.c:274
#2 0x080007aa in dbg_check_lock () at ../../os/kernel/src/chdebug.c:117
#3 0x080043fe in adccb (adcp=0x20000dfc, buffer=0x20000ef0, n=1) at main.c:79
#4 0x08002f5a in adc_lld_serve_rx_interrupt (adcp=0x20000dfc, flags=48)
at ../../os/hal/platforms/STM32F4xx/adc_lld.c:94
#5 0x0800278e in Vector130 () at ../../os/hal/platforms/STM32F4xx/stm32_dma.c:352
#6 <signal handler called>
#7 0x55555554 in ?? ()
#8 0x55555554 in ?? ()
The problem seems to be triggered by "dbg_isr_cnt".
Code: Select all
stm32_dma.c:352
CH_IRQ_PROLOGUE Makro
chdebug.c:162 dbg_check_enter_isr()
chdebug.c:167 dbg_isr_cnt++;
adc_lld.c:76 adc_lld_serve_rx_interrupt()
adc_lld.c:94 _adc_isr_full_code()
main.c:73 adccb()
main.c:79 chBSemSignal()
chSysLock() Makro
chsys.h:144 dbg_check_lock()
chdebug.c:114 dbg_check_lock()
chdebug.c:116 dbg_isr_cnt != 0 -> SV#4