Projekt

Allgemein

Profil

MMP » Historie » Version 6

Maximilian Seesslen, 30.08.2023 16:19

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
8
|_. Size    |_. Type                                           |
9
| 0x4       | Package number (0: Data contains package count)  |
10
| 0x4       | Data                                             |
11
12
h2. Header
13
14
|_. Size    |_. Type           |
15 2 Maximilian Seesslen
| 0x4       | Object           |
16 1 Maximilian Seesslen
| 0x4       | Total size       |
17 2 Maximilian Seesslen
| 0x4       | Flags            |
18 1 Maximilian Seesslen
| 0x4       | CRC32 of data    |
19 2 Maximilian Seesslen
20 1 Maximilian Seesslen
h2. Example: CANRec
21
22
PC requests an complete dump from single Node. Node will just stream it out.
23
24
25
h1. V2
26
27
|_. Size |_. Decription |_. Examples                                                       |
28
| 1      | Packet type  | Standard TDT packet                                              |
29
| 1      | Sub-Id;      | Futher index; Sub-Sensor or more specifi kind of thing to be set |
30
| 1      | Data type    | Int, Float, Time, Date, Percent, Promil, Multipacket-String      |
31
| 1      | Unit         | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room         |
32
| 4      | Value        | 32Bit                                                            |
33
34
h1. V3
35
36
|_. Size |_. Decription |_. Examples                                                               |
37
| 2      | Object       |                                                                          |
38
| 1      | Sub-Id;      | Flags, Subid                                                             |
39
| 1      | Unit/Type    | Hz_int, °C_centi, Time, Date, PWM_milli, CAN-ID, Name, Description, Room |
40
| 4      | Value        | 32Bit                                                                    |
41
42
h2. Flags
43
44
4 Bit multi message count
45
4 Bit multi message pos
46
47
Length in Bytes given via CAN?
48
Strings with max. 64 characters.
49
50
h2. Multimessage package
51
52
There should be the possibillity to write the complete SPI-Flash even if it takes forever.
53
Not every slave needs to be able to send super big blocks. But every slave should be able to
54
send e.g. descriptions.
55 3 Maximilian Seesslen
56
h1. V4
57
58
|_. Size |_. Decription |_. Examples                                                               |
59
| 2      | Object       |                                                                          |
60
| 2      | Counter      |                                                                          |
61
| 4      | Value        | 32Bit                                                                    |
62
63
The data has to be stored in memory anyways. So one block can not be infinite large.
64
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.
65 4 Maximilian Seesslen
Object: theoretically multiple blocks could be written at the same time. A slave could just send its whole SD-card.
66 6 Maximilian Seesslen
67
h2. Header
68
69
First 0x20Bytes are the Block header.
70
71
|_. Size    |_. Type                          |
72
| 0x4       | CRC32 of data                   |
73
| 0x4       | Size of this block without head |
74
| 0x4       | Flags                           |
75
| 0x4       | Count of blocks                 |
76
| 0x4       | Number of this block            |
77
| 0x4       | Type                            |
78
| 0x4       | reserved                        |
79
| 0x4       | reserved                        |
80
81
h2. Usecase
82
83
h3. Write to flash
84
85
Data size is 0x100. 
86
Count of blocks: 1
87
Number of blocks: 1