Skip to main content
Visitor II
December 21, 2023
Solved

ADC making code not upload correctly

  • December 21, 2023
  • 3 replies
  • 3522 views

Hi, 

I'm programming an STM32F030C8T6 MCU. When I attempt to upload my code, it gives me an error: "Could not halt device (19)". I noticed that this only happens when ADC is enabled from CubeMX. When I disable it, everything works fine. The code doesn't even use it. It is only when I have enabled ADC in the .ioc file in my project directory in STM32CubeIDE. I need ADC for my project. What could be causing this and how can I fix it?

Thanks.

    This topic has been closed for replies.
    Best answer by JS8

    Hi,

    I noticed now that VDDA is connected to VDD in my schematic, but I had not connected it in the PCB design. This is definitely the cause of the problem. How could I resolve it without ordering another one? Also the pins are so small that I doubt I will have any luck soldering them together.

    Thanks.

    3 replies

    Super User
    December 21, 2023

    ....coming from :

    https://community.st.com/t5/stm32-mcus-products/could-not-halt-device-19/td-p/621800

     

    Did you try to up- or down- grade the software pack:

    -> 

    AScha3_0-1703162074787.png

     

    ->

     

    AScha3_1-1703162074805.png

     

    (in IDE, in edit ioc -> CubeMX-> manage software packs ...) then you see this; 

    JS8Author
    Visitor II
    December 21, 2023

    Hi, 

    I removed the most recent install and installed the previous software pack. Didn't work, sadly.

    Technical Moderator
    December 21, 2023

    Hello @JS8 

    Is there any warning in CubeMx when you enable the ADC?

    JS8Author
    Visitor II
    December 21, 2023

    Hi,

    I don't see any warnings. Where would these typically appear?

    Technical Moderator
    December 21, 2023

    Hello @JS8 ,

    Could you please send your project including your .ioc file?

    Super User
    December 21, 2023

    Is this a custom board? Perhaps an error in the design/schematic. How is VDDA connected? Can you provide the schematic?

     

    JS8AuthorAnswer
    Visitor II
    December 21, 2023

    Hi,

    I noticed now that VDDA is connected to VDD in my schematic, but I had not connected it in the PCB design. This is definitely the cause of the problem. How could I resolve it without ordering another one? Also the pins are so small that I doubt I will have any luck soldering them together.

    Thanks.

    Super User
    December 21, 2023

    Depending on the layout, you can solder multiple pins together to make the connection. For example, solder all of VDDA, PA0, PA1 in a solder bridge to make the VDDA pin effectively bigger, then bridge it with a wire to VDD. Going to be challenging with hobby soldering tools, but possibly doable.

    But yeah, that's your problem VDDA being left unconnected is the issue causing the error you're seeing.

    > I noticed now that VDDA is connected to VDD in my schematic, but I had not connected it in the PCB design.

    Design software should have checks to ensure this doesn't happen, but you do need to remember to run them. We all make mistakes, good luck.