sbp.flash module

Messages for reading/writing the device’s onboard flash memory. Many of these messages target specific flash memory peripherals used in Swift Navigation devices: the STM32 flash and the M25Pxx FPGA configuration flash from Piksi 2.3.1. This module does not apply to Piksi Multi.

class sbp.flash.MsgFlashDone(sbp=None, **kwargs)[source]

Bases: sbp.msg.SBP

SBP class for message MSG_FLASH_DONE (0x00E0).

You can have MSG_FLASH_DONE inherit its fields directly from an inherited SBP object, or construct it inline using a dict of its fields.

This message defines success or failure codes for a variety of

flash memory requests from the host to the device. Flash read and write messages, such as MSG_FLASH_READ_REQ, or MSG_FLASH_PROGRAM, may return this message on failure.

sbp
: SBP
SBP parent object to inherit from.
response
: int
Response flags
sender
: int
Optional sender ID, defaults to SENDER_ID (see sbp/msg.py).
from_binary(d)[source]

Given a binary payload d, update the appropriate payload fields of the message.

static from_json(s)[source]

Given a JSON-encoded string s, build a message object.

static from_json_dict(d)[source]
response
to_binary()[source]

Produce a framed/packed SBP message.

to_json_dict()[source]
class sbp.flash.MsgFlashErase(sbp=None, **kwargs)[source]

Bases: sbp.msg.SBP

SBP class for message MSG_FLASH_ERASE (0x00E2).

You can have MSG_FLASH_ERASE inherit its fields directly from an inherited SBP object, or construct it inline using a dict of its fields.

The flash erase message from the host erases a sector of either

the STM or M25 onboard flash memory. The device will reply with a MSG_FLASH_DONE message containing the return code - FLASH_OK (0) on success or FLASH_INVALID_FLASH (1) if the flash specified is invalid.

sbp
: SBP
SBP parent object to inherit from.
target
: int
Target flags
sector_num
: int
Flash sector number to erase (0-11 for the STM, 0-15 for

the M25)

sender
: int
Optional sender ID, defaults to SENDER_ID (see sbp/msg.py).
from_binary(d)[source]

Given a binary payload d, update the appropriate payload fields of the message.

static from_json(s)[source]

Given a JSON-encoded string s, build a message object.

static from_json_dict(d)[source]
sector_num
target
to_binary()[source]

Produce a framed/packed SBP message.

to_json_dict()[source]
class sbp.flash.MsgFlashProgram(sbp=None, **kwargs)[source]

Bases: sbp.msg.SBP

SBP class for message MSG_FLASH_PROGRAM (0x00E6).

You can have MSG_FLASH_PROGRAM inherit its fields directly from an inherited SBP object, or construct it inline using a dict of its fields.

The flash program message programs a set of addresses of either

the STM or M25 flash. The device replies with either a MSG_FLASH_DONE message containing the return code FLASH_OK (0) on success, or FLASH_INVALID_LEN (2) if the maximum write size is exceeded. Note that the sector-containing addresses must be erased before addresses can be programmed.

sbp
: SBP
SBP parent object to inherit from.
target
: int
Target flags
addr_start
: array
Starting address offset to program
addr_len
: int
Length of set of addresses to program, counting up from

starting address

data
: array
Data to program addresses with, with length N=addr_len
sender
: int
Optional sender ID, defaults to SENDER_ID (see sbp/msg.py).
addr_len
addr_start
data
from_binary(d)[source]

Given a binary payload d, update the appropriate payload fields of the message.

static from_json(s)[source]

Given a JSON-encoded string s, build a message object.

static from_json_dict(d)[source]
target
to_binary()[source]

Produce a framed/packed SBP message.

to_json_dict()[source]
class sbp.flash.MsgFlashReadReq(sbp=None, **kwargs)[source]

Bases: sbp.msg.SBP

SBP class for message MSG_FLASH_READ_REQ (0x00E7).

You can have MSG_FLASH_READ_REQ inherit its fields directly from an inherited SBP object, or construct it inline using a dict of its fields.

The flash read message reads a set of addresses of either the

STM or M25 onboard flash. The device replies with a MSG_FLASH_READ_RESP message containing either the read data on success or a MSG_FLASH_DONE message containing the return code FLASH_INVALID_LEN (2) if the maximum read size is exceeded or FLASH_INVALID_ADDR (3) if the address is outside of the allowed range.

sbp
: SBP
SBP parent object to inherit from.
target
: int
Target flags
addr_start
: array
Starting address offset to read from
addr_len
: int
Length of set of addresses to read, counting up from

starting address

sender
: int
Optional sender ID, defaults to SENDER_ID (see sbp/msg.py).
addr_len
addr_start
from_binary(d)[source]

Given a binary payload d, update the appropriate payload fields of the message.

static from_json(s)[source]

Given a JSON-encoded string s, build a message object.

static from_json_dict(d)[source]
target
to_binary()[source]

Produce a framed/packed SBP message.

to_json_dict()[source]
class sbp.flash.MsgFlashReadResp(sbp=None, **kwargs)[source]

Bases: sbp.msg.SBP

SBP class for message MSG_FLASH_READ_RESP (0x00E1).

You can have MSG_FLASH_READ_RESP inherit its fields directly from an inherited SBP object, or construct it inline using a dict of its fields.

The flash read message reads a set of addresses of either the

STM or M25 onboard flash. The device replies with a MSG_FLASH_READ_RESP message containing either the read data on success or a MSG_FLASH_DONE message containing the return code FLASH_INVALID_LEN (2) if the maximum read size is exceeded or FLASH_INVALID_ADDR (3) if the address is outside of the allowed range.

sbp
: SBP
SBP parent object to inherit from.
target
: int
Target flags
addr_start
: array
Starting address offset to read from
addr_len
: int
Length of set of addresses to read, counting up from

starting address

sender
: int
Optional sender ID, defaults to SENDER_ID (see sbp/msg.py).
addr_len
addr_start
from_binary(d)[source]

Given a binary payload d, update the appropriate payload fields of the message.

static from_json(s)[source]

Given a JSON-encoded string s, build a message object.

static from_json_dict(d)[source]
target
to_binary()[source]

Produce a framed/packed SBP message.

to_json_dict()[source]
class sbp.flash.MsgM25FlashWriteStatus(sbp=None, **kwargs)[source]

Bases: sbp.msg.SBP

SBP class for message MSG_M25_FLASH_WRITE_STATUS (0x00F3).

You can have MSG_M25_FLASH_WRITE_STATUS inherit its fields directly from an inherited SBP object, or construct it inline using a dict of its fields.

The flash status message writes to the 8-bit M25 flash status

register. The device replies with a MSG_FLASH_DONE message.

sbp
: SBP
SBP parent object to inherit from.
status
: array
Byte to write to the M25 flash status register
sender
: int
Optional sender ID, defaults to SENDER_ID (see sbp/msg.py).
from_binary(d)[source]

Given a binary payload d, update the appropriate payload fields of the message.

static from_json(s)[source]

Given a JSON-encoded string s, build a message object.

static from_json_dict(d)[source]
status
to_binary()[source]

Produce a framed/packed SBP message.

to_json_dict()[source]
class sbp.flash.MsgStmFlashLockSector(sbp=None, **kwargs)[source]

Bases: sbp.msg.SBP

SBP class for message MSG_STM_FLASH_LOCK_SECTOR (0x00E3).

You can have MSG_STM_FLASH_LOCK_SECTOR inherit its fields directly from an inherited SBP object, or construct it inline using a dict of its fields.

The flash lock message locks a sector of the STM flash

memory. The device replies with a MSG_FLASH_DONE message.

sbp
: SBP
SBP parent object to inherit from.
sector
: int
Flash sector number to lock
sender
: int
Optional sender ID, defaults to SENDER_ID (see sbp/msg.py).
from_binary(d)[source]

Given a binary payload d, update the appropriate payload fields of the message.

static from_json(s)[source]

Given a JSON-encoded string s, build a message object.

static from_json_dict(d)[source]
sector
to_binary()[source]

Produce a framed/packed SBP message.

to_json_dict()[source]
class sbp.flash.MsgStmFlashUnlockSector(sbp=None, **kwargs)[source]

Bases: sbp.msg.SBP

SBP class for message MSG_STM_FLASH_UNLOCK_SECTOR (0x00E4).

You can have MSG_STM_FLASH_UNLOCK_SECTOR inherit its fields directly from an inherited SBP object, or construct it inline using a dict of its fields.

The flash unlock message unlocks a sector of the STM flash

memory. The device replies with a MSG_FLASH_DONE message.

sbp
: SBP
SBP parent object to inherit from.
sector
: int
Flash sector number to unlock
sender
: int
Optional sender ID, defaults to SENDER_ID (see sbp/msg.py).
from_binary(d)[source]

Given a binary payload d, update the appropriate payload fields of the message.

static from_json(s)[source]

Given a JSON-encoded string s, build a message object.

static from_json_dict(d)[source]
sector
to_binary()[source]

Produce a framed/packed SBP message.

to_json_dict()[source]
class sbp.flash.MsgStmUniqueIdReq(sbp=None, **kwargs)[source]

Bases: sbp.msg.SBP

SBP class for message MSG_STM_UNIQUE_ID_REQ (0x00E8).

You can have MSG_STM_UNIQUE_ID_REQ inherit its fields directly from an inherited SBP object, or construct it inline using a dict of its fields.

This message reads the device’s hardcoded unique ID. The host

requests the ID by sending a MSG_STM_UNIQUE_ID_REQ. The device responds with a MSG_STM_UNIQUE_ID_RESP with the 12-byte unique ID in the payload.

static from_json(s)[source]

Given a JSON-encoded string s, build a message object.

static from_json_dict(d)[source]
class sbp.flash.MsgStmUniqueIdResp(sbp=None, **kwargs)[source]

Bases: sbp.msg.SBP

SBP class for message MSG_STM_UNIQUE_ID_RESP (0x00E5).

You can have MSG_STM_UNIQUE_ID_RESP inherit its fields directly from an inherited SBP object, or construct it inline using a dict of its fields.

This message reads the device’s hardcoded unique ID. The host

requests the ID by sending a MSG_STM_UNIQUE_ID_REQ. The device responds with a MSG_STM_UNIQUE_ID_RESP with the 12-byte unique ID in the payload..

sbp
: SBP
SBP parent object to inherit from.
stm_id
: array
Device unique ID
sender
: int
Optional sender ID, defaults to SENDER_ID (see sbp/msg.py).
from_binary(d)[source]

Given a binary payload d, update the appropriate payload fields of the message.

static from_json(s)[source]

Given a JSON-encoded string s, build a message object.

static from_json_dict(d)[source]
stm_id
to_binary()[source]

Produce a framed/packed SBP message.

to_json_dict()[source]