Working with emulators in Pigweed isn’t easy right now, especially if you want to support multiple targets, platforms, projects, etc. You have to manage a bunch of stuff yourself!
The SEED proposes an interface for specifying emulator configuration to take care of the above
There are still some differences between host OSes and emulators, e.g., Windows doesn’t support PTYs, qemu and Renode have different device path specifiers – in other words, the emulator definition interface isn’t totally generic, it exposes some direct emulator configuration options where needed
Easy to get into gdb! Next step: VS Code debugger integration
SEED-0105 review: Nested Tokens and Tokenized Log Arguments -
Runtime arguments to log statements aren’t currently tokenized – tokenizing these too can further reduce on-device log storage space
Strings can be wrapped in PRI-style macros to ensure they’re tokenized
This can be extended to enums too – wrap the enum definition in a macro to handle tokenization of the values
Does this take up more space? 32-bit token for a < 32-bit enum value? No, the proposal is that the enum value is the token, so it doesn’t use the full 32 bits
It’s about the same amount of data over the wire as transmitting the integer value, but is much more readable
The SEED focuses on pw_log_tokenized, how does using the tokenization macros affect pw_log_basic (if at all)? Will address this in the SEED
This contains the start of a Rust-like derive macro that could wrap strings and define printf-style encodings/formattings at compile time – super cool!
Syntax considerations
Developer syntax
This is the main touchpoint for developers, so it should be easy and sensible – but it is changeable over time
Wrapping enums can be tricky – and it’s awkward to have to specify the enum type at each log callsite. But this is still just a proposed syntax and there’s room for change
Encoding/formatting syntax
We’re committing to this! It will be embedded in token databases and implemented in multiple languages, so whatever we choose here, we will have to live with