2024-03-27 09:48 AM
Hello,
I'm using STM32H750VBT
When I'm trying to use DMA for ADC data collection I'm experiencing MCU crush. Currently I know that issue happens when DMA fill half of defined buffer.
I'm using STM32CubeIDE and builded in CubeMX. To precize issue I used debug By SWD STLink. to be able run code step by step I desabled continuous conversion mode. Attaching my Cube MX ADC settings:
And DMA settings
After pre configured by CubeMX initiation I'm calling conversion by
HAL_ADC_Start_DMA(&hadc2, (uint32_t*)testDMA, 20);
And entering into while (1) loop where calling adc2 conversion
HAL_ADC_Start(&hadc2);
after every loop I checking testDMA[] buffer
and DMA cycle by cycle fills testDMA as well up to [8], but on testDMA[9] debugger shows errors and don't able to cintinue code running (example on attached screen)
I tried to change in HAL_ADC_Start_DMA(&hadc2, (uint32_t*)testDMA, 20); from 20 to any another value and issue happens on half of the defined buffer. array testDMA is big enough, in that case it's uint16_t testDMA [60];
Probably isue occurs because MCU can't call/execute interrupt
void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc)
I'm attaching full project. My cubeIDE version is 1.14.1
Please help me run my DMA which would fill my buffer fully and would run succesfully interrupt
void HAL_ADC_ConvCpltCallback
Solved! Go to Solution.
2024-03-30 06:05 AM - edited 2024-03-30 12:52 PM
After downgrade-ing from CubeIDE 1.14.0 to 1.8.0 and changing from firmware package H7 v1.11.2 to V1.11.0 everything works as should, so there is a bug in newer lib or MX pre-configurator.
2024-03-27 03:09 PM
I made temporrary solution, which allows by timer check buffer status and stop dma before it would reach half buffer, but it's very "buggy", if MCU would not turn off DMA in time application will crush :)
So if someone know how to fix normally DMA on H750 please let me know
2024-03-30 06:05 AM - edited 2024-03-30 12:52 PM
After downgrade-ing from CubeIDE 1.14.0 to 1.8.0 and changing from firmware package H7 v1.11.2 to V1.11.0 everything works as should, so there is a bug in newer lib or MX pre-configurator.