An open API service indexing awesome lists of open source software.

https://github.com/pedrokiefer/rules_stm32

Bazel rules for building stm32f4 embedded projects
https://github.com/pedrokiefer/rules_stm32

bazel bazel-rules stm32 stm32f4

Last synced: 12 months ago
JSON representation

Bazel rules for building stm32f4 embedded projects

Awesome Lists containing this project

README

          

# Bazel Rules for STM32f4 processors #

* Toolchain: arm-none-eabi-gcc 6.2.1 from [https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads]

## Usage

On `WORKSPACE` add this for linux:

```
git_repository(
name = "stm32",
remote = "https://github.com/pedrokiefer/rules_stm32.git",
commit = "256dd2e75b49485eb4e7844549b5749bb082657a"
)

load("@stm32//stm32f4:rules.bzl", "arm_none_repository")
arm_none_repository(name="com_arm_developer_toolchain_gcc_6_2")
```
## Available Rules

### Processors

Supported processors:
* STM32F401xC
* STM32F401xE
* STM32F405xx
* STM32F407xx
* STM32F410Cx
* STM32F410Rx
* STM32F410Tx
* STM32F411xE
* STM32F412Cx
* STM32F412Rx
* STM32F412Vx
* STM32F412Zx
* STM32F413xx
* STM32F415xx
* STM32F417xx
* STM32F423xx
* STM32F427xx
* STM32F429xx
* STM32F437xx
* STM32F439xx
* STM32F446xx
* STM32F469xx
* STM32F479xx

### arm_none_repository ###

Fetchs arm toolchain

```
load("@stm32//stm32f4:rules.bzl", "arm_none_repository")

arm_none_repository(arch)
```

* arch: linux, mac, windows [Unimplemented]

Run bazel build with `--crosstool_top=@stm32//tools/arm_compiler:toolchain --cpu=armeabi-v7a` for building with this toolchain.

### stm32f4_hal_library ###

```
load("@stm32//stm32f4:rules.bzl", "stm32f4_hal_library")
stm32f4_hal_library()
```

### stm32f4_binary ###

* name: binary_name
* srcs: list of sources
* deps: list of deps
* processor: one of ["STM32F429xx", ... ]
* use_hal:
* hal_config_hdrs: hal config files generated by stm32cube
* linker_script: linker script to be used

### raw_binary ###
Generates a .bin file

```
load("@stm32//tools/arm_compiler:raw_binary.bzl", "raw_binary")

raw_binary(
name = "my_bin",
src = ":binary"
)
```

### hex_binary ###
Generates a .hex file

```
load("@stm32//tools/arm_compiler:raw_binary.bzl", "hex_binary")

hex_binary(
name = "my_hex",
src = ":binary"
)
```