Pack 生产连接生命周期
以下内容自动抽取自 sdk-headers/HFLinkDriver_pack_lifecycle.h ,含 11 个公开函数及全部公开类型。函数指针回调类型不单独列出,见所属结构体成员说明。
枚举
-
enum HFLink_PackTransport
Values:
-
enumerator HFLINK_PACK_TRANSPORT_UNSPECIFIED
-
enumerator HFLINK_PACK_TRANSPORT_SWD
-
enumerator HFLINK_PACK_TRANSPORT_JTAG
-
enumerator HFLINK_PACK_TRANSPORT_CJTAG
-
enumerator HFLINK_PACK_TRANSPORT_UNSPECIFIED
-
enum HFLink_PackJtagMode
Values:
-
enumerator HFLINK_PACK_JTAG_UNSPECIFIED
-
enumerator HFLINK_PACK_JTAG_AUTO
-
enumerator HFLINK_PACK_JTAG_EXPLICIT
-
enumerator HFLINK_PACK_JTAG_UNSPECIFIED
-
enum HFLink_PackAtomicPolicy
Constraint policy for atomic blocks.
备注
Zero initialization (not explicitly set) means IGNORE: atomic_begin/end become no-ops when the probe has no buffering support, without reporting an error.
Values:
-
enumerator HFLINK_PACK_ATOMIC_IGNORE
Ignore atomic constraints (default): atomic_begin/end are no-ops
-
enumerator HFLINK_PACK_ATOMIC_ERROR
Atomic blocks return unsupported when the probe has no buffering
-
enumerator HFLINK_PACK_ATOMIC_IGNORE
结构体
-
struct HFLink_PackJtagTap
-
struct HFLink_PackJtagTapMapping
-
struct HFLink_PackSwdTarget
User-provided SWD Multidrop physical selector; the Pack PDSC is not a TARGETSEL source.
-
struct HFLink_PackSequenceRuntime
Sequence runtime returned by the script loader.
备注
Open takes over userdata after the loader returns; Close calls destroy after the last Sequence invocation. If resource ownership has been transferred to the DebugDeviceSession, destroy may be set to NULL.
-
struct HFLink_PackDebugSessionOptions
Pack production connection parameters; except for the Sequence runtime, callback userdata is borrowed by the implementation and must outlive Close.
备注
The caller must provide DEFAULT_HOST Sequences through the host bodies or the resolver returned by load_sequences; the C lifecycle layer does not guess target timing.
Public Members
-
HFLink_PackTransport transport
Must be explicitly selected by the caller or by ConfigTargetSettings.
-
uint32_t clock_hz
Must be set to a non-zero value by the caller or ConfigTargetSettings; no fallback to the Pack clock.
-
const char *user_hook_script_path
UTF-8 user Hook file path; deep-copied by the session.
-
HFLink_LuaOutputCallback lua_output_callback
Optional output and Message/Query host callbacks of the standalone Hook/Sequence Lua runtime.
-
HFLink_PackConfigTargetSettings config_target_settings
C host hooks; the Lua runtime's same-named hooks run after these callbacks.
-
HFLink_PackTransport transport
API
-
int HFLink_PackDebugSession_Open(const char *device_selector, const HFLink_PackDebugSessionOptions *options, HFLink_PackDebugSession **out_session)
Open the full Pack debug lifecycle.
The order is fixed: Query -> load built-in/Pack/Hook -> ConfigTargetSettings -> freeze configuration -> PreparePackTopology (description only) -> set interface/clock -> select the physical transport -> per-port InitTarget -> JTAG physical chain -> BuildPackTopology (create CoreSessions) -> ConnectSequences per (Pname, Punit) -> ValidatePackTopology/examine -> SetupTarget. On any failure, already-connected cores are disconnected in reverse order and everything is released. options is required. DEFAULT_HOST Sequences must be provided by the host bodies or the resolver returned by load_sequences.
- 参数:
device_selector -- The device selector passed to HFLink_PackDevice_Query().
options -- Required connection parameters; the struct itself is copied, while callback userdata is borrowed until Close.
out_session -- On success receives the lifecycle object; set to NULL on failure.
-
int HFLink_PackDebugSession_Close(HFLink_PackDebugSession *session)
Disconnect all cores in reverse order and release PackDeviceInfo, DebugDeviceSession and the CoreSession list.
- 返回:
The first disconnect error; all resources are released regardless. Safe to call repeatedly and returns HFLINK_OK.
-
void HFLink_PackDebugSession_Destroy(HFLink_PackDebugSession *session)
Release the lifecycle object after Close; may be passed NULL.
-
const HFLink_PackDeviceInfo *HFLink_PackDebugSession_GetDeviceInfo(const HFLink_PackDebugSession *session)
Return the borrowed Pack query result held by the lifecycle; NULL after Close.
-
HFLink_DebugDeviceSession *HFLink_PackDebugSession_GetDeviceSession(HFLink_PackDebugSession *session)
Return the borrowed device session held by the lifecycle; NULL after Close.
-
uint32_t HFLink_PackDebugSession_GetCoreCount(const HFLink_PackDebugSession *session)
Return the number of CoreSessions kept in Pack processor/Punit order.
-
HFLink_CoreSession *HFLink_PackDebugSession_GetCoreAt(HFLink_PackDebugSession *session, uint32_t index)
Return the borrowed CoreSession pointer in stable order; NULL when out of range or after Close.
-
HFLink_CoreSession *HFLink_PackDebugSession_GetCore(HFLink_PackDebugSession *session, const char *pname, uint32_t punit)
Return the borrowed CoreSession pointer by (Pname, Punit); NULL after Close.
-
int HFLink_PackDebugSession_ResetDefault(HFLink_PackDebugSession *session, const char *pname, uint32_t punit, uint32_t *affected_route_count)
Execute the Pack default reset of the given core using the resolver and reset host callbacks loaded at Open.
-
int HFLink_PackDebugSession_ResetDefaultScoped(HFLink_PackDebugSession *session, const char *pname, uint32_t punit, HFLink_ResetScope scope, uint32_t *affected_route_count)
Execute the defaultResetSequence of the given core with an explicit scope.
-
int HFLink_PackDebugSession_BindFlashSession(HFLink_PackDebugSession *session, HFLink_FlashSession *flash_session, const char *pname, uint32_t punit)
Bind a FlashSession to this Pack Session's core and the C/Lua flash pre/post hooks.
备注
The FlashSession must complete Close before the Pack Session is Closed/Destroyed.