EasyManua.ls Logo

Curtiss-Wright DuraCOR 311 - Appendix A Onboard Microcontroller Functions; USB Serial Communication Protocol; Protocol Buffers; BIT Status Via Protocol Buffers

Curtiss-Wright DuraCOR 311
72 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
DuraCOR 311
Appendix A Onboard Microcontroller
Functions
MNL-0667-01 Rev B2
ECO-5941
Effective: 17 Mar 20
Appendix A Onboard Microcontroller
Functions
The onboard microcontroller provides low level logic for monitoring and configuring the system
independent of the main CPU. It is connected to the main processor internally via USB, and exposes a
USB Serial adapter to the CPU. The USB serial interface relies on standard drivers and should work out
of the box on most operating systems. The protocol for communicating with the USB Serial port is
protocol buffers wrapped with a header described below.
USB Serial Communication Protocol
At the lowest level, the protocol is the following:
Table 15: USB Serial Protocol
Byte
Description
Value
0,1,2,3
Magic Number
0xBADBEEF0
4,5
Message Length, does not include Magic, length or CRC
16 bit unsigned
6..n
Encoded Protocol Buffer
Varies
n+1,n+2,
n+3,n+4
CRC32 of bytes 6..n
Varies
The contents of the protocol buffer are defined by the protocol buffer spec, which is available as part of
the customer releasable source for the project. See SFT-0671-05.
Protocol Buffers
Protocol buffers are a standardized cross platform serialization protocol initially developed by Google.
They are designed to be light weight, while maintaining backward compatibility as the protocol evolves
over the life of the project. To learn more about protocol buffers in general, or the specific implementation
used on the microcontroller, see https://github.com/nanopb/nanopb.
BIT Status via Protocol Buffers
BIT information is available via the “Bit_Status” message, which is a field of “Message”. Only optional
fields comprise this message. To retrieve BIT status from the microcontroller, encode a protocol buffer
that has the “has_bit_status” field of “Message” asserted, and encode it using any protocol buffer library.
Send it to the microcontroller via the USB Serial port with the extra information as described in the
previous section. The microcontroller will respond with a “Message” that has the “Bit_Status” sub
message populated. The protocol definition and example code is available in the embedded zip below.
libdbhbit.zip

Table of Contents