{"id":136,"date":"2020-02-08T03:22:46","date_gmt":"2020-02-08T03:22:46","guid":{"rendered":"http:\/\/blog.rctoysky.com\/?p=136"},"modified":"2020-02-08T03:23:46","modified_gmt":"2020-02-08T03:23:46","slug":"px4bootloader-update","status":"publish","type":"post","link":"https:\/\/blog.rctoysky.com\/?p=136","title":{"rendered":"PX4:Bootloader Update"},"content":{"rendered":"\n<p>The&nbsp;<a href=\"https:\/\/github.com\/PX4\/Bootloader\" target=\"_blank\" rel=\"noreferrer noopener\">PX4 bootloader<\/a>&nbsp;is used to load firmware for Pixhawk boards (PX4FMU, PX4IO) and&nbsp;<a href=\"https:\/\/docs.px4.io\/v1.9.0\/en\/sensor\/px4flow.html\">PX4FLOW<\/a>.<\/p>\n\n\n\n<p>This topic explains several methods for updating the Pixhawk bootloader.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><\/p><p>Hardware usually comes with an appropriate bootloader version pre-installed. A case where you may need to update is newer Pixhawk boards that install FMUv2 firmware:&nbsp;<a href=\"https:\/\/docs.px4.io\/v1.9.0\/en\/config\/firmware.html#bootloader\">Firmware &gt; FMUv2 Bootloader Update<\/a>.<\/p><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"qgc_bootloader_update\">QGroundControl Bootloader Update<\/h2>\n\n\n\n<p>The easiest approach is to first use&nbsp;<em>QGroundControl<\/em>&nbsp;to install firmware with the desired\/latest bootloader. You can then initiate bootloader update on next restart by setting the parameter:&nbsp;<a href=\"https:\/\/docs.px4.io\/v1.9.0\/en\/advanced_config\/parameter_reference.html#SYS_BL_UPDATE\">SYS_BL_UPDATE<\/a>.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><\/p><p>This approach can only be used if&nbsp;<a href=\"https:\/\/docs.px4.io\/v1.9.0\/en\/advanced_config\/parameter_reference.html#SYS_BL_UPDATE\">SYS_BL_UPDATE<\/a>&nbsp;is present in firmware (currently just FMUv2 and some custom firmware).<\/p><\/blockquote>\n\n\n\n<p>The steps are:<\/p>\n\n\n\n<ol><li>Insert an SD card (enables boot logging to debug any problems).<\/li><li><a href=\"https:\/\/docs.px4.io\/v1.9.0\/en\/config\/firmware.html#custom\">Update the Firmware<\/a>&nbsp;with an image containing the new\/desired bootloader.The updated bootloader might be supplied in custom firmware (i.e. from the dev team), or it or may be included in the latest master.<\/li><li>Wait for the vehicle to reboot.<\/li><li><a href=\"https:\/\/docs.px4.io\/v1.9.0\/en\/advanced_config\/parameters.html#parameter-configuration\">Find and enable<\/a>&nbsp;the parameter&nbsp;<a href=\"https:\/\/docs.px4.io\/v1.9.0\/en\/advanced_config\/parameter_reference.html#SYS_BL_UPDATE\">SYS_BL_UPDATE<\/a>.<\/li><li>Reboot (disconnect\/reconnect the board). The bootloader update will only take a few seconds.<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/docs.px4.io\/v1.9.0\/assets\/qgc\/setup\/firmware\/bootloader_update.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>Generally at this point you may then want to&nbsp;<a href=\"https:\/\/docs.px4.io\/v1.9.0\/en\/config\/firmware.html\">update the firmware<\/a>&nbsp;again using the correct\/newly installed bootloader.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"dronecode_probe\">Dronecode Probe Bootloader Update<\/h3>\n\n\n\n<p>The following steps explain how you can &#8220;manually&#8221; update the bootloader using the dronecode probe:<\/p>\n\n\n\n<ol><li>Get a binary containing the bootloader (either from dev team or build it yourself).<\/li><li>Connect the Dronecode probe to your PC via USB.<\/li><li>Go into the directory containing the binary and run the following command in the terminal:<code>arm-none-eabi-gdb px4fmuv5_bl.elf\n<\/code><\/li><li>The&nbsp;<em>gdb terminal<\/em>&nbsp;appears and it should display the following output:<code>GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-git\nCopyright (C) 2017 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later &lt;http:\/\/gnu.org\/licenses\/gpl.html&gt;\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\nThis GDB was configured as \"--host=x86_64-linux-gnu --target=arm-none-eabi\".\nType \"show configuration\" for configuration details.\nFor bug reporting instructions, please see:\n&lt;http:\/\/www.gnu.org\/software\/gdb\/bugs\/&gt;.\nFind the GDB manual and other documentation resources online at:\n&lt;http:\/\/www.gnu.org\/software\/gdb\/documentation\/&gt;.\nFor help, type \"help\".\nType \"apropos word\" to search for commands related to \"word\"...\nReading symbols from px4fmuv5_bl.elf...done.\n<\/code><\/li><li>Find your&nbsp;<code>&lt;dronecode-probe-id&gt;<\/code>&nbsp;by running an ls command in the&nbsp;<strong>\/dev\/serial\/by-id<\/strong>&nbsp;directory.<\/li><li>Now connect to the Dronecode probe with the following command:<code>tar ext \/dev\/serial\/by-id\/&lt;dronecode-probe-id&gt;\n<\/code><\/li><li>Power on the Pixhawk with another USB cable and connect the Dronecode probe to the FMU-DEBUG port.To be able to connect the Dronecode probe to the FMU-DEBUG port, you may need to remove the case (e.g. on Pixhawk 4 you would do this using a T6 Torx screwdriver).<\/li><li>Use the following command to scan for the Pixhawk\u2019s swd and connect to it:<code>(gdb) mon swdp_scan\n(gdb) attach 1\n<\/code><\/li><li>Load the binary into the Pixhawk:<code>(gdb) load\n<\/code><\/li><\/ol>\n\n\n\n<p>After the bootloader has updated you can&nbsp;<a href=\"https:\/\/docs.px4.io\/v1.9.0\/en\/config\/firmware.html\">Load PX4 Firmware<\/a>&nbsp;using&nbsp;<em>QGroundControl<\/em>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"non-pixhawk\">Other Boards (Non-Pixhawk)<\/h2>\n\n\n\n<p>Boards that are not part of the&nbsp;<a href=\"https:\/\/docs.px4.io\/v1.9.0\/en\/flight_controller\/pixhawk_series.html\">Pixhawk Series<\/a>&nbsp;will have their own mechanisms for bootloader update.<\/p>\n\n\n\n<p>These will be documented (where relevant) with the board:<\/p>\n\n\n\n<ul><li><a href=\"https:\/\/docs.px4.io\/v1.9.0\/en\/flight_controller\/omnibus_f4_sd.html#upload\">Omnibus F4 SD &gt; PX4 Bootloader Update<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The&nbsp;PX4 bootloader&nbsp;is used to load firmware for Pixhawk boards (PX4FMU, PX4IO) and&nbsp;PX4FLOW. This topic explains several methods for updating the<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.rctoysky.com\/index.php?rest_route=\/wp\/v2\/posts\/136"}],"collection":[{"href":"https:\/\/blog.rctoysky.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.rctoysky.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rctoysky.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rctoysky.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=136"}],"version-history":[{"count":2,"href":"https:\/\/blog.rctoysky.com\/index.php?rest_route=\/wp\/v2\/posts\/136\/revisions"}],"predecessor-version":[{"id":138,"href":"https:\/\/blog.rctoysky.com\/index.php?rest_route=\/wp\/v2\/posts\/136\/revisions\/138"}],"wp:attachment":[{"href":"https:\/\/blog.rctoysky.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.rctoysky.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.rctoysky.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}