SDAA116 October   2025 CC2340R5

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
    1. 1.1 CC2340R5
    2. 1.2 DRV8251A
    3. 1.3 BDC Motor
    4. 1.4 TMAG5213
  5. 2BDC Application
    1. 2.1 Hardware Setup
      1. 2.1.1 DRV8251AEVM Settings
    2. 2.2 Connection Diagram
  6. 3Running the Example
    1. 3.1 Dependencies
    2. 3.2 Loading Firmware
    3. 3.3 Zigbee Network Formation
  7. 4Firmware Design
    1. 4.1 Code Flow Description
    2. 4.2 LaunchPad Button Functionality
    3. 4.3 Non-Volatile Memory
    4. 4.4 Bidirectional PWM Motor Control
    5. 4.5 ADC Overcurrent Protection Feature
    6. 4.6 Hall-Effect Based Motor Position Tracking Feature with Configurable Endpoints
    7. 4.7 Logging Functionality
    8. 4.8 Interoperability with Third-Party Smart Hub Devices
  8. 5Tests and Results
    1. 5.1 PWM and Hall-effect Signal Analysis
    2. 5.2 Power Consumption Analysis with EnergyTrace™
  9. 6Summary
  10. 7References

Logging Functionality

The optional logging feature serves as a useful debugging tool in this BDC motor application, providing real-time visibility into system operation through the UART log sink. The implementation uses a structured logging system with different severity levels (DEBUG, VERBOSE, INFO, WARNING, ERROR) to categorize messages based on importance. During motor operations, key events are logged with timestamps, such as motor start/stop actions, current measurements, position updates, and fault conditions such as overcurrent detection. This logging capability proves invaluable during development and troubleshooting, as this provides insights into the timing of operations, the sequence of events during motor control, and the specific conditions that can trigger protection mechanisms. The log sink can be enabled or disabled at compile time through configuration settings, allowing developers to include comprehensive debugging information during development while removing logging overhead for production releases to optimize performance and reduce code size. See Logging with the SimpleLink F3 SDK for more information.