Skip to content

Latest commit

 

History

History

cli

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Command line interface usage

  1. Run the CubeMX, choose an MCU/board, make all desired tweaks.
  2. Select the Project Manager -> Project tab, specify a "Project Name", choose "Other Toolchains (GPDSC)". In the Code Generator tab check "Copy only the necessary library files" and "Generate periphery initialization as a pair of '.c/.h' files per peripheral" options.

Code Generator tab

  1. Back in the first tab (Project) copy the "Toolchain Folder Location" string. Save the project.

Project tab

  1. Use the copied string (project folder) as a -d/--directory argument for the stm32pio (can be omitted if your current working directory is already a project directory).
  2. Run platformio boards (pio boards) or go to boards to list all supported devices. Pick one and use its ID as a -b/--board argument (for example, nucleo_f031k6)
  3. All done! You can now run
    $ stm32pio new -d path/to/project/ -b nucleo_f031k6 --start-editor=code --with-build
    to trigger the code generation, compile the project and start the VSCode editor with the folder opened (last 2 options are given as an example and not required). Make sure you have all the tools in your PATH (java, platformio, python, editor) (or set them in stm32pio.ini). You can use a slightly shorter syntax if you are already located in the project directory:
    path/to/project/ $   stm32pio new -b nucleo_f031k6
  4. To get the information about the current state of the project use status command.
  5. If you will be in need to update the hardware configuration in a future, make all the necessary stuff in CubeMX and run generate command in a similar way:
    $ stm32pio generate -d /path/to/project
  6. To clean-up the directory and keep only an .ioc file run the clean command.
  7. If you're facing some errors complaining about tools absence, run validate command to check the current environment in terms of the tools' presence in your system.