Skip to content

worldwidemv/GSBP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The GeneralSerialByteProtocol - GSBP

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.

Package Structure and Protocol Definition

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.

C module for microcontrollers

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:

C++ Class for PC Programs

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.

TODOs / Known Bugs

  • checksums do not work properly
  • implement hardware based checksums on the STM32

About

GeneralSerialByteProtocol for STM32 MCUs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published