Logo
SPARK Microsystems SDK v2.0.0
  • Introduction
  • Features
  • Getting Started
    • Preferred Integrated Development Environment (IDE)
    • Prerequisites
      • VS Code Extensions
      • Hardware
      • Windows Long Path Support
        • Through Group Policy
        • Through Windows Registry
    • Create the Virtual Environment with VS Code
    • Bootstrap the Virtual Environment Manually (optional)
    • Activate the Virtual Environment Without VS Code (optional)
    • Building Applications
    • Debugging with ST-Link Debug Probes
    • Viewing the Terminal
    • Time to Explore
  • Structure Overview
  • Hardware Description
  • Applications
    • Example
      • Hello World
        • Description
        • Behavior
          • Application Schedule
          • Pairing
          • Board User Interface
        • Configuration
          • Dual Radio
        • Terminal
      • Hello World RTOS
        • Description
        • Behavior
          • Application Schedule
          • Pairing
          • Board User Interface
        • Terminal
      • Star Network
        • Description
        • Behavior
          • Application Schedule
          • Pairing
          • Coordinator User Interface
          • Node 1 User Interface
          • Node 2 User Interface
        • Terminal
      • Connection Priority
        • Description
        • Behavior
          • Application Schedule
          • Pairing
          • Data exchange
            • Link Capacity Utilization
          • Coordinator User Interface
          • Node User Interface
        • Terminal
      • Audio Unidirectional
        • Description
        • Behavior
          • Application Schedule
          • Pairing
          • Fallback
          • Clock Drift Compensation (CDC)
          • Coordinator User Interface
          • Node User Interface
        • Certification
        • Terminal
      • Audio Bidirectional
        • Description
        • Behavior
          • Application Schedule
          • Pairing
          • Fallback
          • Clock Drift Compensation (CDC)
          • Board User Interface
        • Certification
        • Terminal
      • Fragmentation
        • Description
          • Fragmentation
          • Auto-Reply
        • Application Data Flow
        • Behavior
          • Application Schedule
          • Pairing
          • Board User Interface
        • Terminal
      • Datalink
        • Description
        • Behavior
          • Application Schedule
          • Pairing
          • Coordinator User Interface
          • Node User Interface
        • Terminal
  • Cores
    • Audio Core
      • Introduction
      • End-User Application
      • Audio Core Components
        • Audio Pipeline
        • Audio Endpoint
        • Audio Processing Stage
          • Clock Drift Compensation
          • Audio Compression
          • Digital Volume Control
          • Sampling Rate Converter
          • Mute Packet
          • Mute on Underflow
          • Audio Packing
        • Audio Header
        • Audio Module
          • Audio Mixer
          • Audio Fallback
    • Wireless Core
      • Introduction
      • Concepts
        • Time Division Multiple Access
        • Network
        • Schedule
        • Frequency Switching
        • Addressing
          • PAN ID
          • Node Address
          • PAN Broadcast
        • Connection
        • Channel
        • Stream Types
        • Auto-Reply
        • Timeslot Events
          • Main Frame Transmission
          • Auto-Replied ACK
          • Auto-Replied Payload
        • Synchronization Methods
          • Standard Sync
          • Fast Sync
        • Dual Radio
          • Hardware Requirements
          • Certification
        • Topology
          • Star Network Topology
          • Peer-to-Peer Network Topology
          • Cluster Tree Network Topology
        • Concurrency
          • Personal Area Network ID (PAN ID)
          • Channel Sequence Randomization
          • Clear Channel Assessment (CCA)
          • Random Datarate Offset Protocol (RDO)
          • Distributed De-Synchronization Concurrency Algorithm (DDCM)
        • Sleep Modes
        • Modulation
        • Symbol Averaging / Chip Repetition
        • Forward Error Correction (FEC) Ratio
        • Inter-Symbol Interference (ISI) mitigation
        • Over-The-Air Chip Rate
        • Stop and Wait
        • Credit-Based Flow Control
        • Frame Fragmentation
        • Fallback Mode
        • Link Throttling
          • Limitations
          • Complete Example
        • Connection Priority
        • Latency optimization
        • Frame Structure
          • Data frames
          • Sync frames
          • Acknowledgement frames
          • Header Configuration
          • Certification mode
        • Data Validation
          • CRC
          • Address filtering
          • Syncword match
          • Max frame size
      • MCU Requirements
        • MCU Footprint
          • Memory
          • CPU
      • Schedule Design Consideration
        • Bandwidth
        • Retransmission Margin
        • Sync Timeslot (Beacon)
        • Concurrency Considerations
        • Latency Calculation
        • Case Study: Latency Evaluation of an Application
        • Schedule Design Trade-off
      • Power Saving Strategies
      • Pairing Module
        • Description
          • Pairing Usage
          • Pairing Configuration
          • Pairing Assigned Address
          • Pairing Discovery List
          • Device Role
          • Pairing Error
          • Pairing Events
          • Pairing Application Callback
          • Pairing Abort
          • Timeout
          • Application Code
          • Unique ID
          • Pairing Address Generation
        • Pairing Procedure
          • Pairing Phases
          • Authentication Phase
          • Identification Phase
          • Addressing phase
        • Pairing Module Wireless Configuration
  • API Reference
    • Audio Core API
      • Initialization
        • Audio Core Configuration
        • Audio Pipeline Configuration
        • Audio Endpoint Configuration
      • Hardware Abstraction Layer
      • Statistics
      • Reference
        • sac_api.h
        • sac_error.h
        • sac_stats.h
        • sac_utils.h
    • Wireless Core API
      • Initialization
        • Wireless Core Configuration
          • timeslot_sequence
          • timeslot_sequence_length
          • channel_sequence
          • channel_sequence_length
          • concurrency_mode
          • memory_pool
          • memory_pool_size
          • Configure Concurrency
            • random_channel_sequence_enabled
            • rdo_enabled (Core)
            • ddcm_enabled
        • Wireless Node Configuration
          • role
          • pan_id
          • coordinator_address
          • local_address
        • Wireless Radio Module Initialization
          • Calibration
          • irq_polarity
          • std_spi
        • Wireless Connection Configuration
          • name
          • source_address
          • destination_address
          • max_payload_size
          • queue_size
          • timeslot_id
          • timeslot_count
          • credit_flow_ctrl_enabled
        • Wireless Beacon Connection Configuration
        • Wireless Channel Configuration
          • frequency
          • tx_pulse_count
          • tx_pulse_width
          • tx_pulse_gain
          • rx_pulse_count
        • Enable Fast Synchronization
        • Enable Certification mode
        • Configure Sleep Level
          • Configure FEC Ratio
          • Configure Modulation
          • Configure Auto Synchronization
          • Configure Latency Optimization
          • Configure Fragmentation
          • Configure Throttling
        • Enable Connection Priority
          • Configure Acknowledgement
          • Configure Retransmissions
          • Configure Clear Channel Assessment
            • swc_connection_concurrency_cfg.enabled
            • swc_connection_concurrency_cfg.try_count
            • swc_connection_concurrency_cfg.retry_time
            • swc_connection_concurrency_cfg.fail_action
        • Configure Fallback
          • enable
          • fallback_mode_count
          • threshold
          • cca_try_count
          • swc_connection_add_fallback_channel
        • Wireless Status
      • Callbacks
        • TX Success
        • TX Fail
        • TX Dropped
        • RX Success
        • Event Callback
          • Connect Event
          • Disconnect Event
          • Error Event
        • Low Power Callback
      • Sending Data
      • Receiving Data
      • Statistics
      • Radio NVM
        • Formatted Output
        • Serial Number
        • Product Model
        • Product Version
      • Low Power Mode
      • References
        • swc_api.h
        • swc_error.h
        • swc_stats.h
        • swc_utils.h
    • EVK1.4 BSP
      • Introduction
      • Reference
        • evk.h
        • evk_audio.h
        • evk_button.h
        • evk_clock.h
        • evk_dbg.h
        • evk_flash.h
        • evk_it.h
        • evk_led.h
        • evk_power.h
        • evk_radio.h
        • evk_timer.h
        • evk_uart.h
        • evk_usb.h
    • Quasar BSP
      • Introduction
      • Reference
        • quasar.h
        • quasar_adc.h
        • quasar_audio.h
        • quasar_button.h
        • quasar_clock.h
        • quasar_debug.h
        • quasar_dma.h
        • quasar_fifo.h
        • quasar_gpio.h
        • quasar_i2c.h
        • quasar_it.h
        • quasar_led.h
        • quasar_memory.h
        • quasar_power.h
        • quasar_pwm.h
        • quasar_radio.h
        • quasar_rgb.h
        • quasar_spi.h
        • quasar_timer.h
        • quasar_timer_ext.h
        • quasar_uart.h
        • quasar_usb.h
  • Development Environment
    • Prerequisites
    • Recommended Extensions
    • Creating a New Application Alongside the Example Applications
    • Build System
      • CMake External Resources
  • Porting Guide
    • Articles
      • Project Guidelines
        • Best Practices
        • Advantages
      • Hardware Platform Requirements
        • MCU Resources
        • MCU Performance
      • Facades and Backends
        • Facades
        • Backends
        • Working with Facades and Backends
          • List of Components with Facades
          • Hello-World Porting Example
        • CMake Architecture and Dependencies
      • SPARK Wireless Core
        • Implement the backend
          • Context Switching and Interrupt Management
          • SPI Communication
          • GPIO Controls for Radios
          • Timer and Delay Management
          • Dual Radio Timer Management
        • Provide a context switch mechanism
          • In a bare-metal environment
          • In an RTOS environment
      • SPARK Audio Core
        • Implement the Backend
          • Implement the Endpoint Interface
      • SPI Implementation
      • BSP Validator
        • Description
        • Terminal
      • Porting Optimizations
        • 1 - Introduction
        • 2 - Memory Layout
        • 3 - Modifying the Linker Script
        • 4 - Copying from Flash to CCMRAM
        • 5 - Adding User Functions to CCMRAM
        • 6 - Removing -fno-omit-frame-pointer Flag
      • Porting Checklist
        • 1 - Implement the BSP for a Custom User Board
        • 2 - Implement the Backend for the SPARK Wireless Core Facade
        • 3 - Implement the Backend for the SPARK Audio Core Facade
        • 4 - Implement the Backend for the SDK Application
  • Changelog
    • SDK
      • v2.0.0 - 2024-10-01
        • General
        • Documentation
        • Wireless Core
        • Audio Core
        • Quasar BSP
        • EVK1.4 BSP
        • Drivers
        • Libraries
    • Archive
      • Changelog (Pre-2.0)
        • SDK
          • v1.3.1 - 2024-09-17
          • v1.3.0 - 2023-12-20
          • v1.2.1 - 2023-10-18
          • v1.2.0 - 2023-05-31
          • v1.1.0 - 2022-11-30
          • v1.0.1 - 2022-06-16
          • v1.0.0 - 2022-05-27
          • v0.12.0 - 2022-03-03
          • v0.11.0 - 2022-02-04
          • v0.10.0 - 2021-12-13
          • v0.9.0 - 2021-11-09
          • v0.8.0 - 2021-09-30
        • SPARK Cores
          • Audio Core Changelog (Legacy)
            • v0.9.0 - 2023-12-08
            • v0.8.0 - 2023-05-31
            • v0.7.0 - 2022-11-30
            • v0.6.0 - 2022-05-27
            • v0.5.0 - 2022-03-03
            • v0.4.0 - 2022-02-04
            • v0.3.0 - 2021-12-13
            • v0.2.0 - 2021-11-09
            • v0.1.0 - 2021-09-30
          • Wireless Core Changelog (Legacy)
            • v0.9.0 - 2023-12-08
            • v0.8.1 - 2023-10-18
            • v0.8.0 - 2023-05-31
            • v0.7.0 - 2022-11-30
            • v0.6.1 - 2022-06-16
            • v0.6.0 - 2022-05-27
            • v0.5.1 - 2022-04-19
            • v0.5.0 - 2022-03-03
            • v0.4.0 - 2022-02-04
            • v0.3.0 - 2021-12-16
            • v0.2.0 - 2021-11-09
            • v0.1.0 - 2021-09-30
        • Misc
          • EVK BSP Changelog (Legacy)
            • v0.8.1 - 2023-12-08
              • v0.8.0 - 2023-05-31
              • v0.7.0 - 2022-11-30
              • v0.6.1 - 2022-06-16
              • v0.6.0 - 2022-05-27
              • v0.5.0 - 2022-03-03
              • v0.4.0 - 2022-02-04
              • v0.3.0 - 2021-12-13
              • v0.2.0 - 2021-11-09
              • v0.1.0 - 2021-09-30
          • SPARK Drivers Changelog (Legacy)
            • v0.6.0 - 2022-11-30
            • v0.5.0 - 2022-05-27
            • v0.4.0 - 2022-02-04
            • v0.3.0 - 2021-12-13
            • v0.2.0 - 2021-11-09
            • v0.1.0 - 2021-09-30
          • SPARK Libraries Changelog (Legacy)
            • v0.6.0 - 2022-11-30
            • v0.5.0 - 2022-05-27
            • v0.4.0 - 2022-02-04
            • v0.3.0 - 2021-12-13
            • v0.2.0 - 2021-11-09
            • v0.1.0 - 2021-09-30
  • Glossary
    • Audio Core Glossary
    • Wireless Core Glossary
SPARK Microsystems SDK
  • »
  • Applications »
  • Datalink

Datalink

Description

The datalink application presents a standard and basic usage of the SPARK Wireless Core. This is a good starting point for anyone wanting to configure wireless communication using the Wireless Core. This application creates a synchronized unidirectional link between 2 devices to send data after a successful pairing.

Behavior

In this example, wireless communication is halted until both devices are paired. Once successfully paired, the Coordinator transmits random data, which incorporates a sequence number and a Cyclic redundancy check (CRC). The Node will verify that the sequence number and CRC are valid.

Application Schedule

The following diagram illustrates the general structure of the schedule used in this application.

Datalink schedule

Figure 22: Datalink Application’s Schedule.

Pairing

By default, devices are unpaired at boot. To use the application, start by pairing the devices.

Pairing:
  • Press the SW1 button on both devices to start the pairing procedure; RGB should blink blue twice when doing so.

  • If the pairing procedure is unsuccessful after 10 seconds, the pairing process stops and the RGB should blink red twice.

  • Once the pairing procedure is successfully completed, the RGB turns magenta and the devices can start exchanging application data.

Unpairing:
  • When paired, pressing the SW1 button again unpairs the device; the RGB should blink red twice to indicate the unpairing procedure is in progress.

  • Unpairing causes the devices to forget their learned addresses. The devices are no longer able to exchange application data.

  • To start a new pairing procedure, both devices must be unpaired first.

Note

LED behavior changes in pairing mode versus normal execution mode. During pairing mode, LEDs indicate pairing status as described below. Once paired, LEDs indicate packet transmission and reception and fallback mode status.

Pairing:
  • Press the SW1 button on both devices to start the pairing procedure; LED0 should blink twice when doing so.

  • If the pairing procedure is unsuccessful after 10 seconds, the pairing process stops and all the LEDs blink twice.

  • Once the pairing procedure is successfully completed, the LEDs will cascade and the devices can start exchanging application data.

Unpairing:
  • When paired, pressing the SW1 button again unpairs the device; All LEDs should blink twice to indicate the unpairing procedure is in progress.

  • Unpairing causes the devices to forget their learned addresses. The devices are no longer able to exchange application data.

  • To start a new pairing procedure, both devices must be unpaired first.

Coordinator User Interface

  • LED1 toggles every time a packet is successfully transmitted to the Node (almost always on because of the high packet rate).

Table 27: Coordinator User Interface Description

Interface

Name

Description

SW1

Pairing Process

Pair or unpair the device depending on the current state.

SW2

Reset Stats

Reset the TX and RX statistics.

SW3

N/A

N/A

SW4

N/A

N/A

LED1

N/A

N/A

LED2

Transmission Success

Toggle LED when a wireless transmission is successful.

LED3

N/A

N/A

LED4

N/A

N/A

RGB

Pairing Event

Indicate pairing event as described in the pairing section.

Table 28: Coordinator User Interface Description

Interface

Name

Description

SW1

Pairing Process

Pair or unpair the device depending on the current state.

SW2

Reset Stats

Reset the TX and RX statistics.

LED0

Transmission Success

Toggle LED when a wireless transmission is successful.

LED1

N/A

N/A

LED2

N/A

N/A

Node User Interface

  • LED2 toggles every time a packet is successfully received from the Coordinator (almost always on because of the high packet rate).

Table 29: Node User Interface Description

Interface

Name

Description

SW1

Pairing Process

Pair or unpair the device depending on the current state.

SW2

Reset Stats

Reset the TX and RX statistics.

SW3

N/A

N/A

SW4

N/A

N/A

LED1

N/A

N/A

LED2

N/A

N/A

LED3

Reception Success

Toggle LED when a wireless reception is successful and the data is valid.

LED4

N/A

N/A

RGB

Pairing Event

Indicate pairing event as described in the pairing section.

Table 30: Node User Interface Description

Interface

Name

Description

SW1

Pairing Process

Pair or unpair the device depending on the current state.

SW2

Reset Stats

Reset the TX and RX statistics.

LED0

N/A

N/A

LED1

Reception Success

Toggle LED when a wireless reception is successful and the data is valid.

LED2

N/A

N/A

Terminal

The following figure shows the terminal output of this application.

See Viewing the Terminal for details on how to view the terminal output.

Datalink Serial Interface Output

Figure 23: Datalink Serial Interface Output (from left: Coordinator & Node).

See Wireless Core API - Statistics for more details.


© Copyright 2024, SPARK Microsystems Intl.