Skip to main content
Graduate
August 24, 2023
Question

ADC DMA Interrupt Not Working STM32L152

  • August 24, 2023
  • 5 replies
  • 8153 views

Hi, I am working on a project using STM32L152. I have ADC DMA set up as I've used in many other projects using this part. For some reason this time around ADC values are not getting ready by the micro, and when I debug I find the DMA1_Channel1_IRQHandler is not getting called, even though the interrupt is set in the .ioc as normal. 

Here is my .ioc configuration for ADC and interrupt priority, is there anything here that can suggest what the problem might be? I have cross referenced these settings with other working hardware projects and they are exactly the same as far as I can tell. Thanks!

Please see attached screenshots for .IOC settings.

    This topic has been closed for replies.

    5 replies

    EPala.2Author
    Graduate
    August 24, 2023

    In further debugging I find that the DMA interrupt runs twice, then reaches this ADC_DMAConvCplt function, then never runs again. Is there anything this behavior suggests is the cause of the error? All of this is automatically generated .IOC code so not something I have written or have a great understanding of.

    EPala.2Author
    Graduate
    August 28, 2023

    Bump

    Graduate II
    August 28, 2023

    Show code, show registers.

    DMA would expect HT and TC interrupts.

    Won't repeat unless in circular mode. Will stop if hardware faults or addresses wrong. Check for errors on DMA or ADC peripherals..

    If you have to Bump posts consider why. Is there sufficient detail to interest or diagnose?

    EPala.2Author
    Graduate
    August 31, 2023

    Hey, as I stated in the question, this is an issue with code being automatically generated by the .ioc. I didn't write any of it, so I don't know what information copying the automatically generated files would express that sharing my .ioc settings does not. Is there a particular piece of information / part of that code that would help y'all to diagnose this?

    Super User
    August 28, 2023

    Not enough info here to diagnose anything. The issue is likely with your code, not the CubeMX/IOC configuration and setup.

    EPala.2Author
    Graduate
    August 31, 2023

    This is code being automatically generated by the .ioc, so I don't know what sharing it would express that .ioc settings do not. Is there some particular part of the generated files that it would be helpful to see directly?

    EPala.2Author
    Graduate
    August 31, 2023

    Here is my main.c, stm32lxx_it.c, and stm32lxx_hal_dam.c. If there are any other files that would be helpful to share in diagnosing this please let me know and I will be happy to share them.


    EPala.2Author
    Graduate
    September 7, 2023

    Does the DMA startup look alright?