Skip to content

mjbots/rules_mbed

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
cpu
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

mbed rules for Bazel

This package provides bazel (https://bazel.build) rules for building binaries for mbed-os (https://github.com/ARMmbed/mbed-os) embedded targets. It includes bazel configuration for the ARM-GCC toolchain, as well as dedicated bazel rules for building output binary files. It supports multiple distinct mbed targets within the same build.

  • License: Apache 2.0
  • travis-ci Build Status
  • Processors: STM32F0, STM32F4, and STM32G4 family processors

Usage

In WORKSPACE add this:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

RULES_MBED_COMMIT = "XXX"

http_archive(
    name = "rules_mbed",
    url = "https://github.com/mjbots/bazel_deps/{}.zip".format(RULES_MBED_COMMIT),
    sha256 = "XXX",
    strip_prefix = "rules_mbed-{}".format(RULES_MBED_COMMIT),
)

load("@rules_mbed//:rules.bzl", "mbed_register")
mbed_register(config = {
    "mbed_target": "targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TARGET_NUCLEO_F411RE",
    "mbed_config": None,
  }
)

Then in a BUILD file you can use:

load("@com_github_ARMmbed_mbed-os//:rules.bzl", "mbed_binary")

mbed_binary(
  name = "example",
  srcs = ["example.cc"],
)

And in your bazelrc you can list:

build --incompatible_enable_cc_toolchain_resolution
build --platforms=@rules_mbed//:stm32f4

About

bazel rules for building mbed-os embedded binaries

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published