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
- 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.
- 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.
- Download the iRidi SDK from GitHub at this link.
- 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
- Build the end device.
- Assemble the end-device circuit.
- Build the project and upload it to the microcontroller.
- a) Using the template:
- Open and compile the bootloader. The project file is Example\STM32\STM32F103C8T6\Template\Bootloader\MDK-ARM\Bootloader.uvprojx
- Use Keil to upload the bootloader to the microcontroller.
- Open and compile the firmware. The project file is Example\STM32\STM32F103C8T6\Template\Firmware\MDK-ARM\Firmware.uvprojx
- Use config.exe in the Utility directory to upload the generated firmware to the microcontroller.
- b) Without the template.
- Create a class derived from CIridiumBusProtocol to implement your device's functionality.
- In the class constructor:
- Initialize the incoming buffer for receiving protocol packets.
- Initialize the outgoing buffer for sending protocol packets.
- Implement system-method handlers:
- Handler for obtaining device information in response to a search request.
- Handler for changing the local identifier.
- Obtaining device information.
- Implement global-variable handlers:
- Handler for setting a global variable value.
- Handler for obtaining a global variable value.
- 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.
- 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.
- 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.
- Implement the Smart API handler
- After compiling in the keil development environment, upload the generated firmware to the microcontroller.
- a) Using the template: