Skip to content

[Feature Request]: pyOCD: Enable runtime switching between debug sequence and flash algorithm programming #1013

Description

@TeoMahnic

Description

Add support for runtime selection of the flash programming implementation for flashinfo-based devices.

Some devices currently use flash debug sequences for erase/program operations, but can use a faster FLM algorithm depending on runtime device state. This cannot always be expressed statically through the PDSC or cbuild-run algorithm list.

Proposed optional setup sequences:

FlashEraseSetup
FlashProgramSetup

Before an erase or program phase, the debugger runs the matching setup sequence for the relevant flashinfo region.

The debugger should expose:

FlashLoadAlgorithm(alg_path, ram_start, ram_size)

The .flm path, RAM start, and RAM size are provided by the debug sequence itself.

If FlashLoadAlgorithm() succeeds, the debugger uses the selected FLM algorithm for the following erase or program phase. If the setup sequence is missing, does not call FlashLoadAlgorithm(), or the call fails, the debugger keeps the existing flash debug sequence behavior.

Erase and program selection should be independent.

Is this request a Security Requirement?

  • Yes

Priority

High

Related Issues (Optional)

No response

Additional Notes (Optional)

No response

Metadata

Metadata

Assignees

Labels

pyOCDChange is required in shipped pyOCD variant
No fields configured for Feature.

Projects

Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions