Skip to content

Commit

Permalink
rp2350: Fix architecture in crash snapshot
Browse files Browse the repository at this point in the history
Fixes: b/362506213
Change-Id: I85ce6eefe3227e480a2379081bfb58adcdc841ec
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/232231
Reviewed-by: Armando Montanez <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
Pigweed-Auto-Submit: Dave Roth <[email protected]>
Lint: Lint 🤖 <[email protected]>
  • Loading branch information
davexroth authored and CQ Bot Account committed Aug 27, 2024
1 parent 70bff1c commit 9e609d2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pw_system/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -696,3 +696,10 @@ device_console(
binary = ":rp2040_system_example",
script = "//pw_system/py:pw_system_console",
)

device_console(
name = "rp2350_system_example_console",
testonly = True,
binary = ":rp2350_system_example",
script = "//pw_system/py:pw_system_console",
)
10 changes: 10 additions & 0 deletions targets/rp2040/device_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,19 @@ void RebootSystem() { watchdog_reboot(0, 0, 0); }

void CapturePlatformMetadata(
snapshot::pwpb::Metadata::StreamEncoder& metadata_encoder) {
// The device_handler is shared between rp2040 and 2350, so handle differences
// with the preprocessor.
#if _PW_ARCH_ARM_V6M
// TODO: https://pwbug.dev/357132837 - Review if IgnoreError is correct here.
metadata_encoder.WriteCpuArch(snapshot::pwpb::CpuArchitecture::Enum::ARMV6M)
.IgnoreError();
#elif _PW_ARCH_ARM_V8M_MAINLINE || _PW_ARCH_ARM_V8_1M_MAINLINE
// TODO: https://pwbug.dev/357132837 - Review if IgnoreError is correct here.
metadata_encoder.WriteCpuArch(snapshot::pwpb::CpuArchitecture::Enum::ARMV8M)
.IgnoreError();
#else
#error "Unknown CPU architecture."
#endif // _PW_ARCH_ARM_V6M
}

Status CaptureCpuState(
Expand Down

0 comments on commit 9e609d2

Please sign in to comment.