GitXplorerGitXplorer
n

CubeMxToBazel

public
2 stars
1 forks
1 issues

Commits

List of commits on branch master.
Unverified
c88bc60a45d78af8c8161afdb184f7eca516aaf3

Fixing trigger for azure pipelines

nnathaniel-brough committed 6 years ago
Unverified
4119c570ec7b58b71a50ab40d0c2f3bb91a2273a

Moving azure pipelines to jobs

nnathaniel-brough committed 6 years ago
Unverified
fabf55f8cfbe2552793c496099510404082b0672

binary executable to release

nnathaniel-brough committed 6 years ago
Unverified
c2f85add40721d79c0f12accb67e939365358888

Fixed tests for code generation

nnathaniel-brough committed 6 years ago
Unverified
d606c754a6f83fe6614fb6f68b57f45670a7a2e3

Updated readme with compilation instructions

nnathaniel-brough committed 6 years ago
Unverified
8e3b88e55bf42576dc937a29ad0f25b928526a42

removing verbose printing

nnathaniel-brough committed 6 years ago

README

The README file for this repository.

Build Status

CubeMxToBazel

Converts STM32CUBEMX Projects to bazel projects. This is acheived by making use of the generated .gpdsc files from stm32cubemx and outputing these in a bazel build file.

This project is in the early developement stage with fairly minimal but well tested functionality.

Usage

Installation

From Source

Requires a valid golang installation

go get -u github.com/gobuffalo/packr/v2/packr2
packr2 install github.com/silvergasp/CubeMxToBazel

Binary Installation

wget https://github.com/silvergasp/CubeMxToBazel/releases/download/v1.0-beta.1/CubeMxToBazel-linux.tar.gz
tar xvzf CubeMxToBazel-linux.tar.gz
mv CubeMxToBazel ~/bin/

Setting up stm32cubemx

Select the "Other Toolchains (GPDSC)" configuration for your project in 'project>settings'.

cubemxSettings

Running generator

Running the generator is as simple as changing directories into the project and running the converter

cd YOUR_PROJECT_PATH_HERE
$GOPATH/bin/CubeMxToBazel

The output of this is not neccesarily nice to look at, it is recommended to use bazel auto formatter for this.

# Install Autoformatter
go install github.com/bazelbuild/buildtools/buildifier
# Run formatter on generated build file
$GOPATH/bin/buildifier BUILD

Building using bazel

Build all targets

cd YOUR_PROJECT_PATH_HERE
bazel build ... --crosstool_top=@bazel_arm_none//tools/arm_compiler:toolchain --cpu=armeabi-v7a

The resulting binary executable and binary libraries can be found under YOUR_PROJECT_PATH_HERE/bazel-bin. The resulting executable will be named YOUR_PROJECT_PATH_HERE/bazel-bin/main.

NOTE: On first run this project will download the official arm compiler, as such it is expected that you have a strong internet connection. This downloaded compiler will be cached and does not require re-downloading provided that the arm_none_bazel rule in WORKSPACE is not modified.

Current Functionality

  • [x] Converts generated *.gpdsc files from stm32cubemx into bazel BUILD files
  • [x] Generates bazel WORKSPACE files
  • [ ] Generate appropriate bazel compiler flags for; fpu, cpu, hosting specs, optimisations (Currently supports armv7e devices with hardware fpu)
  • [x] Implement conditional file inclusion (e.g. conditional inclusion of assembly files based on the compiler)