2023-12-20 06:32 AM
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.
2023-12-20 06:55 AM
1. set "Reset behaviour" to "under reset" or software system reset .
2. is this checked , as in pic.below, in menu->debug config.->
2023-12-20 07:09 AM
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.
2023-12-20 07:36 AM
> 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.
2023-12-20 07:52 AM
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..?
2023-12-20 08:01 AM
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.
2023-12-20 08:24 AM
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?
2023-12-20 09:37 AM
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 ...)
2023-12-20 09:50 AM
I'm using version 1.13.2.
2023-12-20 09:59 AM - edited 2023-12-20 10:17 AM
nono - IDE 1.13.1 - i use.
but here:
->
(in IDE, in edit ioc -> CubeMX-> manage software packs ...) then you see this; + maybe try update or "down-date" .