Arm Mbed OS support forum

STM32F767B DCMI DMA bug

Hi Mbed Community,

I interfaced OV5640 camera to STM32F7 based board, i am getting captured data in STMCubeMx IDE, DMA and DCMI interrupt handlers are calling without any hang throughout execution.

following is the cubeMX debug log,

File:…/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dcmi.c, Func: HAL_DCMI_Stop, Line:470
File:…/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dma.c, Func: HAL_DMA_Abort, Line:526
File:…/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dma.c, Func: HAL_DMA_DeInit, Line:315
File:…/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dma.c, Func: HAL_DMA_Init, Line:174
File:…/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dcmi.c, Func: HAL_DCMI_Start_DMA, Line:380
File:…/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dma.c, Func: HAL_DMA_Start_IT, Line:461
File:…/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dcmi.c, Func: HAL_DCMI_IRQHandler, Line:601
File:…/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dcmi.c, Func: HAL_DCMI_IRQHandler, Line:601
File:…/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dcmi.c, Func: HAL_DCMI_IRQHandler, Line:601
File:…/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dma.c, Func: HAL_DMA_Abort_IT, Line:595
File:…/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dcmi.c, Func: HAL_DCMI_Stop, Line:470
File:…/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dma.c, Func: HAL_DMA_Abort, Line:526
Processing BMP image
BMP Image process done (Image Res is 320 x 240)
424d3684030000000000360000002800000040010000f0000000010018000000000000000000c40e0000c40e00000000000000000000b5b6bdb5b6bdbdb6bdb5b6bdbdb2bdbdb2bdbdb2bdbdb2bdb5b2c5bdb6c5bdb2bdbdb2bdbdb2bdbdb2bdb5b2bdb5b2bdb5b2bdb5b2bdb5b2bdb5b2bdbdb2b5bdb2b5bdb2b5bdb2b5bdb2b5bdb2b5bdb2b5bdb2b5bdb2bdb5aeb5bdaabdbd

when i am trying same systemclock, DCMI and DMA configuration in MBED os 6.11.0, getting following error during the execution.

++ MbedOS Error Info ++
Error Status: 0x80010133 Code: 307 Module: 1
Error Message: Mutex: 0x20002E8C, Not allowed in ISR context
Location: 0x801087D
Error Value: 0x20002E8C
***Current Thread: main Id: 0x20003ED8 Entry: 0x800D739 StackSize: 0x1000 StackMem: 0x20001E10 SP: 0x2007FF2C ***
For more info, visit: mbedos-error
– MbedOS Error Info –

kindly support

Hello Shekar,

Open the stm32F7xx_it.c file in your program (created by the STM32CubeIDE) and comment out the IRQ handlers

  • from HardFault_Handler(void)
  • to SysTick_Handler(void) ,
    which are implemented also by the Mbed system software

as explained also here.

Hello Zoltan Hudak,

Thank you for your quick response, as i am aware of all the above handlers are part of Mbed os, I did not include handlers from STM32CubeIDE program. I checked once again, there are no such functions included, except below handlers,

void DCMI_IRQHandler(void)
{
HAL_DCMI_IRQHandler(&hdcmi);
}
void DMA2_Stream1_IRQHandler(void)
{
HAL_DMA_IRQHandler(&hdma_dcmi);
}

how to handle error below:

++ MbedOS Error Info ++
Error Status: 0x80010133 Code: 307 Module: 1
Error Message: Mutex: 0x20002E8C, Not allowed in ISR context
Location: 0x80106B5
Error Value: 0x20002E8C
Current Thread: rtx_idle Id: 0x20003E50 Entry: 0x800DB89 StackSize: 0x380 Stack
For more info, visit: mbedos-error
– MbedOS Error Info –

Need support from community

I have not checked the IRQ handlers, but they use some operation that is not allowed in the ISR context. This maybe a malloc or new or printf call.

Thanks Johannes
you are right, But handling ISR context in Mbed os is new to me, need support.