2019-12-23 11:46 AM
Since I have been having issues with some other efforts, I'm stepping back and creating a simple blinky test application. Everything builds fine, however when i use Debug, the upload failes with
STMicroelectronics ST-LINK GDB server. Version 5.3.2
Copyright (c) 2019, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
Waiting for debugger connection...
Debugger connected
-------------------------------------------------------------------
STM32CubeProgrammer v2.2.0
-------------------------------------------------------------------
Log output file: /tmp/STM32CubeProgrammer_CRmk67.log
ST-LINK SN : 066EFF505453707867193830
ST-LINK FW : V2J34M25
Voltage : 3.24V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Cannot identify the device
Error: unknown or unsupported device (DevID = 0x0000)
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_OUmMS8.srec
File : ST-LINK_GDB_server_OUmMS8.srec
Size : 12116 Bytes
Address : 0x08000000
Erasing memory corresponding to segment 0:
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:00.092
Verifying ...
Error: Data mismatch found at address 0x08000000 (byte = 0x38 instead of 0x00)
Error: Download verification failed
Encountered Error when opening /Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.macos64_1.1.0.201910081157/tools/bin/STM32_Programmer_CLI
Error in STM32CubeProgrammer
Debugger connection lost.
Shutting down...
I'm at a loss what is the actual problem here.
2019-12-30 07:45 AM
Had a power outage this morning, so i had to reboot my Mac. Now when I load with debug I get
STMicroelectronics ST-LINK GDB server. Version 5.3.2
Copyright (c) 2019, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
LogFile Name : /Users/sbade1/STM32CubeIDE/workspace_1.1.0/Nucleo144-SimpleTest/Debug/st-link_gdbserver_log.txt
Logging Level : 31
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Enabled
SWD Debug : Enabled
Target connection mode: Attach
Hardware watchpoint supported by the target
COM frequency = 4000 kHz
ST-LINK Firmware version : V2J34M25
Device ID: 0x463
PC: 0x0
ST-LINK device status: RUN_MODE
ST-LINK detects target voltage = 3.25 V
ST-LINK device status: RUN_MODE
ST-LINK device initialization OK
Waiting for debugger connection...
Waiting for connection on port 61234...
Accepted connection on port 61234...
Debugger connected
Try halt ...
ST-LINK device status: HALT_MODE
Enter STM32_AppReset() function
NVIC_DFSR_REG = 0x00000009
NVIC_CFGFSR_REG = 0x00000000
XPSR = 0x01000000
------ Switching to STM32CubeProgrammer -----
[36m[01m -------------------------------------------------------------------
[39;49m[36m[01m STM32CubeProgrammer v2.2.0
[39;49m[36m[01m -------------------------------------------------------------------
[39;49m[39;49m
[39;49m[39;49mLog output file: /tmp/STM32CubeProgrammer_Dfaitr.log
[39;49m[39;49m[39;49m[39;49m[90mST-LINK SN : 066EFF505453707867193830
[39;49m[90mST-LINK FW : V2J34M25
[39;49m[90mVoltage : 3.25V
[39;49m[90mSWD freq : 4000 KHz
[39;49m[90mConnect mode: Under Reset
[39;49m[90mReset mode : Hardware reset
[39;49m[90mCannot identify the device
[39;49m[00;31mError: unknown or unsupported device (DevID = 0x0000)
[39;49m[39;49m
[39;49m[39;49mMemory Programming ...
[39;49m[39;49mOpening and parsing file: ST-LINK_GDB_server_w0kMnj.srec
[39;49m[39;49m File : ST-LINK_GDB_server_w0kMnj.srec
[39;49m[39;49m Size : 12148 Bytes
[39;49m[39;49m Address : 0x08000000
[39;49m[39;49m
[39;49m[39;49m[39;49mErasing memory corresponding to segment 0:
[39;49m[39;49m[39;49mDownload in Progress:
[39;49m[39;49m[39;49m[39;49m[39;49m[39;49m[00;32m[==================================================] 100%
[39;49m[39;49m[39;49m
[39;49m[00;32mFile download complete
[39;49m[39;49mTime elapsed during download operation: 00:00:00.091
[39;49m ------ Switching context -----
Target connection mode: Default
Hardware watchpoint supported by the target
COM frequency = 4000 kHz
ST-LINK Firmware version : V2J34M25
Device ID: 0x463
PC: 0x80008c8
ST-LINK detects target voltage = 3.25 V
ST-LINK device status: HALT_MODE
ST-LINK device initialization OK
handle_vCont_c, continue thread
TraceCaptureStart and SWV event set to APP_FALSE (0)
NVIC_DFSR_REG = 0x00000008
It is breaking in the Error_Handler function which is part of the generated code for the project.
From the debugger console if i do a backtrace of the stack i get
backtrace
#0 Error_Handler () at ../Core/Src/main.c:302
#1 <signal handler called>
#2 0x00000000 in ?? ()
#3 0x08000898 in ?? ()
2019-12-30 10:41 AM
I found an old/slow windows machine, and the same code builds and loads fine. If i turn Verification of the FW on, on the MAC it fails, on windows it succeeds. It seems that something on the mac is not building correctly
2019-12-30 12:20 PM
I completely removed all vestiges of anything STM32 on the Mac, and reinstalled only the STM32CubeIDE. magically everything seems to be working now. must have had something laying about that caused issues.