Skip to main content

Quick start using the SDK

The iRidi SDK implements the decentralized part of the protocol as a set of source files. It is implemented as a class containing methods for protocol operation and callback methods implementing device-specific behavior.

How to get started​

  1. Prepare the hardware. The minimum requirements are:
    • Two stm32f103c8t6 microcontrollers (the first as a Serial-to-CAN converter and the second as a test device).
    • Two CAN transceivers (for example, SN65HVD230D, marked VP230)
    • USB-TTL converter.
  2. Set up the development tools.
    • Download and install the Keil development environment for ARM from the official website. The project will be compiled in this environment.
    • Download and install STM32CubeMX from the official website. This tool is used to configure the project.
  3. Download the iRidi SDK from GitHub at this link.
  4. Build a gateway for programming the bus.
    • Assemble the gateway circuit.
    • Open and compile the gateway program. The project file is Example\STM32\STM32F103C8T6\GateUARTtoCAN\MDK-ARM\GateUARTtoCAN.uvprojx
  5. Build the end device.
    • Assemble the end-device circuit.
    • Build the project and upload it to the microcontroller.
      • a) Using the template:
        1. Open and compile the bootloader. The project file is Example\STM32\STM32F103C8T6\Template\Bootloader\MDK-ARM\Bootloader.uvprojx
        2. Use Keil to upload the bootloader to the microcontroller.
        3. Open and compile the firmware. The project file is Example\STM32\STM32F103C8T6\Template\Firmware\MDK-ARM\Firmware.uvprojx
        4. Use config.exe in the Utility directory to upload the generated firmware to the microcontroller.
      • b) Without the template.
        1. Create a class derived from CIridiumBusProtocol to implement your device's functionality.
        2. In the class constructor:
          • Initialize the incoming buffer for receiving protocol packets.
          • Initialize the outgoing buffer for sending protocol packets.
        3. Implement system-method handlers:
          • Handler for obtaining device information in response to a search request.
          • Handler for changing the local identifier.
          • Obtaining device information.
        4. Implement global-variable handlers:
          • Handler for setting a global variable value.
          • Handler for obtaining a global variable value.
        5. Implement feedback-channel handlers.
          • Handler for obtaining the number of feedback channels.
          • Handler for converting a feedback channel identifier to a feedback channel index.
          • Handler for obtaining feedback channel data.
          • Handler for obtaining the extended feedback channel description.
          • Handler for linking a global variable to a feedback channel.
          • Setting a feedback channel value.
        6. Implement control-channel handlers.
          • Handler for obtaining the number of control channels.
          • Handler for converting a control channel identifier to a control channel index.
          • Handler for obtaining control channel data.
          • Handler for obtaining the extended control channel description.
          • Handler for linking a list of global variables to a control channel.
          • Setting a control channel value.
        7. Implement stream handling (streams are used to update device firmware)
          • Stream-open handler.
          • Stream-open acknowledgment handler.
          • Block-send handler.
          • Block-receipt acknowledgment handler.
          • Stream-close handler.
        8. Implement the Smart API handler
        9. After compiling in the keil development environment, upload the generated firmware to the microcontroller.
In this article: