The GeneralSerialByteProtocol consists of:
- a definition for a package based communication protocol suitable for data streams like UART / virtual COM ports and so on,
- a C module for microcontrollers (mostly used/tested with STM32 microcontrollern) implementing this protocol and providing abstracted functions for sending and receiving data,
- a C++ class for PC programs to send commands to connected devices and receive there data/responses.
The basic layout of the default GSBP package looks like:
|StartByte|CMD (low)|Request ID|N Bytes (low)|[N Bytes (high)]|[ Payload[0] ... Payload[N] ]|[EndByte]
The complete definition of the protocol and its features is available in the documentation folder.
The C module for microcontrollers can be found in the MCU_code folder.
The design goals for the GSBP MCU functions are:
- use of the hardware features (DMA) for blocking and non-blocking receiving and sending of data,
- easy integration into multiple projects while maintainable, so that new features and bugfixes are easily distributed to the different projects,
- abstract and universal implementation with user friendly API functions and workflow, and
- good performance and low overhead.
An examples on how to setup and use the module can be found in the examples folder with the two MCU examples:
- GSBP_DevDummy__MCU_L432_UART which uses a UART interface and the UART<->USB feature of the Nucleo-L432KC board and
- GSBP_DevDummy__MCU_L432_USB which uses the USB interface of the STM32L432 MCU featured by the Nucleo-L432KC board.
The class files for the general interface class can be found in the PC_code folder.
The similar design goals are:
- easy integration into own projects while maintainable, so that new features and bugfixes are easily distributed to the different projects,
- abstract and universal implementation with user friendly API functions and workflow, and
- good performance and low overhead.
While the MCU functions can be used directly, the C++ class is not directly usable. Instead, the class should be used to implement the project specific interface class, where the different commands and the project specific workflow is implemented.
An example / reference implementation can be found in the examples folder.
- checksums do not work properly
- implement hardware based checksums on the STM32