1"use strict";(self.webpackChunkmeshtastic=self.webpackChunkmeshtastic||[]).push([["14311"],{42210(e,t,r){r.r(t),r.d(t,{metadata:()=>n,default:()=>m,frontMatter:()=>a,contentTitle:()=>d,toc:()=>h,assets:()=>l});var n=JSON.parse('{"id":"getting-started/flashing-firmware/stm32/entering-bootloader-mode","title":"Getting an STM32 Device Ready to Flash","description":"Prepare an STM32WL device for flashing by entering the ROM bootloader or connecting an SWD programmer.","source":"@site/docs/getting-started/flashing-firmware/stm32/entering-bootloader-mode.mdx","sourceDirName":"getting-started/flashing-firmware/stm32","slug":"/getting-started/flashing-firmware/stm32/entering-bootloader-mode","permalink":"/docs/getting-started/flashing-firmware/stm32/entering-bootloader-mode","draft":false,"unlisted":false,"editUrl":"https://github.com/meshtastic/meshtastic/edit/master/docs/getting-started/flashing-firmware/stm32/entering-bootloader-mode.mdx","tags":[],"version":"current","lastUpdatedBy":"rcarteraz","sidebarPosition":1,"frontMatter":{"id":"entering-bootloader-mode","title":"Getting an STM32 Device Ready to Flash","sidebar_label":"Getting Ready to Flash","sidebar_position":1,"description":"Prepare an STM32WL device for flashing by entering the ROM bootloader or connecting an SWD programmer."},"sidebar":"Sidebar","previous":{"title":"STM32 Device","permalink":"/docs/getting-started/flashing-firmware/stm32/"},"next":{"title":"Flashing over UART","permalink":"/docs/getting-started/flashing-firmware/stm32/flashing-over-uart"}}'),o=r(91987),i=r(67008),s=r(87622);let a={id:"entering-bootloader-mode",title:"Getting an STM32 Device Ready to Flash",sidebar_label:"Getting Ready to Flash",sidebar_position:1,description:"Prepare an STM32WL device for flashing by entering the ROM bootloader or connecting an SWD programmer."},d,l={},h=[{value:"Meshtastic Client",id:"meshtastic-client",level:2},{value:"BOOT0",id:"boot0",level:2},{value:"SWD",id:"swd",level:2}];function c(e){let t={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.p,{children:"Both flashing methods need the board in the right state before you can write\nfirmware. The three methods below are ordered most convenient first:"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Meshtastic Client"})," and ",(0,o.jsx)(t.strong,{children:"BOOT0"})," enter the ROM bootloader, which a\n",(0,o.jsx)(t.a,{href:"/docs/getting-started/flashing-firmware/stm32/flashing-over-uart",children:"UART flash"}),"\nneeds."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:(0,o.jsx)(s.A,{term:"SWD",definition:"A two-pin debug and programming interface, used on STM32 devices to enter bootloader mode and flash firmware.",routePath:"/docs/terms/",children:"SWD"})})," resets the ",(0,o.jsx)(s.A,{term:"MCU",definition:"The microcontroller that runs the firmware on a device. The hardware tables list the MCU for each supported board.",routePath:"/docs/terms/",children:"MCU"})," and connects to it directly for an\n",(0,o.jsx)(t.a,{href:"/docs/getting-started/flashing-firmware/stm32/flashing-over-swd",children:"SWD flash"}),";\nit does not use the ROM bootloader."]}),"\n"]}),"\n",(0,o.jsx)(t.h2,{id:"meshtastic-client",children:"Meshtastic Client"}),"\n",(0,o.jsx)(t.p,{children:"Once Meshtastic firmware is installed, the board can be rebooted into the ROM\nbootloader without touching the hardware:"}),"\n",(0,o.jsxs)(t.ol,{children:["\n",(0,o.jsxs)(t.li,{children:["Connect to the node over ",(0,o.jsx)(s.A,{term:"USB",definition:"The wired connection used to power a device, flash firmware onto it, and communicate with it over serial.",routePath:"/docs/terms/",children:"USB"})," (or ",(0,o.jsx)(s.A,{term:"BLE",definition:"The default wireless connection between a node and a phone client.",routePath:"/docs/terms/",children:"BLE"}),")."]}),"\n",(0,o.jsxs)(t.li,{children:["Run ",(0,o.jsx)(t.code,{children:"meshtastic --enter-dfu"}),", or select the equivalent option in the app."]}),"\n"]}),"\n",(0,o.jsxs)(t.p,{children:["On boards whose ",(0,o.jsx)(s.A,{term:"USB",definition:"The wired connection used to power a device, flash firmware onto it, and communicate with it over serial.",routePath:"/docs/terms/",children:"USB"})," serial port connects to the ROM bootloader ",(0,o.jsx)(s.A,{term:"UART",definition:"A serial interface used to communicate with a device over its pins or through a USB-to-serial bridge.",routePath:"/docs/terms/",children:"UART"}),", this allows\nfirmware upgrades over\n",(0,o.jsx)(t.a,{href:"/docs/getting-started/flashing-firmware/stm32/flashing-over-uart",children:"UART"})," with no\nextra wiring."]}
1),"\n",(0,o.jsx)(t.h2,{id:"boot0",children:"BOOT0"}),"\n",(0,o.jsx)(t.p,{children:"On boards that route the BOOT0 pin to a pad, jumper, or switch:"}),"\n",(0,o.jsxs)(t.ol,{children:["\n",(0,o.jsx)(t.li,{children:"Tie BOOT0 high (to 3V3)."}),"\n",(0,o.jsx)(t.li,{children:"Reset or power-cycle the board. It comes out of reset in the ROM bootloader."}),"\n",(0,o.jsxs)(t.li,{children:["Flash the firmware over\n",(0,o.jsx)(t.a,{href:"/docs/getting-started/flashing-firmware/stm32/flashing-over-uart",children:"UART"}),"."]}),"\n",(0,o.jsx)(t.li,{children:"Return BOOT0 to ground (or let it float if the board has a pull-down) and\nreset again to run the firmware."}),"\n"]}),"\n",(0,o.jsx)(t.admonition,{type:"note",children:(0,o.jsx)(t.p,{children:"Some boards, such as the Wio-E5, do not expose the BOOT0 pin; use another method."})}),"\n",(0,o.jsx)(t.h2,{id:"swd",children:"SWD"}),"\n",(0,o.jsxs)(t.p,{children:["An ",(0,o.jsx)(s.A,{term:"SWD",definition:"A two-pin debug and programming interface, used on STM32 devices to enter bootloader mode and flash firmware.",routePath:"/docs/terms/",children:"SWD"})," programmer such as an\n",(0,o.jsx)(t.a,{href:"https://www.st.com/en/development-tools/st-link-v2.html",children:"ST-LINK"})," writes firmware\nstraight to flash over the ",(0,o.jsx)(s.A,{term:"SWD",definition:"A two-pin debug and programming interface, used on STM32 devices to enter bootloader mode and flash firmware.",routePath:"/docs/terms/",children:"SWD"})," pins. It resets and halts the ",(0,o.jsx)(s.A,{term:"MCU",definition:"The microcontroller that runs the firmware on a device. The hardware tables list the MCU for each supported board.",routePath:"/docs/terms/",children:"MCU"})," to do this, so\nit never uses the ROM bootloader and needs neither BOOT0 nor a working Meshtastic\nclient. That makes it the only option for a board that is not already running\nMeshtastic firmware and has no reachable BOOT0 pin. Continue at\n",(0,o.jsx)(t.a,{href:"/docs/getting-started/flashing-firmware/stm32/flashing-over-swd",children:"Flashing over SWD"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["For the BOOT0 pin location, ",(0,o.jsx)(s.A,{term:"UART",definition:"A serial interface used to communicate with a device over its pins or through a USB-to-serial bridge.",routePath:"/docs/terms/",children:"UART"})," pins, and any board-specific steps, see the\ndocumentation for your board."]})]})}function m(e={}){let{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(c,{...e})}):c(e)}},67008(e,t,r){r.d(t,{R:()=>s,x:()=>a});var n=r(71763);let o={},i=n.createContext(o);function s(e){let t=n.useContext(i);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),n.createElement(i.Provider,{value:t},e.children)}},87622(e,t,r){r.d(t,{A:()=>s});var n=r(71763),o=r(37773),i=r(91987);function s({term:e,definition:t,abbreviation:r,routePath:a="/glossary",children:d}
1){let[l,h]=(0,n.useState)(!1),[c,m]=(0,n.useState)(null),[f,g]=(0,n.useState)("top"),u=(0,n.useRef)(null),p=(0,n.useRef)(null),w=(0,n.useCallback)(()=>{let e;if(!u.current||!p.current)return;let t=u.current.getBoundingClientRect(),r=p.current.getBoundingClientRect(),n=window.innerWidth,o=window.innerHeight,i=document.querySelector(".navbar"),s=i?i.getBoundingClientRect().bottom:0,a=t.top-s>=r.height+8,d=o-t.bottom>=r.height+8,l=a||!d?"top":"bottom";e="top"===l?t.top-r.height-8:t.bottom+8;let h=t.left+t.width/2-r.width/2;h=Math.max(8,Math.min(h,n-r.width-8)),g(l),m({top:Math.max(s+4,e),left:h})},[]);(0,n.useEffect)(()=>{let e;if(!l)return;let t=requestAnimationFrame(()=>{e=requestAnimationFrame(()=>{w()})}),r=()=>w(),n=()=>w();return window.addEventListener("scroll",r,!0),window.addEventListener("resize",n),()=>{cancelAnimationFrame(t),e&&cancelAnimationFrame(e),window.removeEventListener("scroll",r,!0),window.removeEventListener("resize",n)}},[l,w]);let b=(0,o.P_)("docusaurus-plugin-glossary"),x=(0,n.useMemo)(()=>{if(t&&"string"==typeof t&&t.length>0)return t;let r=(b&&b.terms||[]).find(t=>"string"==typeof t.term&&t.term.toLowerCase()===String(e).toLowerCase());return r&&r.definition?r.definition:void 0},[t,b,e]),v=(0,n.useMemo)(()=>{let t=r;if(!t){let r=(b&&b.terms||[]).find(t=>"string"==typeof t.term&&t.term.toLowerCase()===String(e).toLowerCase());t=r&&r.abbreviation}if("string"!=typeof t)return;let n=t.trim();if(n&&n.toLowerCase()!==String(e).toLowerCase())return n},[r,b,e]),j=(0,n.useMemo)(()=>a&&"string"==typeof a&&a.length>0?a:b&&b.routePath||"/glossary",[b,a]),M=d||e,T=e.toLowerCase().replace(/\s+/g,"-");return(0,i.jsxs)("span",{ref:u,className:"glossaryTermWrapper_ud7W",children:[(0,i.jsx)("a",{href:`${j}#${T}`,className:"glossaryTerm_x2nJ",onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onFocus:()=>h(!0),onBlur:()=>h(!1),"aria-describedby":`tooltip-${T}`,children:M}),x&&(0,i.jsxs)("span",{ref:p,id:`tooltip-${T}`,className:`tooltip_WjgA ${l?"tooltipVisible_AjfD":""} ${"top"===f?"tooltipTop_uMN4":"tooltipBottom_U9P5"} tooltipFloating_nLk7`,role:"tooltip",style:l&&c?{top:`${c.top}px`,left:`${c.left}px`}:void 0,children:[(0,i.jsx)("strong",{children:e}),v?` (${v}). `:"",x]})]})}}}]);
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.