Skip to main content

Command line tool to generate CMakeLists.txt from STM32CubeMX projects.

Project description

Installation

From this repository:

git clone https://github.com/eugene-babichenko/cubemx2cmake.git

cd cubemx2cmake

pip install .

Or you can install it from PyPI:

pip install cubemx2cmake

Usage

Generate your initialization code from STM32CubeMX with the following Code Generation Options:

  • Toolchain: SW4STM32

  • [X] Generate under root

Then open your project directory and run cubemx2cmake <your_cube_mx_file>.ioc. If your working directory contains only one CubeMX project file (.ioc), you can simply run *cubemx2cmake and it will find your project file automatically. This will generate CMakeLists.txt, STM32Toolchain.cmake, openocd_debug.cfg and openocd_flash.cfg files.

To get all the things done right use -DCMAKE_TOOLCHAIN_FILE=STM32Toolchain.cmake command line option with CMake.

CMakeLists contains the separate target called flash, which compiles your code and then flashes it to the target processor with OpenOCD. By default stlink-v2 is specified as the debugging interface. You can specify any other interface with –interface command line option. You can also specify flash memory start address with –memory_start option (0x08000000 by default). Telnet and GDB ports can be changed with –telnet-port and –gdb-port (4444 and 3333 are the defaults).

This scripts also generates a bunch of shell script files: * openocd_flash.sh - flashes the target MCU; * openocd_debug.sh - open debugging port for the target MCU; * gdb.sh - connect to the target MCU after openocd_debug.sh was started.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cubemx2cmake-1.2.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file cubemx2cmake-1.2.tar.gz.

File metadata

  • Download URL: cubemx2cmake-1.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cubemx2cmake-1.2.tar.gz
Algorithm Hash digest
SHA256 dead384726cffbb568ed33fa1777e8409ebc48aa34ab147a70f9b1ce4c5f13bd
MD5 3bb9fc796cfa9c921da4916cd8b78725
BLAKE2b-256 fc61c298105aa590dcfc6e69ebde2806f6764f72734fd96fc71ab61d51fec2ea

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page