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.

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

17 REPLIES 17
AScha.3
Chief

....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; 

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

Hello @JS8 

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

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.

Hi, 

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

Hi,

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

Hello @JS8 ,

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

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.

Hi,

Here's the link to my project . I uploaded it via WeTransfer.com

Could you please compress the project (.7z) and attach it here in the community using drag and drop feature?

SofLit_0-1703165005023.png

 

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.

Sorry, I didn't see an option here to upload a file directly before.

Could you please change your system clock frequency to 48MHz instead of 8MHz as following and use PLL? 

SofLit_0-1703165835217.png

 

 Your ADC clock is coming from HSI which is 14MHz. So I suspect an issue on the ratio between the two frequencies.

 

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.