Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

armdbg cannot connect via ST-Link on Nucleo-H7S3L8 #11

Open
doesnotcompete opened this issue Sep 9, 2024 · 1 comment
Open

armdbg cannot connect via ST-Link on Nucleo-H7S3L8 #11

doesnotcompete opened this issue Sep 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@doesnotcompete
Copy link

Type: Bug Report

Describe the bug

  • OS and Version: Arch Linux/Linux 6.10.7 x86_64
  • VS Code Version: 1.92.1
  • Extension Version: 1.2.2
  • Target Device: Nucleo-H7S3L8/STM32H7S3L8Hx
  • Interacting with the on-board ST-Link on the Nucleo fails with ERROR(TAD517): Failed to connect to any devices on the target. Check that the target is correctly connected to the debug probe and powered on.

To Reproduce
Steps to reproduce the behavior:

  1. Add the STLink to the Device Manager and configure pack and device name.
  2. Add a debug/launch configuration.
  3. Attempt to run or debug the solution.

Expected behavior
The connection to the on-board ST-Link is successful.

Code sample and logs
tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "arm-debugger.flash",
            "programs": "${command:cmsis-csolution.getBinaryFiles}",
            "cmsisPack": "Keil::[email protected]",
            "deviceName": "STM32H7S3L8Hx",
            "processorName": "${command:cmsis-csolution.getProcessorName}",
            "problemMatcher": [],
            "label": "Flash Device",
            "probe": "ST-Link",
            "flms": [
                {
                    "path": "CMSIS/Flash/STM32H7Rx_64k.FLM",
                    "ignore": true
                },
                {
                    "path": "CMSIS/Flash/MX25UW25645G_STM32H7S38-NUCLEO.FLM",
                    "ignore": false
                }
            ],
            "openSerial": 115200,
            "debugPortMode": "SWD",
            "connectMode": "auto",
            "debugClockSpeed": "auto",
            "serialNumber": "${command:device-manager.getSerialNumber}"
        }
    ]
}

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Arm Debugger",
            "type": "arm-debugger",
            "request": "launch",
            "serialNumber": "${command:device-manager.getSerialNumber}",
            "programs": "${command:cmsis-csolution.getBinaryFiles}",
            "cmsisPack": "${command:cmsis-csolution.getTargetPack}",
            "deviceName": "${command:cmsis-csolution.getDeviceName}",
            "processorName": "${command:cmsis-csolution.getProcessorName}",
            "probe": "ST-Link"
        }
    ]
}

Additional context
Running the debugger with debug output from the vcpkg location with ./bin/armdbg --probe ST-Link --cmsis-device-name STM32H7S3L8Hx --target $STLINK_SERIAL -l DEBUG shows this:

DEBUG: RVIAPI:	APIDebug::APIDebug(parent)
DEBUG: RVIAPI:	RVIAPI_Connection::InitConfig()
DEBUG: RVIAPI:	RVIAPI_Config::GetConfig()
DEBUG: RVIAPI:	BatchExecute()
DEBUG: RVIAPI:	Executed 3 batch commands, 3 expected
DEBUG: RVIAPI:	RVIAPI_Config::GetConfig()
DEBUG: RVIAPI:	RVIAPI_Config::SetConfig(): device 0, item RvcHash, value 320792370
DEBUG: RVIAPI:	RVIAPI_Connection::SetDevChain()
DEBUG: RVIAPI:	RVIAPI_Connection::GetDevChain()
DEBUG: RVIAPI:	RVIAPI_Config::SetConfig(): device 0, item ScanChainJtagFreqs, value 7500000
DEBUG: RVIAPI:	BatchExecute()
DEBUG: RVIAPI:	Executed 3 batch commands, 3 expected
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItemsCount()
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 0)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 1)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 2)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 3)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 4)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 5)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 6)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 7)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 8)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 9)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 10)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 11)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 12)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 13)
DEBUG: RVIAPI:	BatchExecute()
DEBUG: RVIAPI:	Executed 42 batch commands, 42 expected
DEBUG: RDDI RVI:	APIDebug::CreateNewConfigItems(): device 0, item AllowTRST not present
DEBUG: RDDI RVI:	APIDebug::CreateNewConfigItems(): device 0, item DoSoftTRST not present
DEBUG: RDDI RVI:	APIDebug::CreateNewConfigItems(): device 0, item Linked_SRST_TRST not present
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 0)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 1)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 2)
DEBUG: RVIAPI:	BatchExecute()
DEBUG: RVIAPI:	Batch command aborting because of error.
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 3)
DEBUG: RVIAPI:	BatchExecute()
DEBUG: RVIAPI:	Batch command aborting because of error.
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 4)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 5)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 6)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 7)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 8)
DEBUG: RVIAPI:	BatchExecute()
DEBUG: RVIAPI:	Batch command aborting because of error.
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 9)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 10)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 11)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 12)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 0, index 13)
DEBUG: RVIAPI:	BatchExecute()
DEBUG: RVIAPI:	Executed 11 batch commands, 11 expected
DEBUG: Using RDDI 2.0 (1413): RDDI_Debug_RVI
DEBUG: Connected to server=/home/kevin/.vcpkg/artifacts/2139c4c6/debuggers.arm.armdbg/6.2.1/bin/../sw/debughw/debug_server/rddi_serverd;args=-rddi_dll,/home/kevin/.vcpkg/artifacts/2139c4c6/debuggers.arm.armdbg/6.2.1/bin/../sw/debugger/configdb/Probes/STlink/librddi_st-link.so.2,-probe_id,004F00203033510135393935: Arm RDDI Debug Server
Arm RDDI Debug Server 0.0.0
DEBUG: RVIAPI:	RVIAPI_Config::SetConfig(): device 0, item MinimalConnect, value 1
DEBUG: RVIAPI:	BatchExecute()
DEBUG: RVIAPI:	Executed 3 batch commands, 3 expected
DEBUG: RVIAPI:	Rviapi_Notify
DEBUG: RVIAPI:	Rviapi_Transaction
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetTapDeviceCount()
DEBUG: RVIAPI:	OpenConnAndConfigure(): starting for device 1
DEBUG: RVIAPI:	OpenConnAndConfigure(): calling OpenConn() 
DEBUG: RVIAPI:	RVIAPI_Connection::OpenConn(): id=0x78672D7FC7C0, version=0x78672D7FC7D0, message=0x00000000, messageLen=0, messageUsed=0x78672D7FC7B0
DEBUG: RVIAPI:	APIDebug::PreConnect(): starting for device 1
DEBUG: RVIAPI:	APIDebug::PreConnect(): finishing
DEBUG: RVIAPI:	APIDebug::RegCreateDevice starting
DEBUG: RVIAPI:	APIDeviceN object created device 1
DEBUG: RVIAPI:	OpenConnAndConfigure(): OpenConn() completed 
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItemsCount()
DEBUG: RVIAPI:	BatchExecute()
DEBUG: RVIAPI:	BatchExecute()
DEBUG: RVIAPI:	OpenConnAndConfigure(): calling ActivateConn() 
DEBUG: RVIAPI:	RVIAPI_Device::ActivateConn()
DEBUG: RVIAPI:	Rviapi_Notify
DEBUG: RVIAPI:	Rviapi_Notify
DEBUG: RVIAPI:	OpenConnAndConfigure(): starting for device 1
DEBUG: RVIAPI:	OpenConnAndConfigure(): calling OpenConn() 
DEBUG: RVIAPI:	RVIAPI_Connection::OpenConn(): id=0x78672D7FC6A0, version=0x78672D7FC6B0, message=0x00000000, messageLen=0, messageUsed=0x78672D7FC690
DEBUG: RVIAPI:	APIDebug::PreConnect(): starting for device 1
DEBUG: RVIAPI:	APIDebug::PreConnect(): finishing
DEBUG: RVIAPI:	APIDebug::RegCreateDevice starting
DEBUG: RVIAPI:	APIDeviceN object created device 1
DEBUG: RVIAPI:	APIDevice object destroying
DEBUG: RVIAPI:	OpenConnAndConfigure(): OpenConn() completed 
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItemsCount()
DEBUG: RVIAPI:	BatchExecute()
DEBUG: RVIAPI:	BatchExecute()
DEBUG: RVIAPI:	OpenConnAndConfigure(): calling ActivateConn() 
DEBUG: RVIAPI:	RVIAPI_Device::ActivateConn()
DEBUG: RVIAPI:	Rviapi_Notify
DEBUG: RVIAPI:	Rviapi_Notify
DEBUG: RVIAPI:	Rviapi_Notify
DEBUG: Located FDB://keil_flash.py in /home/kevin/.vcpkg/artifacts/2139c4c6/debuggers.arm.armdbg/6.2.1/sw/debugger/configdb/Flash/keil_flash.py
DEBUG: Resolved FDB://keil_flash.py to /home/kevin/.vcpkg/artifacts/2139c4c6/debuggers.arm.armdbg/6.2.1/sw/debugger/configdb/Flash/keil_flash.py
DEBUG: Located FDB://keil_flash.py in /home/kevin/.vcpkg/artifacts/2139c4c6/debuggers.arm.armdbg/6.2.1/sw/debugger/configdb/Flash/keil_flash.py
DEBUG: Resolved FDB://keil_flash.py to /home/kevin/.vcpkg/artifacts/2139c4c6/debuggers.arm.armdbg/6.2.1/sw/debugger/configdb/Flash/keil_flash.py
DEBUG: Located FDB://keil_flash.py in /home/kevin/.vcpkg/artifacts/2139c4c6/debuggers.arm.armdbg/6.2.1/sw/debugger/configdb/Flash/keil_flash.py
DEBUG: Resolved FDB://keil_flash.py to /home/kevin/.vcpkg/artifacts/2139c4c6/debuggers.arm.armdbg/6.2.1/sw/debugger/configdb/Flash/keil_flash.py
DEBUG: Located FDB://keil_flash.py in /home/kevin/.vcpkg/artifacts/2139c4c6/debuggers.arm.armdbg/6.2.1/sw/debugger/configdb/Flash/keil_flash.py
DEBUG: Resolved FDB://keil_flash.py to /home/kevin/.vcpkg/artifacts/2139c4c6/debuggers.arm.armdbg/6.2.1/sw/debugger/configdb/Flash/keil_flash.py
DEBUG: Event Observer com.arm.debug.core.engine.connection.Connection$1@1deceb67 added for event class com.arm.debug.core.interfaces.events.ExecutionStateChangedEvent
DEBUG: Event Observer com.arm.debug.core.engine.connection.ConnectionLostEventObserver$1@546e61d5 added for event class com.arm.debug.core.interfaces.events.ApplicationExitValueEvent
DEBUG: Event Observer com.arm.debug.core.engine.connection.ConnectionLostEventObserver@60783105 added for event class com.arm.debug.core.interfaces.events.ConnectionLostEvent
DEBUG: Event Filter com.arm.debug.core.engine.stack.StackChangedFilter@1e469dfd added for event class com.arm.debug.core.interfaces.events.ExecutionContextRefreshEvent
DEBUG: Event Filter com.arm.debug.core.engine.stack.StackChangedFilter@1e469dfd added for event class com.arm.debug.core.interfaces.events.ExecutionStateChangedEvent
DEBUG: Event Filter com.arm.debug.core.engine.stack.StackChangedFilter@1e469dfd added for event class com.arm.debug.core.interfaces.events.RegisterWriteEvent
DEBUG: Event Filter com.arm.debug.core.engine.stack.StackChangedFilter@1e469dfd added for event class com.arm.debug.core.interfaces.events.MemoryWriteEvent
DEBUG: Event Filter com.arm.debug.core.engine.stack.StackChangedFilter@1e469dfd added for event class com.arm.debug.core.interfaces.events.ResetEvent
DEBUG: Event Observer com.arm.debug.core.engine.image.ImageChangedObserver@730f9695 added for event class com.arm.debug.core.interfaces.image.ImageChangedEvent
DEBUG: Event Observer com.arm.debug.core.engine.connection.Connection$2@1dba4e06 added for event class com.arm.debug.core.interfaces.events.ResetEvent
DEBUG: Event Filter com.arm.debug.core.engine.connection.Connection$3@3374b5bc added for event class com.arm.debug.core.interfaces.events.ExecutionContextRefreshEvent
DEBUG: Event Observer com.arm.debug.cli.ApplicationExitObserver@4047d2d9 added for event class com.arm.debug.core.interfaces.events.ApplicationExitValueEvent
DEBUG: Event Observer com.arm.debug.service.ConnectEventObserver@1b1f5012 added for event class com.arm.debug.core.interfaces.events.ConnectEvent
DEBUG: Event Observer com.arm.debug.cli.ThinController$1@3d904e9c added for event class com.arm.debug.core.interfaces.events.DisconnectEvent
DEBUG: Connecting Properties {config_file:/home/kevin/.cache/arm/packs/Keil/STM32H7RSxx_DFP/1.0.0/CMSIS/Debug/STM32H7Rx_7Sx.sdf, address:server=/home/kevin/.vcpkg/artifacts/2139c4c6/debuggers.arm.armdbg/6.2.1/bin/../sw/debughw/debug_server/rddi_serverd;args=-rddi_dll,/home/kevin/.vcpkg/artifacts/2139c4c6/debuggers.arm.armdbg/6.2.1/bin/../sw/debugger/configdb/Probes/STlink/librddi_st-link.so.2,-probe_id,004F00203033510135393935, connectionType:ST-Link, stopOnConnect:true, cdbDebugPlatformObject:com.arm.debug.cli.CmsisConnectionPropertiesProvider$CmsisPlatform@4d95a72e, cdbDebugActivityObject:com.arm.debug.cli.CmsisConnectionPropertiesProvider$CmsisActivity@28da7d11, cdbDebugDatabaseObject:com.arm.debug.configdatabase.ConfigDatabase@77b919a3, dtsl_config_args:[], stdout:com.arm.debug.cli.SemihostingOutputStreamLogger@5624657a, stderr:com.arm.debug.cli.SemihostingOutputStreamLogger@36681447, sfrSearchDirs:[/home/kevin/.cache/Arm/armdbg/svd/STMicroelectronics_STM32H7S3L8Hx_1.0.0], analytics_collector:com.arm.debug.analytics.NullAnalytics@4d21c56e, analytics_session:com.arm.debug.analytics.NullTrackingSession@726aa968, connection_event_callbacks:{TARGET_CONNECTED=com.arm.debug.cli.ThinController$$Lambda/0x000000080043e000@7100dea}}
DEBUG: calling ITargetConnection.connect() on com.arm.debug.targetaccess.device.TargetDevice@42b84286
DEBUG: Connecting: Properties {config_file:/home/kevin/.cache/arm/packs/Keil/STM32H7RSxx_DFP/1.0.0/CMSIS/Debug/STM32H7Rx_7Sx.sdf, address:server=/home/kevin/.vcpkg/artifacts/2139c4c6/debuggers.arm.armdbg/6.2.1/bin/../sw/debughw/debug_server/rddi_serverd;args=-rddi_dll,/home/kevin/.vcpkg/artifacts/2139c4c6/debuggers.arm.armdbg/6.2.1/bin/../sw/debugger/configdb/Probes/STlink/librddi_st-link.so.2,-probe_id,004F00203033510135393935, connectionType:ST-Link, stopOnConnect:true, cdbDebugPlatformObject:com.arm.debug.cli.CmsisConnectionPropertiesProvider$CmsisPlatform@4d95a72e, cdbDebugActivityObject:com.arm.debug.cli.CmsisConnectionPropertiesProvider$CmsisActivity@28da7d11, cdbDebugDatabaseObject:com.arm.debug.configdatabase.ConfigDatabase@77b919a3, dtsl_config_args:[], stdout:com.arm.debug.cli.SemihostingOutputStreamLogger@5624657a, stderr:com.arm.debug.cli.SemihostingOutputStreamLogger@36681447, sfrSearchDirs:[/home/kevin/.cache/Arm/armdbg/svd/STMicroelectronics_STM32H7S3L8Hx_1.0.0], analytics_collector:com.arm.debug.analytics.NullAnalytics@4d21c56e, analytics_session:com.arm.debug.analytics.NullTrackingSession@726aa968, connection_event_callbacks:{TARGET_CONNECTED=com.arm.debug.cli.ThinController$$Lambda/0x000000080043e000@7100dea}, settingsRegister:{DS_escapeStringsSetting=com.arm.debug.output.EscapeStringsSetting@1f6917fb, DS_AutoRemoveBreakpoints=com.arm.debug.core.engine.breakpoints.AutoRemoveBreakpointsSetting@41eb94bc, cache_evictions=com.arm.debug.core.engine.memory.MemoryCacheStats$1@378cfecf, DS_Version=com.arm.debug.core.engine.VersionSetting@97d0c06, DS_FloatFormat=com.arm.debug.output.FloatFormatSetting@5e7c141d, SHORT_CIRCUIT_SEARCH=com.arm.debug.core.engine.symbols.namelookup.ShortCircuitSearch@43af351a, cache_flushes=com.arm.debug.core.engine.memory.MemoryCacheStats$3@1305c126, CASE_INSENSITIVE_SOURCE_MATCHING=com.arm.debug.core.engine.sources.CaseInsensitiveSourceMatching@72f9f27c, cache_hits=com.arm.debug.core.engine.memory.MemoryCacheStats$2@4c1bdcc2, total_mem_reads=com.arm.debug.core.engine.memory.MemoryCacheStats$4@762637be, DS_DoubleFormat=com.arm.debug.output.DoubleFormatSetting@4b97c4ad}}
DEBUG: Opening connection to device Cortex-M7
DEBUG: RVIAPI:	OpenConnAndConfigure(): starting for device 9
DEBUG: RVIAPI:	OpenConnAndConfigure(): calling OpenConn() 
DEBUG: RVIAPI:	RVIAPI_Connection::OpenConn(): id=0x78672D7FD740, version=0x78672D7FD750, message=0x7867293FC560, messageLen=1024, messageUsed=0x78672D7FD730
DEBUG: RVIAPI:	APIDebug::PreConnect(): starting for device 9
DEBUG: RVIAPI:	APIDebug::PreConnect(): finishing
DEBUG: RVIAPI:	APIDebug::RegCreateDevice starting
DEBUG: RVIAPI:	APIDeviceN object created device 9
DEBUG: RVIAPI:	OpenConnAndConfigure(): OpenConn() completed 
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItemsCount()
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 9, index 0)
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 9, index 1)
DEBUG: RVIAPI:	BatchExecute()
DEBUG: RVIAPI:	Executed 6 batch commands, 6 expected
DEBUG: RDDI RVI:	APIDebug::CreateNewConfigItems(): device 9, item CORESIGHT_BASE_ADDRESS not present
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 9, index 0)
DEBUG: RVIAPI:	OpenConnAndConfigure(): setting pre-conn config item 0 of 2 for device 9
DEBUG: RVIAPI:	RVIAPIConfigInfoNew::GetConfigItem(device 9, index 1)
DEBUG: RVIAPI:	OpenConnAndConfigure(): setting pre-conn config item 1 of 2 for device 9
DEBUG: RVIAPI:	BatchExecute()
DEBUG: RVIAPI:	Batch command aborting because of error.
DEBUG: RVIAPI:	BatchExecute()
DEBUG: RVIAPI:	OpenConnAndConfigure(): calling ActivateConn() 
DEBUG: RVIAPI:	RVIAPI_Device::ActivateConn()
DEBUG: Event Observer com.arm.debug.cli.ProgressObserver@1716e8c5 removed for event class com.arm.debug.core.interfaces.progress.NewProgressJobEvent
ERROR(TAD517): Failed to connect to any devices on the target. Check that the target is correctly connected to the debug probe and powered on.
DEBUG: Disconnecting
DEBUG: main pushes DisconnectingEvent
DEBUG: Error removing breakpoints on disconnection
@doesnotcompete doesnotcompete added the bug Something isn't working label Sep 9, 2024
@jreineckearm
Copy link
Contributor

Thanks for reporting this, @doesnotcompete !

Could you please check if adding the option "connectMode": "underReset" makes a difference? Depending on the application residing in the device's flash before programming/debugging, it may be in a low power mode with the debug logic turned off. This option can help to recover from such state.

Also, if this doesn't help, could you please run the debugger with the command line argument --log-debug-sequences instead of -l DEBUG and post what's logged for sequence "DebugPortStart"? I'd be interested to see if you are hitting a problem that we are currently looking into a fix for and that can show the above symptoms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants