2020-07-12 10:01 AM
Hello,
if I try to download my program from STM32CubeIDE, the following will happen:
STMicroelectronics ST-LINK GDB server. Version 5.2.3
Copyright (c) 2019, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
LogFile Name : C:\Users\ProBook\Documents\Electronik\Projekte\IR-remote-switch\software\Debug\st-link_gdbserver_log.txt
Logging Level : 31
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Enabled
SWD Debug : Enabled
Hardware watchpoint supported by the target
SWD frequency = 4000 kHz
ST-LINK Firmware version : V2J34S7
Device ID: 0x444
PC: 0x8001748
ST-LINK device status: HALT_MODE
ST-LINK detects target voltage = 3.24 V
ST-LINK device status: HALT_MODE
ST-LINK device initialization OK
Waiting for debugger connection...
Waiting for connection on port 61234...
Accepted connection on port 61234...
Debugger connected
Enter STM32_AppReset() function
NVIC_DFSR_REG = 0x0000000B
XPSR = 0xC1000000
------ Switching to STM32CubeProgrammer -----
-------------------------------------------------------------------
STM32CubeProgrammer v2.1.0
-------------------------------------------------------------------
Log output file: C:\Users\ProBook\AppData\Local\Temp\STM32CubeProgrammer_a28748.log
ST-LINK SN : 55FF6A066570564839442187
ST-LINK FW : V2J34S7
Voltage : 3.24V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x444
Device name : STM32F03x
Flash size : 16 KBytes
Device type : MCU
Device CPU : Cortex-M0
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a28748.srec
File : ST-LINK_GDB_server_a28748.srec
Size : 6152 Bytes
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 6]
Download in Progress:
�������������������������������������������������� 0%
�������� 16%�������� 33%�������� 49%��������� 66%�������� 83%�������� 99%� 100%
File download complete
Time elapsed during download operation: 00:00:00.698
Verifying ...
Read progress:
�������������������������������������������������� 50%
�������� 16%�������� 33%�������� 49%��������� 66%�������� 83%�������� 99%� 100%
Error: Data mismatch found at address 0x08001800 (byte = 0x00 instead of 0x31)
Error: Download verification failed
Encountered Error when opening C:\Program Files\STM32CubeIDE_1.0.2\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.0.0.201904021149\tools\bin\STM32_Programmer_CLI.exe
------ Switching context -----
Hardware watchpoint supported by the target
SWD frequency = 4000 kHz
ST-LINK Firmware version : V2J34S7
Device ID: 0x444
PC: 0x8001748
ST-LINK detects target voltage = 3.24 V
ST-LINK device status: HALT_MODE
ST-LINK device initialization OK
Error in STM32CubeProgrammer
handle_vCont_c, continue thread
ST-LINK device status: RUN_MODE
As you can see in Line 76, there is an error during verification.
At Address 0x08001800 was read back wrong data (this is nearly the end of written data).
This results in a hardfault when the controller starts.
If I use the ST-Link Tool and read out the Flash of the controller and compare it with the corresponding hex-file, I see that there is really a missmatch of data at this Address:
This is the content of flash after download:
And this is what in the HEX-file stands:
As you can see, the data at 0x08001800 - 0x08001807 are wrong.
The complete rest of flash content is correct.
If I try to download the HEX-file with ST-Link tool, it will be download successfully and the bytes at this address are all correct.
The Question is: Why the last bytes are written always wrong when I download via STM32CubeIDE? (Its not random, its always the same Address with the same wrong data)
I don't understand what is going wrong...?
Hopefully someone can help me.
Used Version is:
STM32CubeIDE
Version: 1.0.2
Build: 3566_20190716-0927 (UTC)
gdbServer-log file attached.
2020-07-12 11:20 AM
Not sure it'll solve it, but the latest STM32CubeIDE version is v1.3.1, quite a bit newer (and better) than what you're running. No doubt STM32CubeProgrammer has been updated since then as well. Might be worth updating to see if that solves it.
The values 0x20001000 and 0x08001749 look like the start of the vector table. Not sure why it'd want to put the start of your program there.
2020-07-16 05:30 AM
> why the stm32cubeide can't config pinout view by itself?
I don't know what you mean by this. Can you explain the problem in more detail?
2020-07-17 12:52 AM
@Msadr471 Please stop writing about a completely other problem inside my thread.
Open your own thread for your problem!
I now updated the STM32CubeIDE to version 1.3.1
But its still the same problem :(
Is there an option in CubeIDE for "debug without downloading"? I didn't find that.
But this would help, because the download with ST-Link Tool works fine.
2020-07-17 06:25 AM
> Is there an option in CubeIDE for "debug without downloading"?
To debug your program without downloading it,
Go to Debug Configurations... -> Startup -> select load image -> Edit... -> uncheck Download