Replies: 2 comments
-
|
@bruno-f-cruz @filcarv @Poofjunior tagging for awareness. Feel free to leave any comments, otherwise I will reconcile as stated in the upcoming PRs which will finalize the protocol v2. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Sounds good to me provided we reserve the bit for future use in the device specification. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Two proposals in the 2.0.0 milestone allocate their flag to the same bit in the
MessageTypefield of the 8-bit binary protocol. TheExtendedLengthproposal at #218 allocates its flag to bit 4, mask0x10. The scheduled-execution proposal at #15 allocates itsCancellationflag to the same bit. Since 2.0.0 is aiming to be a clean break, we need to settle the bit allocation now rather than discover the collision during firmware implementation. This post records the finding, including a survey of deployed core firmware, both stable releases and prototypes, and a proposed resolution.The finding
The
MessageTypefield currently uses bits 0 and 1 forTypeand bit 3 forError. The conflicting flags are placed at bit 4. These two flags are orthogonal and can occur together, for example canceling a scheduled extended-length write, so they cannot share a bit. One of them has to move.What has been deployed in core firmware
We checked whether any released firmware or client already uses
0x10, because that would constrain the decision. The good news is that there is no clash yet in either firmware or clients over this bit.Cancellationflag to0x10, but it is not in any release. The latest published package isBonsai.Harp3.6.1.MessageTypebit, and it does not implement cancellation. So no fielded ATxmega device uses0x10.ExtendedLengthreference implementation, Extended-length register write support AllenNeuralDynamics/harp.core.pico#7, uses bit0x10forExtendedLength.The conclusion is that the conflict is entirely at the proposal stage. We can reconcile it with zero backward-compatibility impact on any device already in the field.
Proposed resolution
We propose two changes:
ExtendedLengthkeeps bit 4, mask0x10. It already has written specification text in Add ExtendedLength flag to the binary protocol #218 and a working reference implementation in Extended-length register write support AllenNeuralDynamics/harp.core.pico#7.Cancellationflag moves to bit 5, mask0x20. The only artifact that assigns it to0x10is the unmerged client change above, so this needs a single edit before that change is released and breaks nothing.Current bit-allocation
This is the current status of bit-allocation on the
MessageTypebyte after the changes proposed in 2.0.0. See the MessageType field in the current 8-bit binary protocol for the present definition. If this additional information would be useful to support discussion, we could consider extending the current table layout.0x03Type0x040x08Error0x10ExtendedLength0x20Cancellation0x400x80Flag32in the future 32-bit protocolBits 2 and 6 stay available for future flags, and bit 7 stays reserved so the 8-bit and 32-bit protocols do not collide.
What this means for each core
For the core.pico stack, nothing changes. The
ExtendedLengthreference implementation keeps0x10exactly as written. No rework is needed.For the core.atxmega stack, no fielded firmware is affected, because the released delayed-commands feature never used a
MessageTypeflag bit. The one point to be aware of is forward-looking. When scheduled-command cancellation is implemented on this stack in the future, it must use0x20, not0x10. We will update the specification to reserve0x20for cancellation.Related semantic interaction to track separately
This is not part of the bit allocation, but it comes up in the same comparison and should be written down somewhere. ATxmega firmware 1.14 and 1.15 already interpret any timestamped controller-to-device message as a scheduled command.
ExtendedLengthwrites also carry timestamps. The specification therefore needs to state whether a timestampedExtendedLengthwrite is scheduled for its timestamp or executed immediately. We suggest resolving this in the device-operation conventions at #221 rather than here.Related issues
Beta Was this translation helpful? Give feedback.
All reactions