- Toolchain: arm-none-eabi-gcc 6.2.1 from [https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads]
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")
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
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.
load("@stm32//stm32f4:rules.bzl", "stm32f4_hal_library")
stm32f4_hal_library()
- 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
Generates a .bin file
load("@stm32//tools/arm_compiler:raw_binary.bzl", "raw_binary")
raw_binary(
name = "my_bin",
src = ":binary"
)
Generates a .hex file
load("@stm32//tools/arm_compiler:raw_binary.bzl", "hex_binary")
hex_binary(
name = "my_hex",
src = ":binary"
)