{"id":19096186,"url":"https://github.com/cobular/defmt-serial","last_synced_at":"2026-06-18T04:31:58.914Z","repository":{"id":241645050,"uuid":"807333643","full_name":"Cobular/defmt-serial","owner":"Cobular","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-29T02:22:17.000Z","size":484,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"eh-1","last_synced_at":"2026-01-31T21:05:12.076Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cobular.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-28T22:46:39.000Z","updated_at":"2024-05-28T22:47:57.000Z","dependencies_parsed_at":"2024-05-29T13:32:50.415Z","dependency_job_id":"d36e6f36-a868-46a9-b8dd-dc3ca08b19d8","html_url":"https://github.com/Cobular/defmt-serial","commit_stats":null,"previous_names":["cobular/defmt-serial"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Cobular/defmt-serial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobular%2Fdefmt-serial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobular%2Fdefmt-serial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobular%2Fdefmt-serial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobular%2Fdefmt-serial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cobular","download_url":"https://codeload.github.com/Cobular/defmt-serial/tar.gz/refs/heads/eh-1","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobular%2Fdefmt-serial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34476727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T03:36:02.801Z","updated_at":"2026-06-18T04:31:58.897Z","avatar_url":"https://github.com/Cobular.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Crates.io](https://img.shields.io/crates/v/defmt-serial.svg)](https://crates.io/crates/defmt-serial)\n[![Documentation](https://docs.rs/defmt-serial/badge.svg)](https://docs.rs/defmt-serial/)\n[![tests](https://github.com/gauteh/defmt-serial/actions/workflows/rust.yml/badge.svg)](https://github.com/gauteh/defmt-serial/actions/workflows/rust.yml)\n\n# defmt-serial\n\nA [defmt](https://github.com/knurling-rs/defmt) target for logging over a serial\nport. Have a look at examples to see how to use library\n[example-artemis](example-artemis) or [example-pi-pico](example-pi-pico). You\ncan also try it out in a hosted environment: [example-std](example-std). To\nparse the logs have a look at [parsing logs](#Parsing-logs).\n\n```rust\nstatic SERIAL: StaticCell\u003chal::uart::Uart0\u003e = StaticCell::new();\n\n#[entry]\nfn main() -\u003e ! {\n    let mut dp = hal::pac::Peripherals::take().unwrap();\n    let pins = hal::gpio::Pins::new(dp.GPIO);\n\n    // set up serial\n    let serial = hal::uart::Uart0::new(dp.UART0, pins.tx0, pins.rx0);\n    defmt_serial::defmt_serial(SERIAL.init(serial));\n\n    defmt::info!(\"Hello from defmt!\");\n\n    loop {\n        asm::wfi();\n    }\n}\n```\n\nRemember to set the `DEFMT_LOG` variable when testing, e.g.:\n\n```\n$ cd example-std/\n$ DEFMT_LOG=debug cargo run\n```\n\n\u003cimg src=\"example-defmt-serial.png\" width=\"80%\"\u003e\u003c/img\u003e\n\n## Parsing logs\n\nThe easiest way to parse the logs is to use `socat` and `defmt-print` together.\nFor example:\n```\n$ socat ${PORT},rawer,b${BAUDRATE} STDOUT | defmt-print -e ${ELF}\n```\nJust replace `${PORT}`, `${BAUDRATE}` and `${ELF}` with correct values.\n\nTo install the tools on Ubuntu 22.04 run these commands:\n```\n$ apt install socat\n$ cargo install defmt-print\n```\n\nNote that on Mac OS it seems that `socat` is broken for this purpose. Use `stty`\nand `cat` in stead:\n\n```\n$ (stty speed 115200 \u003e/dev/null \u0026\u0026 cat) \u003c/dev/cu.usbserial-10 | defmt-print -e $(ELF)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobular%2Fdefmt-serial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcobular%2Fdefmt-serial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobular%2Fdefmt-serial/lists"}