Skip to content

Commit ae9b180

Browse files
committed
Fix success/fail diagram for Long Write.
1 parent e12f600 commit ae9b180

File tree

1 file changed

+27
-9
lines changed

1 file changed

+27
-9
lines changed

neotron-bmc-protocol/README.md

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Note over Host, NBMC: NBMC says no.
136136

137137
A *Short Write Request* consists of four 8-bit values:
138138

139-
* A *Type* byte of `0xC2` marking this as a *Short Write Request*.
139+
* A *Type* byte of `0xC2` or `0xC3` marking this as a *Short Write Request*.
140140
* A *Register#*, indicating which register within the *NBMC* the *Host* wishes to write to.
141141
* A *Data Byte*, which is to be written to the given *Register#*.
142142
* A *CRC*, which is the CRC-8 of the proceeding three bytes.
@@ -169,7 +169,7 @@ Note over Host, NBMC: NBMC is happy.
169169

170170
A *Long Write Request* consists of four 8-bit values:
171171

172-
* A *Type* byte of `0xC2` marking this as a *Short Write Request*.
172+
* A *Type* byte of `0xC4` or `0xC5` marking this as a *Long Write Request*.
173173
* A *Register#*, indicating which register within the *NBMC* the *Host* wishes to write to.
174174
* A *Length*, which is the number of payload bytes to follow in the subsequent *Long Write Payload*.
175175
* A *CRC*, which is the CRC-8 of the proceeding three bytes.
@@ -179,7 +179,7 @@ Request](#short-write-request--response-sequence)
179179

180180
If a *Short Response* is received containing a *Response Result* of **OK**
181181
(`0xA0`), the *NBMC* is ready to receive a *Long Write Payload*. If any other
182-
*Response Result* is received, the *Long Write Payload* must not be send and
182+
*Response Result* is received, the *Long Write Payload* must not be sent and
183183
`nCS` must be raised to indicate the end of the transaction.
184184

185185
A *Long Write Payload* consists of a variable number of 8-bit values:
@@ -213,9 +213,32 @@ Note over Host, NBMC: Five bytes are sent
213213
214214
NBMC->>NBMC: Checks CRC
215215
216+
NBMC->>Host: Response(OK)
217+
218+
Note over Host, NBMC: NBMC is happy.
219+
```
220+
221+
#### Example of Failure
222+
```mermaid
223+
sequenceDiagram
224+
225+
Host->>NBMC: LongWriteRequest(16, 5)
226+
Note over Host, NBMC: Prepare to write 5 bytes to Register 16
227+
228+
NBMC->>NBMC: Thinks for while
229+
230+
NBMC->>Host: Response(OK)
231+
232+
Note over Host, NBMC: NBMC is ready to take 5 bytes.
233+
234+
Host->>NBMC: LongWritePayload([0, 1, 2, 3, 4])
235+
Note over Host, NBMC: Five bytes are sent
236+
237+
NBMC->>NBMC: Checks CRC
238+
216239
NBMC->>Host: Response(CrcFailure)
217240
218-
Note over Host, NBMC: NBMC is sad. The five bytes<br/>must have been corrupted as their CRC didn't match.
241+
Note over Host, NBMC: NBMC is sad. The five bytes<br/>must have been corrupted as their CRC didn't<br/>match. Host must raise `nCS` and try again.
219242
```
220243

221244
### Cancelling
@@ -234,8 +257,3 @@ This code is licenced under the Blue Oak Model License 1.0.0. See:
234257

235258
Our intent behind picking this licence is to allow this code to be freely
236259
reused, both in open-source and commercially licensed products.
237-
238-
Note that this firmware image incorporates a number of third-party modules. You
239-
should review the output of `cargo tree` and ensure that any licence terms for
240-
those modules are upheld. You should also be aware that this application was
241-
based on the Knurling Template at https://github.com/knurling-rs/app-template.

0 commit comments

Comments
 (0)