cancel
Showing results for 
Search instead for 
Did you mean: 

Could not halt device (19)

JS8
Associate III

Hi,

I am trying to program STM32F030C8T6 with STM32CubeIDE. When I try to upload the code, it says the download was successful but then it fails to halt the device. I have tried setting "Reset behaviour" to "None" as other posts have suggested, but that only results to me getting another error with an unknown reason and it telling me to check power and cabling. I have done so, 5 times already and I have measured every part of the circuit with my multimeter. Everything is connected. What I find weird is that a week ago it was working fine. Only as I expanded the firmware by an order of magnitude, it stopped working.  What could I do to get rid of this error?

Best regards,

Juhani

 

-------------------------------------------------------------------

STM32CubeProgrammer v2.14.0

-------------------------------------------------------------------

 

 

 

Log output file: C:\Users\Juhani\AppData\Local\Temp\STM32CubeProgrammer_a12652.log

ST-LINK SN : 38FF6B06304E4B3038591243

ST-LINK FW : V2J42S7

Board : --

Voltage : 3.17V

SWD freq : 4000 KHz

Connect mode: Under Reset

Reset mode : Hardware reset

Device ID : 0x440

Revision ID : Rev 2.0

Device name : STM32F05x/F030x8

Flash size : 64 KBytes

Device type : MCU

Device CPU : Cortex-M0

BL Version : 0x21

 

 

 

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_a12652.srec

File : ST-LINK_GDB_server_a12652.srec

Size : 13.38 KB

Address : 0x08000000

 

 

Erasing memory corresponding to segment 0:

Erasing internal memory sectors [0 13]

Download in Progress:

 

 

File download complete

Time elapsed during download operation: 00:00:00.947

 

 

 

Verifying ...

 

 

 

 

Download verified successfully

 

 

Could not halt device (19)

Target is not responding, retrying...

Target is not responding, retrying...

Shutting down...

Target is not responding, retrying...

Target is not responding, retrying...

Failed to read register cache

Target is not responding, retrying...

Target is not responding, retrying...

 

After this the LED on the ST-LINK/V2 lights up orange, which I know means communication failed.

 

 

9 REPLIES 9
AScha.3
Principal III

1. set  "Reset behaviour" to "under reset" or software system reset .

2. is this checked , as in pic.below,  in menu->debug config.->

AScha3_0-1703084147044.png

 

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

Hi, 

Reset behaviour is already set to "Connect under reset".

I am not sure what you mean by "this", but all seems to match with my settings in your image.

Thanks for the response.

AScha.3
Principal III

> what you mean by "this"

= everything , thats checked. 🙂

ok, so it not stops after download at main ?

You have another F030 to compare ? 

Maybe is damaged, because you wrote: it was working before - before "what" ?

Now try to make a new (empty or small) project and try to debug this, then we see, is chip still ok or not.

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

I created another project which just blinks an LED and it works. Somehow my bigger project doesn't, even though their settings are the same..?

AScha.3
Principal III

Now we know: your chip and debug probe and IDE is ok. 

To find out, whats wrong with your bigger project, i would do it this way:

- make new project with needed periph. as in big project, gen. code and check: debug working?

- copy there some part of big project source, that can compile without errors, then test and check: debug working?

This way it should be no problem, to find out, where the problem is coming from.

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

It seems the problem is not my code. I enabled different peripherals of my big project in my small project at a time in CubeMX, and noticed that when ADC is enabled, it gives the error, but when it's disabled, everything works. The problem is being caused by just the fact that ADC is enabled, even when it is not even in use. What could be causing this?

AScha.3
Principal III

I have no idea - this "cannot be". (+ i could try - i have a F030F4P here )

BUT afair i never had any problem, even with ADC in use.

Maybe an error in Cube ... which version you use ? (i used 1.11.3)

(in IDE, ioc -> CubeMX-> mange software packs ...)

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

I'm using version 1.13.2.

AScha.3
Principal III

nono - IDE 1.13.1 - i use.

but here:

AScha3_0-1703096252943.png

->

 

AScha3_0-1703095082287.png

(in IDE, in edit ioc -> CubeMX-> manage software packs ...) then you see this; + maybe try update or "down-date" .

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