Skip to content

STM32 with ST-Link V3 debugger does not start properly #9

@jbur83

Description

@jbur83

I tried to debug a Project on STM32 with ST-Link debugger. The project debugs fine with IAR EW 8.40.2

My Launch config is

{
    "configurations": [
        
        {
            "type": "cspy",
            "request": "launch",
            "name": "SU613_bootloader.Debug",
            "target": "arm",
            "program": "${workspaceFolder}\\Debug\\Exe\\SU613_bootloader.out",
            "driver": "stlink2",
            "stopOnEntry": true,
            "workbenchPath": "${command:iar-config.toolchain}",
            "projectPath": "${workspaceFolder}\\SU613_bootloader.ewp",
            "projectConfiguration": "Debug",
            "driverOptions": [
                "--endian=little",
                "--cpu=Cortex-M4",
                "--fpu=None",
                "-p",
                "C:\\MyPrograms\\IAR Systems\\Embedded Workbench 8.3\\arm\\CONFIG\\debugger\\ST\\STM32F405VG.ddf",
                "--semihosting",
                "--device=STM32F405VG",
                "--drv_interface=SWD",
                "--stlink_reset_strategy=0,0",
                "--drv_swo_clock_setup=168000000,1,2000000",
                "--drv_catch_exceptions=0x000",
                "--drv_debug_ap=0",
                "--stlink_probe=stlinkv3"
            ],
            "download": {
                "flashLoader": "C:\\MyPrograms\\IAR Systems\\Embedded Workbench 8.3\\arm\\config\\flashloader\\ST\\FlashSTM32F4xxx.board",
                "deviceMacros": [
                    "C:\\MyPrograms\\IAR Systems\\Embedded Workbench 8.3\\arm\\config\\debugger\\ST\\STM32F4xx.dmac"
                ]
            }
        }
    ]
}

The output on the debugging-console is as follows:

Initializing flash loader manager using C:\MyPrograms\IAR Systems\Embedded Workbench 8.3\arm\config\flashloader\ST\FlashSTM32F4xxx.board
Loading flash module: C:\MyWorkspace\MyProj_bootloader\Debug\Exe\MyProj_bootloader.out
Loaded macro file: c:\MyPrograms\IAR Systems\Embedded Workbench 8.3\arm\config\flashloader\ST\FlashSTM32F4xxx.mac
Connected to ST-Link/V3 [SWD mode 1000 kHz] [Access port: 0] Firmware V3.J03.S0 (Probe no: 34313939)
Hardware reset with strategy 0 was performed
Initial reset was performed
992 bytes downloaded (20.61 Kbytes/sec)
Loaded debugee: c:\MyPrograms\IAR Systems\Embedded Workbench 8.3\arm\config\flashloader\ST\FlashSTM32F4xxxRAM128K.out
Target reset
Unloaded macro file: c:\MyPrograms\IAR Systems\Embedded Workbench 8.3\arm\config\flashloader\ST\FlashSTM32F4xxx.mac
Downloaded C:\MyWorkspace\MyProj_bootloader\Debug\Exe\MyProj_bootloader.out to flash memory.
59914 bytes downloaded into FLASH (7.83 Kbytes/sec)
Flash loading completed successfully.
Hardware reset with strategy 0 was performed
Loaded debugee: C:\MyWorkspace\MyProj_bootloader\Debug\Exe\MyProj_bootloader.out
Hardware reset with strategy 0 was performed
Target reset
Shutting down C-SPY...

So principially, communication with debugger and target seems to be fine. Debugger-LEDs are blinking red/green as expected. But then, it quickly aborts without starting at the main.c entry point

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions