Git Product home page Git Product logo

cubemx2cmake's Introduction

STM32CubeMX2CMake

WARNING: THIS PROJECT IS NO LONGER MAINTAINED AND IS INCOMPATIBLE WITH NEW VERSION OF CUBEMX. AN ARTICLE ON USING CUBE ALONG WITH CMAKE IS ON ITS WAY

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.

cubemx2cmake's People

Contributors

eugene-babichenko avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.