Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  protocol.rs

  Sprache: Rust
 

use num_enum::{IntoPrimitive, TryFromPrimitive};
use strum_macros::{EnumString, EnumVariantNames};

pub const START_BYTE: u8 = 0x5A;

// The default, minimum-required max packet size for any bootrom appears to be 32 bytes: (a command
// packet with 7 parameters).
//
// RT500RM 18.7.2.6.5 Command packet:
// "Parameters: The parameters are word-length (32 bits). With the default maximum packet size of
// 32 bytes, a command packet can contain up to 7 parameters."
//
// RT500RM 18.7.2.11.1.3 HID Reports:
// "minimum boot ROM packet size of 32 bytes"
pub const MIN_MAX_PACKET_SIZE: usize = 32;

// RT500RM 18.7.2.6.3 Framing packet
pub const FRAMING_HEADER_SIZE: usize = 6;

#[derive(Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
#[repr(u8)]
pub enum FramingPacketType {
    /// The previous packet was received successfully; the sending of more packets is allowed.
    Ack = 0xA1,

    /// The previous packet was corrupted and must be re-sent.
    Nak = 0xA2,

    /// Data phase is being aborted.
    AckAbort = 0xA3,

    /// The framing packet contains a command packet payload.
    Command = 0xA4,

    /// The framing packet contains a data packet payload.
    Data = 0xA5,

    /// Sent to verify the other side is alive. Also used for UART autobaud.
    Ping = 0xA6,

    /// A response to Ping; contains the framing protocol version number and options.
    PingResponse = 0xA7,
}

pub const COMMAND_MAX_PARAMS: usize = 7;

pub const COMMAND_FLAG_HAS_DATA: u8 = 1 << 0;

#[derive(Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
#[repr(u8)]
pub enum CommandTag {
    // RT500RM Table 104. Command Tags
    FlashEraseAll = 0x01,
    FlashEraseRegion = 0x02,
    ReadMemory = 0x03,
    WriteMemory = 0x04,
    FillMemory = 0x05,
    GetProperty = 0x07,
    ReceiveSbFile = 0x08,
    Execute = 0x09,
    Call = 0x0A,
    Reset = 0x0B,
    SetProperty = 0x0C,
    EfuseProgram = 0x0E,
    EfuseRead = 0x0F,
    ConfigureMemory = 0x11,
    KeyProvision = 0x15,
}

#[allow(clippy::enum_variant_names)] // We want to use the names from the manual.
#[derive(Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
#[repr(u8)]
pub enum ResponseTag {
    // RT500RM Table 105. Response Tags
    GenericResponse = 0xA0,
    ReadMemoryResponse = 0xA3,
    GetPropertyResponse = 0xA7,
    FlashReadOnceResponse = 0xAF,
    KeyProvisionResponse = 0xB5,
}

#[derive(
    Clone, Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimitive, EnumString, EnumVariantNames,
)]
#[repr(u32)]
pub enum PropertyTag {
    // RT500RM 18.7.2.7.17 Supported properties in GetProperty and SetProperty
    CurrentVersion = 1,
    AvailablePeripherals = 2,
    FlashStartAddress = 3,
    FlashSizeInBytes = 4,
    FlashSectorSize = 5,
    AvailableCommands = 7,
    CRCCheckStatus = 8,
    VerifyWrites = 10,
    MaxPacketSize = 11,
    // kReservedRegions = ??,
    RAMStartAddress = 14,
    RAMSizeInBytes = 15,
    SecurityState = 17,
    UniqueDeviceId = 18,
    TargetVersion = 24,
    FlashPageSize = 27,
    IrqNotifierPin = 28,
}

Messung V0.5 in Prozent
C=93 H=95 G=93

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-28) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik