MMP » Historie » Version 13
  Maximilian Seesslen, 09.09.2024 18:07 
  
| 1 | 1 | Maximilian Seesslen | h1. Multipacket-Strings  | 
|---|---|---|---|
| 2 | |||
| 3 | There should be the posssibillity to write the complete SPI-Flash even if it takes forever.  | 
||
| 4 | Not every slave needs to be able to send super big blocks. But every slave should be able to  | 
||
| 5 | send e.g. descriptions.  | 
||
| 6 | There can not be multiple transfers at the same time from one node because there is no identification.  | 
||
| 7 | 11 | Maximilian Seesslen | All slaves should be able to send description to multicast. Receiver should be able to sort messages.  | 
| 8 | 12 | Maximilian Seesslen | First packet can contain flags so information about acknowledge is given.  | 
| 9 | 1 | Maximilian Seesslen | |
| 10 | 11 | Maximilian Seesslen | |_. Size |_. Type |  | 
| 11 | | 0x1 | Package number (0: Data contains package count), overflowing |  | 
||
| 12 | | 0x3 | Source |  | 
||
| 13 | | 0x4 | Data |  | 
||
| 14 | 1 | Maximilian Seesslen | |
| 15 | h2. Header  | 
||
| 16 | |||
| 17 | |_. Size |_. Type |  | 
||
| 18 | 2 | Maximilian Seesslen | | 0x4 | Object |  | 
| 19 | 1 | Maximilian Seesslen | | 0x4 | Total size |  | 
| 20 | 2 | Maximilian Seesslen | | 0x4 | Flags |  | 
| 21 | 1 | Maximilian Seesslen | | 0x4 | CRC32 of data |  | 
| 22 | |||
| 23 | h2. Example: CANRec  | 
||
| 24 | |||
| 25 | PC requests an complete dump from single Node. Node will just stream it out.  | 
||
| 26 | |||
| 27 | h1. V2  | 
||
| 28 | |||
| 29 | |_. Size |_. Decription |_. Examples |  | 
||
| 30 | | 1 | Packet type | Standard TDT packet |  | 
||
| 31 | | 1 | Sub-Id; | Futher index; Sub-Sensor or more specifi kind of thing to be set |  | 
||
| 32 | | 1 | Data type | Int, Float, Time, Date, Percent, Promil, Multipacket-String |  | 
||
| 33 | | 1 | Unit | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room |  | 
||
| 34 | | 4 | Value | 32Bit |  | 
||
| 35 | |||
| 36 | h1. V3  | 
||
| 37 | |||
| 38 | |_. Size |_. Decription |_. Examples |  | 
||
| 39 | | 2 | Object | |  | 
||
| 40 | | 1 | Sub-Id; | Flags, Subid |  | 
||
| 41 | | 1 | Unit/Type | Hz_int, °C_centi, Time, Date, PWM_milli, CAN-ID, Name, Description, Room |  | 
||
| 42 | | 4 | Value | 32Bit |  | 
||
| 43 | |||
| 44 | h2. Flags  | 
||
| 45 | |||
| 46 | 4 Bit multi message count  | 
||
| 47 | 4 Bit multi message pos  | 
||
| 48 | |||
| 49 | Length in Bytes given via CAN?  | 
||
| 50 | Strings with max. 64 characters.  | 
||
| 51 | |||
| 52 | h2. Multimessage package  | 
||
| 53 | |||
| 54 | There should be the possibillity to write the complete SPI-Flash even if it takes forever.  | 
||
| 55 | Not every slave needs to be able to send super big blocks. But every slave should be able to  | 
||
| 56 | send e.g. descriptions.  | 
||
| 57 | 3 | Maximilian Seesslen | |
| 58 | h1. V4  | 
||
| 59 | |||
| 60 | 8 | Maximilian Seesslen | Single block max.262144 bytes.  | 
| 61 | |||
| 62 | 3 | Maximilian Seesslen | |_. Size |_. Decription |_. Examples |  | 
| 63 | | 2 | Object | |  | 
||
| 64 | | 2 | Counter | |  | 
||
| 65 | | 4 | Value | 32Bit |  | 
||
| 66 | |||
| 67 | The data has to be stored in memory anyways. So one block can not be infinite large.  | 
||
| 68 | Flash has to be written block by block. One erase sektor can be 2K. Limiting the packet size to 64K is ok for writing to flash.  | 
||
| 69 | 4 | Maximilian Seesslen | Object: theoretically multiple blocks could be written at the same time. A slave could just send its whole SD-card.  | 
| 70 | 6 | Maximilian Seesslen | |
| 71 | h2. Header  | 
||
| 72 | |||
| 73 | 13 | Maximilian Seesslen | First 0x20 Bytes / 0x8 packages are the Block-Header.  | 
| 74 | 6 | Maximilian Seesslen | |
| 75 | 1 | Maximilian Seesslen | |_. Size |_. Type |  | 
| 76 | 13 | Maximilian Seesslen | | 0x2 | Type; MMP1 |  | 
| 77 | | 0x1 | Flags |  | 
||
| 78 | | 0x1 | Reserved |  | 
||
| 79 | 12 | Maximilian Seesslen | | 0x4 | Total Size of this block |  | 
| 80 | 1 | Maximilian Seesslen | | 0x4 | CRC32 of data |  | 
| 81 | 12 | Maximilian Seesslen | | 0x4 | Header version code |  | 
| 82 | 1 | Maximilian Seesslen | | 0x4 | Command |  | 
| 83 | | 0x4 | Address |  | 
||
| 84 | 13 | Maximilian Seesslen | | 0x4 | Operation Size (e.g. erase) |  | 
| 85 | | 0x4 | - |  | 
||
| 86 | 12 | Maximilian Seesslen | | ... | Data |  | 
| 87 | 9 | Maximilian Seesslen | |
| 88 | Commands:  | 
||
| 89 | - readout data  | 
||
| 90 | - erase application flash  | 
||
| 91 | - erase flash sector  | 
||
| 92 | 7 | Maximilian Seesslen | - erase external flash  | 
| 93 | - erase external flash sector  | 
||
| 94 | - write data  | 
||
| 95 | |||
| 96 | 6 | Maximilian Seesslen | Subaddress: e.g. flash page  | 
| 97 | Type: MMP1  | 
||
| 98 | |||
| 99 | h2. Usecase  | 
||
| 100 | |||
| 101 | h3. Write to flash  | 
||
| 102 | |||
| 103 | 1 | Maximilian Seesslen | Data size is 0x100.  | 
| 104 | Count of blocks: 1  | 
||
| 105 | Number of blocks: 1  |