Skip to content

Connect under reset fails for STLINKV3 and SAMD51 #2139

@UtkarshVerma

Description

@UtkarshVerma

I discussed this shortly on Discord but I think it makes for a valid issue.

As the title says, the following results in a failed scan for me:

mon connect_rst enable
mon swd_scan

The hypothesis so far is that the F7 on the STLINKV3 is too fast and hence the scan command is being issued earlier than it should be.

The following lines support this claim.

https://github.com/blackmagic-debug/blackmagic/blob/main/src%2Fplatforms%2Fstlinkv3%2Fplatform.c#L116-L128

A possible way forward is to rely on timing or hardware feedback so that the reset sequence becomes platform agnostic. Alternatively, we could also have target-specific reset sequences but that would likely become a maintenance burden with time.

I would be interested in working up a PR for this so let's have a fruitful discussion on this.

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