Skip to content

feat(requests): add image slot info (command 6) - #145

Draft
mniestroj wants to merge 2 commits into
intercreate:mainfrom
mniestroj:feat/image-slot-info
Draft

mniestroj wants to merge 2 commits into
intercreate:mainfrom
mniestroj:feat/image-slot-info

Conversation

@mniestroj

Copy link
Copy Markdown

Zephyr's img_mgmt answers command 6 with the images and slots the application can see (CONFIG_MCUMGR_GRP_IMG_SLOT_INFO). Wrap smp's ImageSlotInfoReadRequest like the other image requests.

Zephyr's img_mgmt answers command 6 with the images and slots the
application can see (CONFIG_MCUMGR_GRP_IMG_SLOT_INFO). Wrap smp's
ImageSlotInfoReadRequest like the other image requests.

Assisted-by: Claude:claude-opus-5-5
@mniestroj
mniestroj force-pushed the feat/image-slot-info branch from a3ef9fc to 9ceb436 Compare October 24, 2026 10:15
ImageSlotInfoRead needs smp's slot info models, which no smp release
has yet. Take smp from that pull request's commit, so that CI can run.

This is temporary: drop it once an smp release has the models, and raise
the smp floor to that release instead. cbor2 moves to 6, which smp has
required since 4.2.0.

Assisted-by: Claude:claude-opus-5-5
@mniestroj
mniestroj force-pushed the feat/image-slot-info branch from 9ceb436 to 9c173ce Compare October 24, 2026 13:31
mniestroj added a commit to mniestroj/smpmgr that referenced this pull request Oct 24, 2026
`image slot-info` needs ImageSlotInfoRead from
intercreate/smpclient#145, which in turn needs the slot info models from
JPHutchins/smp#75. Neither is released yet, so take both from those pull
requests' commits, so that CI can run.

This is temporary: once both are released, drop it and move the
smpclient pin to the release. smp is named here only because Poetry
would otherwise take it from PyPI, where no release has slot info yet.
cbor2 moves to 6, which smp has required since 4.2.0.

Assisted-by: Claude:claude-opus-5-5
@JPHutchins

Copy link
Copy Markdown
Collaborator

Warning

LLM Disclosure

This post was authored by claude-opus-5-5 on behalf of @JPHutchins. JP asked me to post the handoff plan for the related smp change (JPHutchins/smp#76, which took over JPHutchins/smp#74) here.

Related smp change: JPHutchins/smp#76 (supersedes JPHutchins/smp#74) adds a separate request/response pair for MCUboot's mode query. smpclient needs one new request to reach it. Nothing in smpclient breaks.

Handoff plan

  1. fix: model the bootloader info replies as a sum of real wire shapes JPHutchins/smp#76 merges to smp main.
  2. smp release containing feat: add image management slot info (command 6) JPHutchins/smp#75 (slot info) and Timeout is not used when search by name is used and when connect is being performed #76 (bootloader mode).
  3. This PR: replace the [tool.uv.sources] git pin with smp>=<that release>, then merge.
  4. Follow-up smpclient PR (or this one, if you'd rather combine them): add MCUbootModeRead (sketch below) and a test_requests.py row.
Details for the follow-up
# src/smpclient/requests/os_management.py
class MCUbootModeRead(smpos.MCUbootModeReadRequest, _OSGroupBase):
    _Response = smpos.MCUbootModeReadResponse
# tests/test_requests.py
(
    smpos.MCUbootModeReadRequest(query="mode"),
    MCUbootModeRead(query="mode"),
    smpos.MCUbootModeReadResponse,
    smpos.OSManagementErrorV1,
    smpos.OSManagementErrorV2,
),
  • query: Literal["mode"] is required, not defaulted, so it always reaches the wire. Callers write MCUbootModeRead(query="mode").
  • MCUbootModeReadResponse.mode is MCUbootMode | int. MCUbootMode gains FIRMWARE_LOADER (7), SINGLE_SLOT_RAM_LOADER (8) and SWAP_USING_OFFSET (9); newer modes stay int. no_downgrade is Literal[True] | None.
  • BootloaderInformationRead is unchanged. It still binds BootloaderInformationReadResponse ({"bootloader": str}), and smpclient already builds it without a query. smp Timeout is not used when search by name is used and when connect is being performed #76 removes BootloaderInformationReadRequest.query, so any downstream BootloaderInformationRead(query="mode") should become MCUbootModeRead(query="mode"). That call never parsed against a real device, because the reply failed validation.
  • smp Timeout is not used when search by name is used and when connect is being performed #76 also adds AnyBootloaderInformationReadResponse and smp.os_management.loads_bootloader_information_response() for decoding a command 8 frame without knowing which request it answers. SMPClient.request() doesn't need them, since each request binds exactly one reply.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants