cancel
Showing results for 
Search instead for 
Did you mean: 

ADC making code not upload correctly

JS8
Senior

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.

17 REPLIES 17

The error still persists.

Hi,

I made the changes as suggested by your image, however the same error ("Could not halt device (19)") still pops up into the prompt when ADC is enabled.

Could you please tell which board you are using?

I will try to reproduce the behavior when I have one of STM32F030xx boards.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

I am using STM32F030C8T6 microcontroller.

TDK
Guru

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

 

If you feel a post has answered your question, please click "Accept as Solution".

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.

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.

If you feel a post has answered your question, please click "Accept as Solution".

Hi,

Thanks for your help. Unfortunately the pins next to VDDA are also in use in my project. I tried this before with no luck.

Best regards, 

Juhani