Austin Schuh | 0a96ea3 | 2022-01-01 22:29:30 -0800 | [diff] [blame] | 1 | load("//third_party/pico-sdk:hex.bzl", "uf2_from_elf") |
| 2 | |
| 3 | # TODO(austin): We should be able to either push the linker script into the crosstool, or wrap this in a macro. |
| 4 | cc_binary( |
| 5 | name = "blink.elf", |
| 6 | srcs = [ |
| 7 | "blink.c", |
| 8 | "//third_party/pico-sdk/src/rp2_common/boot_stage2:bs2_default_padded_checksummed.S", |
| 9 | ], |
| 10 | additional_linker_inputs = [ |
| 11 | "//third_party/pico-sdk:src/rp2_common/pico_standard_link/memmap_default.ld", |
| 12 | ], |
| 13 | linkopts = [ |
| 14 | "-Wl,--script=third_party/pico-sdk/src/rp2_common/pico_standard_link/memmap_default.ld", |
| 15 | ], |
| 16 | target_compatible_with = [ |
| 17 | "@platforms//os:none", |
| 18 | "//tools/platforms/hardware:cortex_m0plus", |
| 19 | ], |
| 20 | deps = ["//third_party/pico-sdk"], |
| 21 | ) |
| 22 | |
| 23 | uf2_from_elf( |
| 24 | name = "blink", |
| 25 | ) |