1"use strict";(self.rspackChunkrmk_rspress=self.rspackChunkrmk_rspress||[]).push([[6424],{3899(e,s,n){n.r(s);var r=n(1684),o=n(506),l=n(6306);function i(e){let s={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",span:"span",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.h1,{id:"usb-logging",children:[(0,r.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#usb-logging",children:"#"}),"USB Logging"]}),"\n",(0,r.jsxs)(s.p,{children:["RMK uses ",(0,r.jsx)(s.a,{href:"https://defmt.ferrous-systems.com",rel:"noopener noreferrer",target:"_blank",children:"defmt"})," as the default logger, which works great if you have a debug probe. If you donât have a debug probe, you can still view logs over USB by configuring USB as a serial port."]}),"\n",(0,r.jsxs)(s.h2,{id:"usage",children:[(0,r.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#usage",children:"#"}),"Usage"]}),"\n",(0,r.jsxs)(s.p,{children:["To enable USB logging, disable the default features and then enable the ",(0,r.jsx)(s.code,{children:"usb_log"})," feature in ",(0,r.jsx)(s.code,{children:"Cargo.toml"}),":"]}),"\n",(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(s.pre,{className:"shiki css-variables",style:{backgroundColor:"var(--shiki-background)",color:"var(--shiki-foreground)"},tabIndex:"0",lang:"toml",children:(0,r.jsxs)(s.code,{children:[(0,r.jsxs)(s.span,{className:"line",children:[(0,r.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"rmk "}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" { version "}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:' "..."'}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" default-features "}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" false"}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" features "}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" ["})]}),"\n",(0,r.jsxs)(s.span,{className:"line",children:[(0,r.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:' "storage"'}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsxs)(s.span,{className:"line",children:[(0,r.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:' "usb_log"'}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:" # Enable USB logging"})]}),"\n",(0,r.jsxs)(s.span,{className:"line",children:[(0,r.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:' ".."'}),(0,r.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,r.jsx)(s.span,{className:"line",children:(0,r.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"] }"})})]})})}),"\n",(0,r.jsx)(l.Pq,{type:"tip",title:"Tip",children:(0,r.jsx)(s.p,{children:"\nDon't forget to enable all other features that you need, especially the default ones."})}),"\n",(0,r.jsx)(s.p,{children:"To view the logs, you'll need to install a serial port monitor. Open your serial monitor, select the port corresponding to your keyboard, and connect. The logs will be displayed in the monitor window. Note that logs from the boot stage cannot be captured by the USB logger. You will only be able to see logs after the serial port connection is established."}),"\n",(0,r.jsx)(s.p,{children:"Some microcontrollers (like ESP32S3) don't have enough USB endpoints, so USB logging cannot be enabled for those microcontrollers. To enable USB logging, make sure that your microcontroller has at least 5 In + 4 OUT endpoints available (except the control endpoint, EP0)."})]})}function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:s}={...(0,o.R)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}a.__RSPRESS_PAGE_META={},a.__RSPRESS_PAGE_META["v0.8%2Fdocs%2Ffeatures%2Fusb_logging.md"]={toc:[{id:"usage",text:"Usage",depth:2}],title:"USB Logging",headingTitle:"USB Logging",frontmatter:{}},n.d(s,{default:()=>a})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.