How cavlihakki/cavliapplication works
The CavliApplication repository is a collection of embedded software projects targeting the Cavli Wireless C16QS module – with a focus on STM32‐based implementations (using the NUCLEO-G071RB board) as well as Arduino examples. The repository contains several individual projects (for example, CavliC16QSEVK-MQTT-1, CavliC16QSEVK-TCP-1, CavliC16QSEVK-TCP-2, and CavliC16QSEVK-GPIO7-1) that share common libraries (such as the CavliLib with module-specific functions defined in C16QS.h and Serial communications) and use the STM32CubeIDE folder structure with standard “Core”, “Drivers”, and “CavliLib” directories.
Overall Project Scope and Components
• There are basically two hardware platforms:
– STM32-based applications running on the NUCLEO-G071RB.
– Arduino-based applications running on Arduino Uno.
• For each STM32 project (MQTT, TCP, GPIO):
– Identify the MCU (the STM32G0 series on the Nucleo board) as the hardware processing unit.
– Identify that the “Core” folder holds the application logic (main loop, initialization, and system-level routines).
– The “Drivers” folder provides the Hardware Abstraction Layer (HAL) offered by ST, which encapsulates the low-level peripheral drivers (UART, GPIO, DMA, etc.).
– The “CavliLib” directory contains module-specific drivers and abstraction code (for instance, functions to configure MQTT connection parameters, TCP settings, or perform GPIO toggling) which serve as the middleware layer.
• The Arduino projects follow a similar pattern:
– They include basic sketches (in .ino files) that use either hardware serial/SoftwareSerial (note the AT command adjustments) and use logic similar to the STM32 cases.
• External network and peripheral resources:
– MQTT broker and TCP server are external components which the embedded application communicates with. The C16QS.h header file in CavliLib must be configured with the proper network addresses and ports.
– Additional documentation (in Dokumanlar and Documents folders) offers usage notes and configuration instructions.
Break Down the Architecture into Layers and Components
• Hardware Layer:
– STM32G0 MCU on the Nucleo board.
– External components such as the Cavli Wireless C16QS module.
– For Arduino, the Arduino Uno board along with its debug UART and any external connections (LEDs, GNSS antenna for GNSS variant).
• Low-Level Firmware / Device Drivers:
– ST Microelectronics’ HAL drivers (contained in Drivers/CMSIS and STM32G0xx_HAL_Driver).
• Middleware / Module-Specific Library:
– CavliLib includes common module-specific code to interface with the C16QS module (e.g., functions for MQTT, TCP, or generic GPIO manipulation).
• Application Layer:
– Each individual project’s Core folder is where the main application logic, initialization routines, interrupt service routines, and the task loop are implemented.
• External Communication:
– For MQTT projects: a connection is established to an external MQTT broker.
– For TCP projects: there is either a “normal” or “transparan” mode which interacts with an external TCP server.
• Development and Build Handling:
– Project configuration files (.cproject, .mxproject, .project, etc.) indicate the use of STM32CubeIDE (for STM32) and potentially Arduino IDE configurations for the Arduino sketches.
– “Core Application” (with main.c, initialization routines),
– “HAL Drivers” (as one component) on one side,
– “CavliLib” as the middleware connecting the core application with the physical module.
– The “Core” to the “HAL Drivers” (for peripheral access).
– The “Core” to “CavliLib” (for module-specific commands such as network or GPIO operations).
Architectural Patterns and Technologies
• The projects follow a layered or modular design which is common in embedded applications.
• They use a hardware abstraction paradigm (HAL) and further abstract away module specifics with a dedicated library (CavliLib).