Skip to content

IDE Integration & Setup Guides

Step-by-step setup guides for integrating SyntropicOS into standard microcontroller IDEs and toolchains: STM32CubeIDE, VS Code (PlatformIO & CMake), Keil MDK-ARM, IAR Embedded Workbench, and Arduino IDE.


1. STM32CubeIDE

Project Setup

  1. Add SyntropicOS Source Tree:
  2. Copy or add a git submodule of SyntropicOS into your STM32CubeIDE project root folder (e.g. Middlewares/Third_Party/SyntropicOS).
  3. Configure Include Paths:
  4. Right-click your project → Properties → C/C++ Build → Settings → MCU GCC Compiler → Include paths.
  5. Add ${workspace_loc:/${ProjName}/Middlewares/Third_Party/SyntropicOS/src}.
  6. Ensure ${workspace_loc:/${ProjName}/Core/Inc} is also in the include path (where your syn_config.h will reside).
  7. Add Source Folders to Build:
  8. Right-click Middlewares/Third_Party/SyntropicOS/src/syntropic → Source Actions → Add to Build (or ensure it is not marked as Exclude from build).
  9. If using STM32 HAL porting, also include src/port/stm32_hal/port_stm32_hal.c.
  10. Set C Standard:
  11. In MCU GCC Compiler → Miscellaneous, set C Language Standard to -std=c99.
  12. Configuration Header:
  13. Copy src/syntropic/common/syn_config_template.h to your project's Core/Inc/syn_config.h.

2. VS Code (PlatformIO & CMake + Cortex-Debug)

PlatformIO Integration

SyntropicOS is a native PlatformIO library (library.json). Include it directly via lib_deps in your platformio.ini:

[env:stm32f407]
platform = ststm32
board = disco_f407vg
framework = stm32cube
build_flags =
    -std=c99
lib_deps =
    SyntropicOS

Or reference the Git repository directly:

lib_deps =
    https://github.com/outlookhazy/SyntropicOS.git

CMake + VS Code Cortex-Debug

  1. CMakeLists.txt:

    cmake_minimum_required(VERSION 3.20)
    project(my_embedded_app C)
    set(CMAKE_C_STANDARD 99)
    
    add_subdirectory(lib/SyntropicOS)
    add_executable(my_app src/main.c)
    target_link_libraries(my_app PRIVATE syntropic)
    

  2. .vscode/launch.json (Cortex-Debug ST-Link):

    {
      "version": "0.2.0",
      "configurations": [
        {
          "name": "Cortex-Debug (ST-Link)",
          "type": "cortex-debug",
          "request": "launch",
          "servertype": "openocd",
          "executable": "${workspaceRoot}/build/my_app.elf",
          "device": "STM32F407VG",
          "configFiles": [
            "interface/stlink.cfg",
            "target/stm32f4x.cfg"
          ]
        }
      ]
    }
    


3. Keil MDK-ARM (uVision)

Project Setup

  1. Add Group & Files:
  2. In the Project Workspace tree, right-click target → Add Group... → Name it SyntropicOS.
  3. Right-click SyntropicOS group → Add Existing Files to Group 'SyntropicOS'.
  4. Select all .c files in src/syntropic/ subdirectories (common, kernel, drivers, input, output, protocol, system).
  5. Set Include Paths:
  6. Click Options for Target (Alt+F7) → C/C++ tab.
  7. In Include Paths, add: ..\SyntropicOS\src; ..\Core\Inc;
  8. Compiler Options:
  9. Check C99 Mode in the C/C++ tab.
  10. Add preprocessor define SYN_USE_CONFIG_HEADER=1.
  11. SysTick & Critical Sections:
  12. Ensure SysTick_Handler in stm32f4xx_it.c increments HAL_IncTick() or syn_port_get_tick_ms().

4. IAR Embedded Workbench for ARM

Project Setup

  1. Add Project Group:
  2. Right-click project root in Workspace window → Add → Add Group... → Name it SyntropicOS.
  3. Right-click SyntropicOS → Add → Add Files...
  4. Select all .c files from src/syntropic/.
  5. Preprocessor Options:
  6. Right-click project → Options → C/C++ Compiler → Preprocessor.
  7. Add to Additional include directories: $PROJ_DIR$/../SyntropicOS/src $PROJ_DIR$/../Core/Inc
  8. Language Standards:
  9. In C/C++ Compiler → Language 1 tab, select C Dialect → C99.

5. Arduino IDE (v1.8 / v2.x)

Library Installation

SyntropicOS is packaged as a standard Arduino Library (library.properties).

  1. Installation Methods:
  2. Library Manager: Search for SyntropicOS in Sketch → Include Library → Manage Libraries...
  3. Add .ZIP Library: Download repository release ZIP → Sketch → Include Library → Add .ZIP Library...
  4. Manual Placement: Extract into your sketchbook libraries/ directory (Arduino/libraries/SyntropicOS).

  5. Header Inclusion & Sketch Usage:

  6. Include <syntropic/syntropic.h> in your .ino sketch:
    #include <syntropic/syntropic.h>
    
    void setup() {
        syn_gpio_init(LED_BUILTIN, SYN_GPIO_OUTPUT);
    }
    
    void loop() {
        syn_gpio_toggle(LED_BUILTIN);
        delay(500);
    }