Skip to content

STM32 blue pill FreeRTOS implementation using STM32 VS Code Extension

License

Notifications You must be signed in to change notification settings

YJ0528/stm32_freertos_blue_pill

Repository files navigation

STM32 Blue Pill with FreeRTOS

Third Party Code

This project includes code from stm32f429, and MPU6050 licensed under GPL v3.0:

STM32 VS Code Extension setup

  1. This repository uses STM32 VS Code Extension, please ensure the following items are installed:

  2. Ensure STM32 VS Code Extension is installed.

  3. Once the extension is installed, in the extensions tab, select STM32 VS Code Extension -> Manage (gear icon) -> Settings, insert the path for STM32CubeMX executable and STM32CubeCLT folder.

  4. Launch the STM32CubeMX,open the .ioc file and select generate code.

  5. Go the .vscode/launch.json, insert the following configuration for OpenOCD debug:

    {
          "name": "Debug (OpenOCD)", //no opencod for py32
    "cwd": "${workspaceRoot}",
    "executable": "${workspaceFolder}/build/Debug/100_integrated_system_prototype.elf",
    "armToolchainPath": "${config:STM32VSCodeExtension.cubeCLT.path}/GNU-tools-for-STM32/bin",
    "toolchainPrefix": "arm-none-eabi",
    "gdbPath": "gdb-multiarch",
    "request": "launch",
    "type": "cortex-debug",
    "servertype": "openocd",
    "interface": "swd",
    "preLaunchTask": "${defaultBuildTask}",
    "device": "STM32F103C8Tx",
    // "runToEntryPoint": "main",
    "svdFile": "${config:STM32VSCodeExtension.cubeCLT.path}/STMicroelectronics_CMSIS_SVD/STM32F103.svd",
    "configFiles": [
      "interface/stlink.cfg",
      "target/stm32f1x.cfg"
    ],
    "preLaunchCommands": [
      "monitor halt",
      "monitor sleep 200"
    ],
    "postLaunchCommands": [
      "monitor halt",
      "monitor sleep 200"
    ]
      } 
    

Flashing the code

  1. Once the code is ready, right click CmakeLists.txt and select Configure All Projects.

  2. Right click CmakeLists.txt again, and select Build All Projects.

  3. To flash to the STM32 blue pill, opens up the command pallate using ctrl + shift + p, select Tasks: Run Task -> CubeProg: Flash project (SWD).

  4. To start debug mode, Run and Debug (ctrl + shift + D ), select Debug (OpenOCD) and start debugging (F5).

  5. Alternatively, you can add "Build + Flash" in the OpenOCD "preLaunchTask":, or execute Tasks: Run Task -> Build + Flash using command pallate.

Pin Configuraiotn:



About

STM32 blue pill FreeRTOS implementation using STM32 VS Code Extension

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages