cancel
Showing results for 
Search instead for 
Did you mean: 

DEV_TARGET_NOT_HALTED

dbrooks
Associate II
I am running STM32CubeMX v6.13.0 and STM3Cube2IDE v1.17.0 on the STM32F767 Nucleo. 
Dual Bank Mode is enabled. Code is execting in Bank 1 Sector 0 (0x08000000). 
Default Values are saved in Bank 1 Sector 12 (0x08100000). Default Values can be 
changed via a serial Command Line Interface (CLI).
 
I recently changed my code to add variables to the Default Values struct.
I tested the change, but it was not working. The code acted as though the 
MCU was no longer in Dual Bank Mode, even though I could see the previous 
data in Memory Window address 0x08100000 on the debugger. 
 
I opened the ST Link Utility, and sure enough, Option Byte nDBANK 
was Checked (Single Bank Mode). I don't know how this bit seemingly got 
flipped, but that is not my immediate problem. I used the ST Link Utility 
to re-enable Dual Bank Mode. I executed my code and the new Default Values 
were written-to and recalled-from Bank 12. 
 
However, if a simply stop and restart the debugger, I get this error message 
in a popup window:
 
Error in final launch sequence:
 
Failed to execute MI command:
load C:\\dev\\2024-3196\\VeroTB_F7\\VeroTB_STM32F767ZITx\\Debug\\VeroTB_STM32F767ZITx.elf 
 
Error message from debugger back end:
Error finishing flash operation
Failed to execute MI command:
load C:\\dev\\2024-3196\\VeroTB_F7\\VeroTB_STM32F767ZITx\\Debug\\VeroTB_STM32F767ZITx.elf 
 
Error message from debugger back end:
Error finishing flash operation
Failed to execute MI command:
load C:\\dev\\2024-3196\\VeroTB_F7\\VeroTB_STM32F767ZITx\\Debug\\VeroTB_STM32F767ZITx.elf 
 
Error message from debugger back end:
Error finishing flash operation
Error finishing flash operation
 
 
The Console Window says the following:
 
STMicroelectronics ST-LINK GDB server. Version 7.9.0
Copyright (c) 2024, 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
InitWhile                  : Enabled
 
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
  -------------------------------------------------------------------
   STM32CubeProgrammer v2.18.0                  
  -------------------------------------------------------------------
 
 
 
Log output file:   C:\Users\DBrooks\AppData\Local\Temp\STM32CubeProgrammer_a30520.log
ST-LINK SN  : 0672FF575448867187164913
ST-LINK FW  : V2J45M31
Board       : NUCLEO-F767ZI
Voltage     : 3.23V
ST-LINK error (DEV_TARGET_NOT_HALTED)
Encountered Error when opening C:\Program Files\STM32CubeIDE_1.17.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.2.0.202409170845\tools\bin\STM32_Programmer_CLI.exe
Error in STM32CubeProgrammer
Shutting down...
Exit.
 
Currently, if I run ST Link Utility and Erase Chip, I can then load and run the debugger. My code also executes as expected. 
However, if I simply rerun the debugger, even without recompiling, I get the DEV_TARGET_NOT_HALTED error.
 
None of the previous posted solutions to the DEV_TARGET_NOT_HALTED error fix my problem.
 
So,
1) What does Erase Chip do to fix the problem?
2) What does loading the debugger do to create the problem.
3) On a side note, how does the debugger determine what sector(s) of Flash need to be erased before loading the code?
The linker file has 2048K of Flash configured, but the debugger does not erase all of it, 
otherwise my Default Values would getr erased. I do no see any settings in the IDE to configure what Flash gets erased.

 

0 REPLIES 0