Skip to content

Latest commit

 

History

History
76 lines (66 loc) · 4.37 KB

README.md

File metadata and controls

76 lines (66 loc) · 4.37 KB

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: