Skip to content

Commit

Permalink
release 2.0.0 - RP2350 and SDK2.0.0 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kilograham committed Aug 8, 2024
1 parent b19b6aa commit 8a9af99
Show file tree
Hide file tree
Showing 83 changed files with 74,516 additions and 1,780 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build/*
bazel-*

# Ignore until https://github.com/bazelbuild/bazel/issues/20369 is fixed.
Expand Down
84 changes: 71 additions & 13 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,44 +1,102 @@
load("//bazel:defs.bzl", "otp_header_parse", "picotool_binary_data_header")

package(default_visibility = ["//visibility:public"])

picotool_binary_data_header(
name = "rp2350_rom",
src = "bootrom.end.bin",
out = "rp2350.rom.h",
)

# TODO: Make it possible to build the prebuilt from source.
picotool_binary_data_header(
name = "xip_ram_perms_elf",
src = "//xip_ram_perms:xip_ram_perms_prebuilt",
out = "xip_ram_perms_elf.h",
)

cc_library(
name = "xip_ram_perms",
srcs = ["xip_ram_perms.cpp"],
hdrs = [
"xip_ram_perms.h",
"xip_ram_perms_elf.h",
],
deps = [
"//bazel:data_locs",
"//lib/whereami",
],
)

filegroup(
name = "data_locs_header",
srcs = ["data_locs.h"],
)

otp_header_parse(
name = "otp_header",
src = "@pico-sdk//src/rp2350/hardware_regs:otp_data_header",
out = "rp2350.json.h",
)

cc_binary(
name = "picotool",
srcs = [
"cli.h",
"clipp/clipp.h",
"elf.h",
"main.cpp",
"picoboot_connection/picoboot_connection.c",
"picoboot_connection/picoboot_connection.h",
"picoboot_connection/picoboot_connection_cxx.cpp",
"picoboot_connection/picoboot_connection_cxx.h",
"otp.cpp",
"otp.h",
"rp2350.json.h",
"rp2350.rom.h",
"xip_ram_perms.cpp",
],
copts = select({
"@platforms//os:windows": [],
"@rules_cc//cc/compiler:msvc-cl": [
"/std:c++20",
],
"//conditions:default": [
"-fexceptions",
"-Wno-delete-non-abstract-non-virtual-dtor",
"-Wno-reorder-ctor",
"-Wno-unused-variable",
"-Wno-unused-but-set-variable",
],
}),
# TODO: There's probably a nicer way to do share this with CMake.
defines = [
'PICOTOOL_VERSION=\\"1.1.3-rc1\\"',
# TODO: There's probably a nicer way to share the version with CMake.
'PICOTOOL_VERSION=\\"2.0.0\\"',
'SYSTEM_VERSION=\\"host\\"',
'COMPILER_INFO=\\"local\\"',
"SUPPORT_A0=0",
"SUPPORT_A2=1",
"PICOTOOL_CODE_OTP=0",
# TODO: Make it possible to compile from source.
"USE_PRECOMPILED=1",
],
# Windows does not behave nicely with the automagic force_dynamic_linkage_enabled.
dynamic_deps = select({
"@rules_libusb//:force_dynamic_linkage_enabled": ["@libusb//:libusb_dynamic"],
"//conditions:default": [],
}),
includes = ["picoboot_connection"],
deps = [
":xip_ram_perms",
"//bazel:data_locs",
"//bintool",
"//elf",
"//elf2uf2",
"//errors",
"//lib/nlohmann_json:json",
"//picoboot_connection",
"@libusb",
"@pico-sdk//src/common/boot_picoboot:boot_picoboot",
"@pico-sdk//src/common/boot_uf2:boot_uf2",
"@pico-sdk//src/common/pico_base:platform_defs",
"@pico-sdk//src/common/pico_binary_info:pico_binary_info",
"@pico-sdk//src/common/boot_picobin_headers",
"@pico-sdk//src/common/boot_picoboot_headers",
"@pico-sdk//src/common/boot_uf2_headers",
"@pico-sdk//src/common/pico_base_headers",
"@pico-sdk//src/common/pico_binary_info",
"@pico-sdk//src/common/pico_usb_reset_interface_headers",
"@pico-sdk//src/rp2350/hardware_regs:otp_data",
"@pico-sdk//src/rp2_common/pico_bootrom:pico_bootrom_headers",
"@pico-sdk//src/rp2_common/pico_stdio_usb:reset_interface_headers",
],
)
Loading

0 comments on commit 8a9af99

Please sign in to comment.