1"use strict";(self.webpackChunkmilkv_website=self.webpackChunkmilkv_website||[]).push([[5523],{29104:(e,o,s)=>{s.r(o),s.d(o,{assets:()=>d,contentTitle:()=>i,default:()=>c,frontMatter:()=>r,metadata:()=>a,toc:()=>l});var n=s(85893),t=s(11151);const r={sidebar_label:"Bootloader Update",sidebar_position:40},i="Milk-V Mars CM Bootloader Update Guide",a={id:"mars/compute-module/bootloader",title:"Milk-V Mars CM Bootloader Update Guide",description:"Whether Mars CM starts the system through the SD card or the eMMC module, it must be started through the Bootloader boot program. This boot program is stored in an SPI Flash on the board and contains two parts: SPL and U-Boot.",source:"@site/docs/mars/compute-module/bootloader.md",sourceDirName:"mars/compute-module",slug:"/mars/compute-module/bootloader",permalink:"/docs/mars/compute-module/bootloader",draft:!1,unlisted:!1,editUrl:"https://github.com/milk-v/milkv.io/edit/main/docs/mars/compute-module/bootloader.md",tags:[],version:"current",sidebarPosition:40,frontMatter:{sidebar_label:"Bootloader Update",sidebar_position:40},sidebar:"mars",previous:{title:"Extend Partition",permalink:"/docs/mars/compute-module/extendpartition"},next:{title:"Hardware Docs",permalink:"/docs/mars/compute-module/hardware"}},d={},l=[{value:"Upgrade Bootloader using UsbFlashTool Windows tool",id:"upgrade-bootloader-using-usbflashtool-windows-tool",level:2},{value:"Download UsbFlashTool burning tool and Bootloader firmware",id:"download-usbflashtool-burning-tool-and-bootloader-firmware",level:3},{value:"Install driver for the burning tool",id:"install-driver-for-the-burning-tool",level:3},{value:"Upgrade Bootloader",id:"upgrade-bootloader",level:3}];function h(e){const o={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,t.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.h1,{id:"milk-v-mars-cm-bootloader-update-guide",children:"Milk-V Mars CM Bootloader Update Guide"}),"\n",(0,n.jsxs)(o.p,{children:["Whether Mars CM starts the system through the SD card or the eMMC module, it must be started through the Bootloader boot program. This boot program is stored in an SPI Flash on the board and contains two parts: ",(0,n.jsx)(o.code,{children:"SPL"})," and ",(0,n.jsx)(o.code,{children:"U-Boot"}),"."]}),"\n",(0,n.jsx)(o.admonition,{type:"tip",children:(0,n.jsx)(o.p,{children:"The Bootloader in Mars CM can be understood as the BIOS in PC"})}),"\n",(0,n.jsx)(o.p,{children:"When Mars CM is shipped, it already comes with a pre-installed initial Bootloader program. There is no need to upgrade this program during normal usage. Bootloader upgrade is only necessary in the following situations:"}),"\n",(0,n.jsxs)(o.ol,{children:["\n",(0,n.jsx)(o.li,{children:"When the bootloader program in SPI Flash is accidentally damaged, causing the system to fail to start normally."}),"\n",(0,n.jsx)(o.li,{children:"When upgrading the official system image (such as Debian), it must be matched with the new bootloader, otherwise it cannot be started."}),"\n",(0,n.jsx)(o.li,{children:"U-Boot has fixed some bugs or added new functions. When you need to use these new functions."}),"\n"]}),"\n",(0,n.jsx)(o.p,{children:"There are several ways to update the Bootloader in SPI Flash on Mars CM, such as Windows burning tools, TFTP, flashcp commands, etc. Here we first introduce how to use the UsbFlashTool burning tool in Windows systems."}),"\n",(0,n.jsxs)(o.p,{children:["Mars CM can be used with different base-boards. Here we take the Raspberry Pi ",(0,n.jsx)(o.code,{children:"CM4 IO Board"})," base board as an example."]}),"\n",(0,n.jsx)(o.h2,{id:"upgrade-bootloader-using-usbflashtool-windows-tool",children:"Upgrade Bootloader using UsbFlashTool Windows tool"}),"\n",(0,n.jsx)(o.h3,{id:"download-usbflashtool-burning-tool-and-bootloader-firmware",children:"Download UsbFlashTool burning tool and Bootloader firmware"}),"\n",(0,n.jsx)(o.p,{children:(0,n.jsx)(o.a,{href:"https://github.com/milkv-mars/mars-tools/blob/main/Mars-UsbFlashTool-v2.4-Windows.zip",children:"UsbFlashTool"})}),"\n",(0,n.jsx)(o.p,{children:(0,n.jsx)(o.a,{href:"https://github.com/milkv-mars/mars-buildroot-sdk/releases",children:"Bootloader firmware"})}),"\n",(0,n.jsx)(o.pre,{children:(0,n.jsx)(o.code,{children:"SPL: u-boot-spl.bin.normal.out\nU-BOOT: visionfive2_fw_payload.img\n"})}),"\n",(0,n.jsx)(o.h3,{id:"install-driver-for-the-burning-tool",children:"Install driver for the burning tool"}),"\n",(0,n.jsx)(o.admonition,{type:"tip",children:(0,n.jsx)(o.p,{children:"Driver installation is only required for the first use."})}),"\n",(0,n.jsxs)(o.p,{children:["Please refer to ",(0,n.jsx)(o.a,{href:"https://milkv.io/docs/mars/compute-module/boot#install-driver-for-the-burning-tool",children:"Install driver for the burning tool\n"}),"."]}),"\n",(0,n.jsx)(o.p,{children:"After installing the driver, return here to continue the operation."}),"\n",(0,n.jsx)(o.h3,{id:"upgrade-bootloader",children:"Upgrade Bootloader"}),"\n",(0,n.jsx)(o.p,{children:"The first 6 steps of burning the bootloader are the same as the first 6 steps of installing the driver above."}),"\n",(0,n.jsxs)(o.ol,{children:["\n",(0,n.jsxs)(o.li,{children:["\n",(0,n.jsx)(o.p,{children:"Connect the USB to TTL serial port cable to the 40 pin header on the base-board, connect the USB to the PC and note down the serial port number"}),"\n",(0,n.jsx)(o.p,{children:(0,n.jsx)(o.img,{alt:"mars-cm",src:s(6027).Z+"",width:"1600",height:"885"})}),"\n",(0,n.jsx)(o.p,{children:(0,n.jsx)(o.img,{alt:"mars-cm",src:s(32328).Z+"",width:"2747",height:"1602"})}),"\n",(0,n.jsx)(o.p,{children:(0,n.jsx)(o.strong,{children:"Note: If any other serial port program is open and using the serial port, please exit the program to release the port and avoid occupying it."})}),"\n"]}),"\n",(0,n.jsxs)(o.li,{children:["\n",(0,n.jsx)(o.p,{children:"Short-circuit pins 1 and 2 of the J12 header on the CM4 IO Board using a jumper cap (USB flashing mode)"}),"\n",(0,n.jsx)(o.p,{children:(0,n.jsx)(o.img,{alt:"mars-cm",src:s(43034).Z+"",width:"1600",height:"939"})}),"\n"]}),"\n",(0,n.jsxs)(o.li,{children:["\n",(0,n.jsx)(o.p,{children:"Connect the PC and the base-board's J11 USB Slave interface using a Micro USB data cable"}),"\n",(0,n.jsx)(o.p,{children:(0,n.jsx)(o.img,{alt:"mars-cm",src:s(83722).Z+"",width:"1600",height:"988"})}),"\n"]}),"\n",(0,n.jsxs)(o.li,{children:["\n",(0,n.jsxs)(o.p,{children:["Run the ",(0,n.jsx)(o.code,{children:"UsbFlashTool-*-Windows.exe"})," flashing program in the flashing tool directory"]}),"\n",(0,n.jsx)(o.p,{children:(0,n.jsx)(o.img,{alt:"mars-cm",src:s(58380).Z+"",width:"2371",height:"1521"})}),"\n"]}),"\n",(0,n.jsxs)(o.li,{children:["\n",(0,n.jsxs)(o.p,{children:["Set the serial port number in the ",(0,n.jsx)(o.code,{children:"Serial Setting"})," on the right side to the serial port number noted in step 1"]}),"\n",(0,n.jsx)(o.p,{children:(0,n.jsx)(o.img,{alt:"mars-cm",src:s(32783).Z+"",width:"2172",height:"1710"})}),"\n"]}),"\n",(0,n.jsxs)(o.li,{children:["\n",(0,n.jsx)(o.p,{children:"Power on the base-board through the 12V DC interface"}),"\n"]}),"\n",(0,n.jsxs)(o.li,{children:["\n",(0,n.jsxs)(o.p,{children:["Flash the ",(0,n.jsx)(o.code,{children:"SPL"})]}),"\n",(0,n.jsxs)(o.p,{children:["Click ",(0,n.jsx)(o.code,{children:"File Select"}),", select the ",(0,n.jsx)(o.code,{children:"SPL"})," firmware ",(0,n.jsx)(o.code,{children:"u-boot-spl.bin.normal.out"})," to be burned, select ",(0,n.jsx)(o.code,{children:"SPL"})," in ",(0,n.jsx)(o.code,{children:"File Type"}),", select ",(0,n.jsx)(o.code,{children:"FLASH"})," in ",(0,n.jsx)(o.code,{children:"Memory Type"}),", Click ",(0,n.jsx)(o.code,{children:"Load"})," to start burning firmware."]}),"\n",(0,n.jsx)(o.p,{children:(0,n.jsx)(o.img,{alt:"mars",src:s(18895).Z+"",width:"2389",height:"1881"})}),"\n",(0,n.jsxs)(o.p,{children:["After successful burning, ",(0,n.jsx)(o.code,{children:"SUCCEED"})," and ",(0,n.jsx)(o.code,{children:"Complete"})," will be displayed."]}),"\n",(0,n.jsx)(o.p,{children:(0,n.jsx)(o.img,{alt:"mars",src:s(96464).Z+"",width:"2389",height:"1828"})}),"\n"]}),"\n",(0,n.jsxs)(o.li,{children:["\n",(0,n.jsxs)(o.p,{children:["Flash the ",(0,n.jsx)(o.code,{children:"U-BOOT"})]}),"\n",(0,n.jsxs)(o.p,{children:["Click ",(0,n.jsx)(o.code,{children:"File Select"}),", select the ",(0,n.jsx)(o.code,{children:"U-BOOT"})," firmware ",(0,n.jsx)(o.code,{children:"visionfive2_fw_payload.img"})," to be burned, select ",(0,n.jsx)(o.code,{children:"U-Boot"})," in ",(0,n.jsx)(o.code,{children:"File Type"}),", select ",(0,n.jsx)(o.code,{children:"FLASH"})," in ",(0,n.jsx)(o.code,{children:"Memory Type"}),", and then click ",(0,n.jsx)(o.code,{children:"Load"})," to start burning firmware."]}),"\n",(0,n.jsx)(o.p,{children:(0,n.jsx)(o.img,{alt:"mars",src:s(65717).Z+"",width:"2606",height:"1994"})}),"\n",(0,n.jsxs)(o.p,{children:["After successful burning, ",(0,n.jsx)(o.code,{children:"SUCCEED"})," and ",(0,n.jsx)(o.code,{children:"Complete"})," will be displayed."]}),"\n",(0,n.jsx)(o.p,{children:(0,n.jsx)(o.img,{alt:"mars",src:s(95933).Z+"",width:"2606",height:"1994"})}),"\n"]}),"\n",(0,n.jsxs)(o.li,{children:["\n",(0,n.jsx)(o.p,{children:"After burning is completed, close the UsbFlashTool window, power off the base-board, and remove the jumper cap in step 2"}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(o.p,{children:"After powering on again, you can determine whether the bootloader has been updated based on the time information in the serial port log."}),"\n",(0,n.jsx)(o.pre,{children:(0,n.jsx)(o.code,{children:"U-Boot SPL 2021.10 (Aug 31 2023 - 12:55:45 +0800)\n"})}),"\n",(0,n.jsx)(o.pre,{children:(0,n.jsx)(o.code,{children:"U-Boot 2021.10 (Aug 31 2023 - 12:55:45 +0800), Build: jenkins-github_visionfive2-17\n"})})]})}function c(e={}){const{wrapper:o}={...(0,t.a)(),...e.components};return o?(0,n.jsx)(o,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},6027:(e,o,s)=>{s.d(o,{Z:()=>n});const n=s.p+"assets/images/mars-cm-docs_boot_01-7da76c252ed29c64af62b19549cb26db.jpg"},43034:(e,o,s)=>{s.d(o,{Z:()=>n});const n=s.p+"assets/images/mars-cm-docs_boot_03-745e1c359a5f68064a11734d86d4f84e.
1jpg"},83722:(e,o,s)=>{s.d(o,{Z:()=>n});const n=s.p+"assets/images/mars-cm-docs_boot_04-7bf4e4970f9271a316afeab2ef640d8c.jpg"},32328:(e,o,s)=>{s.d(o,{Z:()=>n});const n=s.p+"assets/images/mars-usb-flash-tool_02-61bdf5c852365c99e253d071ed3e1eab.png"},58380:(e,o,s)=>{s.d(o,{Z:()=>n});const n=s.p+"assets/images/mars-usb-flash-tool_05-e927dc22fd308e8821aff09f16e83318.png"},32783:(e,o,s)=>{s.d(o,{Z:()=>n});const n=s.p+"assets/images/mars-usb-flash-tool_06-0b8970ecd756004213d61339299e0ba9.png"},18895:(e,o,s)=>{s.d(o,{Z:()=>n});const n=s.p+"assets/images/mars-usb-flash-tool_16-5eb53bfd7cdfecf6618985145d536d20.png"},96464:(e,o,s)=>{s.d(o,{Z:()=>n});const n=s.p+"assets/images/mars-usb-flash-tool_17-0a6781814eb57c239b3ecc3e9679de09.png"},65717:(e,o,s)=>{s.d(o,{Z:()=>n});const n=s.p+"assets/images/mars-usb-flash-tool_18-939cd6b72c001448a7ab08cad42ffbcb.png"},95933:(e,o,s)=>{s.d(o,{Z:()=>n});const n=s.p+"assets/images/mars-usb-flash-tool_19-009673de5dffbe4f4cf5b8da24661ec9.png"},11151:(e,o,s)=>{s.d(o,{Z:()=>a,a:()=>i});var n=s(67294);const t={},r=n.createContext(t);function i(e){const o=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function a(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:i(e.components),n.createElement(r.Provider,{value:o},e.children)}}}]);
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.