Custom Tag Application

Our goal is to provide you with a top-down overview of writing custom tag applications within the Sewio UWB RTLS.

Following documentation is applicable for Tag Leonardo Firmware 3.127 or newer. 


Tag Firmware Architecture

Tag firmware is composed of several layers (bottom-top):

  1. Hardware Abstraction Layer (HAL) - contains low-level MCU drivers

  2. Drivers - contains an implementation of sensor code for given tag - like a barometer, radio, EEPROM memory, etc.

  3. Sewio Main APP - this is the main code that implements the core behavior

  4. Apps - is a dedicated layer where your custom code should be placed. The layers correspond to the project folder structure on the right side.

Tag Firmware Architecture

Application Design Approach

Your application runs as bare-metal C code on the top of the Sewio Main App.

  • The application entry point is done via a custom function callback:
    • The callback is called quasi periodically with blink period
      • This solution was chosen to deliver the lowest power consumption and the lowest complexity. Quasi is referring to fact that the blink period uses random deviation to satisfy Aloha’s medium access control mechanism.
    • The application behavior should be implemented as an event-driven state machine
    • Source of change in state machine could be driven by the following events:
      • time - one should use a non-blocking application timer
      • communication exchange via UWB - one can send or receive data from UWB
      • user-input - GPIO, IRQ, etc.

Tag FW structure: