Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ We have several packages which live in this repository. Changes are tracked sepa
* [defmt-test](#defmt-test)
* [defmt-test-macros](#defmt-test-macros)
* [defmt-json-schema](#defmt-json-schema)
* [qemu-run](#qemu-run)
* [defmt-elf2table](#defmt-elf2table)
* [defmt-logger](#defmt-logger)

Expand Down Expand Up @@ -944,6 +945,21 @@ Initial release

Initial release

## qemu-run

> Runs [`qemu-system-arm`] but decodes [`defmt`] data sent to semihosting

[qemu-run-next]: https://github.com/knurling-rs/defmt/compare/qemu-run-v0.1.0...main
[qemu-run-v0.1.0]: https://github.com/knurling-rs/defmt/releases/tag/qemu-run-v0.1.0

### [qemu-run-next]

* No changes

### [qemu-run-v0.1.0]

Initial release

## defmt-elf2table

> Reads ELF metadata and builds a defmt interner table
Expand Down
4 changes: 3 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions decoder/src/log/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ impl InternalFormatter {
DefaultStyle::get_string(with_location, config.is_timestamp_available)
.to_string();
if source == Source::Host {
format.insert_str(0, "(HOST) ");
format.push_str(" (HOST)");
}

format
Expand All @@ -441,7 +441,7 @@ impl InternalFormatter {
.to_string();

if source == Source::Host {
format.insert_str(0, "(HOST) ");
format.push_str(" (HOST)");
}

format
Expand Down
2 changes: 1 addition & 1 deletion firmware/qemu/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rrb = "-q run --target thumbv7m-none-eabi --release --bin"

[target.'cfg(all(target_arch = "arm", target_os = "none"))']
# runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"
runner = "cargo -q run --manifest-path ../../qemu-run/Cargo.toml"
runner = "cargo -q run --manifest-path ../../qemu-run/Cargo.toml -- --machine lm3s6965evb --verbose"

rustflags = [
# LLD (shipped with the Rust toolchain) is used as the default linker
Expand Down
30 changes: 15 additions & 15 deletions firmware/qemu/src/bin/alloc.out
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
0.000000 INFO Box<u32>: 42
0.000001 INFO Box<Box<u32>>: 1337
0.000002 INFO in nested 123
0.000003 INFO Box<NestedStruct>: NestedStruct { a: 170, b: 305419896 }
0.000004 INFO Rc<u32>: 42
0.000005 INFO Arc<u32>: 42
0.000006 INFO Vec<u32>: [1, 2, 3, 4]
0.000007 INFO Vec<i32>: [-1, 2, 3, 4]
0.000008 INFO Vec<Box<i32>>: [-1, 2, 3, 4]
0.000009 INFO Box<Vec<i32>>: [-1, 2, 3, 4]
0.000010 INFO String: Hello! I'm a heap-allocated String
0.000011 INFO Cow<[u32]>: [1, 2, 3, 4]
0.000012 INFO Cow<Vec<u32>>: [1, 2, 3, 4]
0.000013 INFO Cow<str>: moo
0.000014 INFO Cow<String>: moo, but allocated
0.000000 INFO Box<u32>: 42
0.000001 INFO Box<Box<u32>>: 1337
0.000002 INFO in nested 123
0.000003 INFO Box<NestedStruct>: NestedStruct { a: 170, b: 305419896 }
0.000004 INFO Rc<u32>: 42
0.000005 INFO Arc<u32>: 42
0.000006 INFO Vec<u32>: [1, 2, 3, 4]
0.000007 INFO Vec<i32>: [-1, 2, 3, 4]
0.000008 INFO Vec<Box<i32>>: [-1, 2, 3, 4]
0.000009 INFO Box<Vec<i32>>: [-1, 2, 3, 4]
0.000010 INFO String: Hello! I'm a heap-allocated String
0.000011 INFO Cow<[u32]>: [1, 2, 3, 4]
0.000012 INFO Cow<Vec<u32>>: [1, 2, 3, 4]
0.000013 INFO Cow<str>: moo
0.000014 INFO Cow<String>: moo, but allocated
5 changes: 3 additions & 2 deletions firmware/qemu/src/bin/assert-eq.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ERROR panicked at 'assertion failed: `(left == right)`: dev'
left: `41`
right: `43`
diff < left / right >
<41
>43
24 changes: 12 additions & 12 deletions firmware/qemu/src/bin/bitflags.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
INFO Flags::empty(): FLAG_0
INFO Flags::empty(): FLAG_0 (fmt::Debug)
INFO Flags::all(): FLAG_1 | FLAG_2 | FLAG_7 | FLAG_7_COPY
INFO Flags::all(): FLAG_1 | FLAG_2 | FLAG_7 | FLAG_7_COPY (fmt::Debug)
INFO Flags::FLAG_1: FLAG_1
INFO Flags::FLAG_1: FLAG_1 (fmt::Debug)
INFO Flags::FLAG_7: FLAG_7 | FLAG_7_COPY
INFO Flags::FLAG_7: FLAG_7 | FLAG_7_COPY (fmt::Debug)
INFO LargeFlags::ALL: MSB | ALL | NON_LITERAL
INFO LargeFlags::ALL: MSB | ALL | NON_LITERAL (fmt::Debug)
INFO LargeFlags::empty(): (empty)
INFO LargeFlags::empty(): (empty) (fmt::Debug)
INFO Flags::empty(): FLAG_0
INFO Flags::empty(): FLAG_0 (fmt::Debug)
INFO Flags::all(): FLAG_1 | FLAG_2 | FLAG_7 | FLAG_7_COPY
INFO Flags::all(): FLAG_1 | FLAG_2 | FLAG_7 | FLAG_7_COPY (fmt::Debug)
INFO Flags::FLAG_1: FLAG_1
INFO Flags::FLAG_1: FLAG_1 (fmt::Debug)
INFO Flags::FLAG_7: FLAG_7 | FLAG_7_COPY
INFO Flags::FLAG_7: FLAG_7 | FLAG_7_COPY (fmt::Debug)
INFO LargeFlags::ALL: MSB | ALL | NON_LITERAL
INFO LargeFlags::ALL: MSB | ALL | NON_LITERAL (fmt::Debug)
INFO LargeFlags::empty(): (empty)
INFO LargeFlags::empty(): (empty) (fmt::Debug)
2 changes: 1 addition & 1 deletion firmware/qemu/src/bin/dbg.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TRACE x + 1 = 43
TRACE x - 1 = 41
INFO the answer is 41
INFO the answer is 41
TRACE x - 2 = 40
TRACE x + 2 = 44
TRACE
Expand Down
152 changes: 76 additions & 76 deletions firmware/qemu/src/bin/hints.out
Original file line number Diff line number Diff line change
@@ -1,76 +1,76 @@
0.000000 INFO no hint 42
0.000001 INFO hex 2a
0.000002 INFO hex alt 0x2a
0.000003 INFO HEX 2A
0.000004 INFO HEX alt 0x2A
0.000005 INFO octal 52
0.000006 INFO octal alt 0o52
0.000007 INFO binary 101010
0.000008 INFO binary alt 0b101010
0.000009 INFO ASCII 42
0.000010 INFO Debug 42
0.000011 INFO ----
0.000012 INFO no-hint 42
0.000013 INFO hex 2a
0.000014 INFO hex alt 0x2a
0.000015 INFO HEX 2A
0.000016 INFO HEX alt 0x2A
0.000017 INFO octal 52
0.000018 INFO octal alt 0o52
0.000019 INFO binary 101010
0.000020 INFO binary alt 0b101010
0.000021 INFO ASCII 42
0.000022 INFO Debug 42
0.000023 INFO ----
0.000024 INFO no hint 42
0.000025 INFO hex 2a
0.000026 INFO hex alt 0x2a
0.000027 INFO HEX 2A
0.000028 INFO HEX alt 0x2A
0.000029 INFO octal 52
0.000030 INFO octal alt 0o52
0.000031 INFO binary 101010
0.000032 INFO binary alt 0b101010
0.000033 INFO ASCII 42
0.000034 INFO Debug 42
0.000035 INFO ----
0.000036 INFO S1 > S2 101010
0.000037 INFO ----
0.000038 INFO no hint [72, 101, 127, 108, 108, 111]
0.000039 INFO hex [48, 65, 7f, 6c, 6c, 6f]
0.000040 INFO hex alt [0x48, 0x65, 0x7f, 0x6c, 0x6c, 0x6f]
0.000041 INFO HEX [48, 65, 7F, 6C, 6C, 6F]
0.000042 INFO HEX alt [0x48, 0x65, 0x7F, 0x6C, 0x6C, 0x6F]
0.000043 INFO octal [110, 145, 177, 154, 154, 157]
0.000044 INFO octal alt [0o110, 0o145, 0o177, 0o154, 0o154, 0o157]
0.000045 INFO binary [1001000, 1100101, 1111111, 1101100, 1101100, 1101111]
0.000046 INFO binary alt [0b1001000, 0b1100101, 0b1111111, 0b1101100, 0b1101100, 0b1101111]
0.000047 INFO ASCII b"He\x7fllo"
0.000048 INFO Debug [72, 101, 127, 108, 108, 111]
0.000049 INFO ----
0.000050 INFO b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
0.000051 INFO b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
0.000052 INFO ----
0.000053 INFO no hint Hello
0.000054 INFO Debug "Hello"
0.000055 INFO no hint world
0.000056 INFO Debug "world"
0.000057 INFO ----
0.000058 INFO no hint 10
0.000059 INFO hex a
0.000060 INFO hex 0xa
0.000061 INFO HEX A
0.000062 INFO HEX 0xA
0.000063 INFO octal 12
0.000064 INFO octal 0o12
0.000065 INFO binary 1010
0.000066 INFO binary 0b1010
0.000067 INFO ASCII b"\n"
0.000068 INFO Debug 10
0.000069 INFO ISO8601 2021-04-20T09:23:44.804Z
0.000070 INFO ISO8601 +53271-03-27T11:46:44Z
0.000071 INFO Sec ms 1234.567
0.000072 INFO Sec us 1.234567
0.000073 INFO Time s 14:06:56:07
0.000074 INFO Time ms 00:20:34.567
0.000075 INFO Time us 00:00:01.234567
0.000000 INFO no hint 42
0.000001 INFO hex 2a
0.000002 INFO hex alt 0x2a
0.000003 INFO HEX 2A
0.000004 INFO HEX alt 0x2A
0.000005 INFO octal 52
0.000006 INFO octal alt 0o52
0.000007 INFO binary 101010
0.000008 INFO binary alt 0b101010
0.000009 INFO ASCII 42
0.000010 INFO Debug 42
0.000011 INFO ----
0.000012 INFO no-hint 42
0.000013 INFO hex 2a
0.000014 INFO hex alt 0x2a
0.000015 INFO HEX 2A
0.000016 INFO HEX alt 0x2A
0.000017 INFO octal 52
0.000018 INFO octal alt 0o52
0.000019 INFO binary 101010
0.000020 INFO binary alt 0b101010
0.000021 INFO ASCII 42
0.000022 INFO Debug 42
0.000023 INFO ----
0.000024 INFO no hint 42
0.000025 INFO hex 2a
0.000026 INFO hex alt 0x2a
0.000027 INFO HEX 2A
0.000028 INFO HEX alt 0x2A
0.000029 INFO octal 52
0.000030 INFO octal alt 0o52
0.000031 INFO binary 101010
0.000032 INFO binary alt 0b101010
0.000033 INFO ASCII 42
0.000034 INFO Debug 42
0.000035 INFO ----
0.000036 INFO S1 > S2 101010
0.000037 INFO ----
0.000038 INFO no hint [72, 101, 127, 108, 108, 111]
0.000039 INFO hex [48, 65, 7f, 6c, 6c, 6f]
0.000040 INFO hex alt [0x48, 0x65, 0x7f, 0x6c, 0x6c, 0x6f]
0.000041 INFO HEX [48, 65, 7F, 6C, 6C, 6F]
0.000042 INFO HEX alt [0x48, 0x65, 0x7F, 0x6C, 0x6C, 0x6F]
0.000043 INFO octal [110, 145, 177, 154, 154, 157]
0.000044 INFO octal alt [0o110, 0o145, 0o177, 0o154, 0o154, 0o157]
0.000045 INFO binary [1001000, 1100101, 1111111, 1101100, 1101100, 1101111]
0.000046 INFO binary alt [0b1001000, 0b1100101, 0b1111111, 0b1101100, 0b1101100, 0b1101111]
0.000047 INFO ASCII b"He\x7fllo"
0.000048 INFO Debug [72, 101, 127, 108, 108, 111]
0.000049 INFO ----
0.000050 INFO b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
0.000051 INFO b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
0.000052 INFO ----
0.000053 INFO no hint Hello
0.000054 INFO Debug "Hello"
0.000055 INFO no hint world
0.000056 INFO Debug "world"
0.000057 INFO ----
0.000058 INFO no hint 10
0.000059 INFO hex a
0.000060 INFO hex 0xa
0.000061 INFO HEX A
0.000062 INFO HEX 0xA
0.000063 INFO octal 12
0.000064 INFO octal 0o12
0.000065 INFO binary 1010
0.000066 INFO binary 0b1010
0.000067 INFO ASCII b"\n"
0.000068 INFO Debug 10
0.000069 INFO ISO8601 2021-04-20T09:23:44.804Z
0.000070 INFO ISO8601 +53271-03-27T11:46:44Z
0.000071 INFO Sec ms 1234.567
0.000072 INFO Sec us 1.234567
0.000073 INFO Time s 14:06:56:07
0.000074 INFO Time ms 00:20:34.567
0.000075 INFO Time us 00:00:01.234567
20 changes: 10 additions & 10 deletions firmware/qemu/src/bin/hints_inner.out
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
0.000000 INFO S1 { x: "hi", y: 0x2a }
0.000001 INFO S2 { x: 0x2a }
0.000002 WARN Debug hint: S { x: "hello", y: 512 }
0.000003 WARN no hint: S { x: "hello", y: 1024 }
0.000004 INFO S2 { s: S1 { x: 0b100, y: 12 }, z: 20 }
0.000005 INFO S2 { s: S1 { x: 0b100, y: 12 }, z: 20 }
0.000006 INFO S2 { s: S1 { x: 0b100, y: 12 }, z: 0x14 }
0.000007 INFO S2 { s: S1 { x: 0b100, y: 12 }, z: 0b10100 }
0.000008 INFO S1 { x: "hi", y: 42 }
0.000009 INFO S1 { x: "hi", y: 0x2a }
0.000000 INFO S1 { x: "hi", y: 0x2a }
0.000001 INFO S2 { x: 0x2a }
0.000002 WARN Debug hint: S { x: "hello", y: 512 }
0.000003 WARN no hint: S { x: "hello", y: 1024 }
0.000004 INFO S2 { s: S1 { x: 0b100, y: 12 }, z: 20 }
0.000005 INFO S2 { s: S1 { x: 0b100, y: 12 }, z: 20 }
0.000006 INFO S2 { s: S1 { x: 0b100, y: 12 }, z: 0x14 }
0.000007 INFO S2 { s: S1 { x: 0b100, y: 12 }, z: 0b10100 }
0.000008 INFO S1 { x: "hi", y: 42 }
0.000009 INFO S1 { x: "hi", y: 0x2a }
Loading