From 9d15278b44cdcf40f50e84822a7236c4a8dc063d Mon Sep 17 00:00:00 2001 From: ChPotato <554252585@qq.com> Date: Wed, 22 Feb 2017 21:27:58 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[=E5=B7=B2=E5=AE=8C=E6=88=90][STM32=20Bootl?= =?UTF-8?q?oad]-[2017-2-22]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stm32_bootloader.md | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/stm32_bootloader.md b/stm32_bootloader.md index 7dd761f..54a3815 100644 --- a/stm32_bootloader.md +++ b/stm32_bootloader.md @@ -1,9 +1,9 @@ # STM32 Bootloader - +# STM32引导程序 The code for the PX4 bootloader is available from the Github [Bootloader](https://github.com/px4/bootloader) repository. - +#用于加载PX4的引导程序可以从GitHub的[Bootloader](https://github.com/px4/bootloader)库中获得。 ## Supported Boards - +# 支持的硬件 * FMUv1 (PX4FMU, STM32F4) * FMUv2 (Pixhawk 1, STM32F4) * FMUv3 (Pixhawk 2, STM32F4) @@ -13,7 +13,7 @@ The code for the PX4 bootloader is available from the Github [Bootloader](https: * ASCv1 (TBA, STM32F4) ## Building the Bootloader - +## 编译引导程序 ```bash git clone https://github.com/PX4/Bootloader.git cd Bootloader @@ -21,19 +21,23 @@ make ``` After this step a range of elf files for all supported boards are present in the Bootloader directory. - +#运行make后,编译产生一系列可执行文件(格式为elf)并保存在Bootloader文件下,所得可执行文件支持所有PX4硬件。 ## Flashing the Bootloader - +## 烧写引导程序 > IMPORTANT: The right power sequence is critical for some boards to allow JTAG / SWD access. Follow these steps exactly as described. The instructions below are valid for a Blackmagic / Dronecode probe. Other JTAG probes will need different but similar steps. Developers attempting to flash the bootloader should have the required knowledge. If you do not know how to do this you probably should reconsider if you really need to change anything about the bootloader. - +> +>重要信息:对于一些允许JTAG/SWD的飞控板必须保证正确的上电顺序。请严格按照以下步骤完成。以下说明适用于Blackmagic / Dronecode仿真。其他JTAG仿真不同于前面两个,但步骤类似。试图刷写bootloader的编程人员应该具备这些知识。如果你不知道知道这些,你可能真的应该考虑,你是否真的需要修改bootloader引导加载程序。 * Disconnect the JTAG cable + * 断开JTAG cable * Connect the USB power cable + * 连接USB电源cable * Connect the JTAG cable + * 连接JTAG cable ### Black Magic / Dronecode Probe #### Using the right serial port - +#### 使用正确的串口 * On LINUX: ```/dev/serial/by-id/usb-Black_Sphere_XXX-if00``` * On MAC OS: Make sure to use the cu.xxx port, not the tty.xxx port: ```tar ext /dev/tty.usbmodemDDEasdf``` @@ -53,13 +57,13 @@ arm-none-eabi-gdb ### J-Link These instructions are for the [J-Link GDB server](https://www.segger.com/jlink-gdb-server.html). - +J-Link相关说明看[J-Link GDB server](https://www.segger.com/jlink-gdb-server.html). #### Prerequisites - +#### 前提条件 [Download the J-Link software](https://www.segger.com/downloads/jlink#) from the Segger website and install it according to their instructions. - +[下载 J-Link 软件](https://www.segger.com/downloads/jlink#)并按照Segger说明安装。 #### Run the JLink GDB server - +#### 运行JLink GDB服务 FMUv1: ```bash JLinkGDBServer -select USB=0 -device STM32F405RG -if SWD-DP -speed 20000 @@ -71,7 +75,7 @@ JLinkGDBServer -select USB=0 -device STM32F429AI -if SWD-DP -speed 20000 ``` #### Connect GDB - +#### 链接GDB ```bash arm-none-eabi-gdb (gdb) tar ext :2331 @@ -79,19 +83,28 @@ arm-none-eabi-gdb ``` ### Troubleshooting - +### 故障排除 If any of the commands above are not found, you are either not using a Blackmagic probe or its software is outdated. Upgrade the on-probe software first. +运行命令时,如果提示上述命令没有被找到,可能是你没有使用Black magic或者软件已经过期。此时,请先升级on-probe软件。 + If this error message occurs: + +如果提示下方错误消息: + ```Error erasing flash with vFlashErase packet``` Disconnect the target (while leaving JTAG connected) and run +断开连接(保持JTAG连接状态)并运行下列命令: + ```bash mon tpwr disable swdp_scan attach 1 load tapv1_bl.elf ``` + This will disable target powering and attempt another flash cycle. +此时将断开飞控板电源并尝试再次写入。 From a81b30842448b56d60247528018bb8574d46b25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=AF=E4=B8=9CStone?= Date: Sun, 5 Mar 2017 12:10:08 +0800 Subject: [PATCH 2/4] Update stm32_bootloader.md --- stm32_bootloader.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stm32_bootloader.md b/stm32_bootloader.md index 54a3815..87428bb 100644 --- a/stm32_bootloader.md +++ b/stm32_bootloader.md @@ -1,9 +1,9 @@ # STM32 Bootloader -# STM32引导程序 +# STM32 引导程序 The code for the PX4 bootloader is available from the Github [Bootloader](https://github.com/px4/bootloader) repository. -#用于加载PX4的引导程序可以从GitHub的[Bootloader](https://github.com/px4/bootloader)库中获得。 +用于加载 PX4的引导程序可以从GitHub的[Bootloader](https://github.com/px4/bootloader)库中获得。 ## Supported Boards -# 支持的硬件 +## 支持的硬件 * FMUv1 (PX4FMU, STM32F4) * FMUv2 (Pixhawk 1, STM32F4) * FMUv3 (Pixhawk 2, STM32F4) @@ -21,7 +21,7 @@ make ``` After this step a range of elf files for all supported boards are present in the Bootloader directory. -#运行make后,编译产生一系列可执行文件(格式为elf)并保存在Bootloader文件下,所得可执行文件支持所有PX4硬件。 +运行make后,编译产生一系列可执行文件(格式为elf)并保存在Bootloader文件下,所得可执行文件支持所有PX4硬件。 ## Flashing the Bootloader ## 烧写引导程序 > IMPORTANT: The right power sequence is critical for some boards to allow JTAG / SWD access. Follow these steps exactly as described. The instructions below are valid for a Blackmagic / Dronecode probe. Other JTAG probes will need different but similar steps. Developers attempting to flash the bootloader should have the required knowledge. If you do not know how to do this you probably should reconsider if you really need to change anything about the bootloader. From d16ad2c58ee37a04d035046dab0ad4751f8f9068 Mon Sep 17 00:00:00 2001 From: ChPotato <554252585@qq.com> Date: Tue, 21 Mar 2017 20:50:22 +0800 Subject: [PATCH 3/4] Update stm32_bootloader.md --- stm32_bootloader.md | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/stm32_bootloader.md b/stm32_bootloader.md index 87428bb..a520461 100644 --- a/stm32_bootloader.md +++ b/stm32_bootloader.md @@ -1,8 +1,8 @@ -# STM32 Bootloader + # STM32 引导程序 -The code for the PX4 bootloader is available from the Github [Bootloader](https://github.com/px4/bootloader) repository. + 用于加载 PX4的引导程序可以从GitHub的[Bootloader](https://github.com/px4/bootloader)库中获得。 -## Supported Boards + ## 支持的硬件 * FMUv1 (PX4FMU, STM32F4) * FMUv2 (Pixhawk 1, STM32F4) @@ -12,7 +12,7 @@ The code for the PX4 bootloader is available from the Github [Bootloader](https: * TAPv1 (TBA, STM32F4) * ASCv1 (TBA, STM32F4) -## Building the Bootloader + ## 编译引导程序 ```bash git clone https://github.com/PX4/Bootloader.git @@ -20,23 +20,17 @@ cd Bootloader make ``` -After this step a range of elf files for all supported boards are present in the Bootloader directory. + 运行make后,编译产生一系列可执行文件(格式为elf)并保存在Bootloader文件下,所得可执行文件支持所有PX4硬件。 -## Flashing the Bootloader + ## 烧写引导程序 -> IMPORTANT: The right power sequence is critical for some boards to allow JTAG / SWD access. Follow these steps exactly as described. The instructions below are valid for a Blackmagic / Dronecode probe. Other JTAG probes will need different but similar steps. Developers attempting to flash the bootloader should have the required knowledge. If you do not know how to do this you probably should reconsider if you really need to change anything about the bootloader. -> + >重要信息:对于一些允许JTAG/SWD的飞控板必须保证正确的上电顺序。请严格按照以下步骤完成。以下说明适用于Blackmagic / Dronecode仿真。其他JTAG仿真不同于前面两个,但步骤类似。试图刷写bootloader的编程人员应该具备这些知识。如果你不知道知道这些,你可能真的应该考虑,你是否真的需要修改bootloader引导加载程序。 - * Disconnect the JTAG cable + * 断开JTAG cable - * Connect the USB power cable * 连接USB电源cable - * Connect the JTAG cable * 连接JTAG cable -### Black Magic / Dronecode Probe - -#### Using the right serial port #### 使用正确的串口 * On LINUX: ```/dev/serial/by-id/usb-Black_Sphere_XXX-if00``` * On MAC OS: Make sure to use the cu.xxx port, not the tty.xxx port: ```tar ext /dev/tty.usbmodemDDEasdf``` @@ -55,14 +49,9 @@ arm-none-eabi-gdb ``` ### J-Link - -These instructions are for the [J-Link GDB server](https://www.segger.com/jlink-gdb-server.html). J-Link相关说明看[J-Link GDB server](https://www.segger.com/jlink-gdb-server.html). -#### Prerequisites #### 前提条件 -[Download the J-Link software](https://www.segger.com/downloads/jlink#) from the Segger website and install it according to their instructions. [下载 J-Link 软件](https://www.segger.com/downloads/jlink#)并按照Segger说明安装。 -#### Run the JLink GDB server #### 运行JLink GDB服务 FMUv1: ```bash @@ -74,7 +63,6 @@ AeroFC: JLinkGDBServer -select USB=0 -device STM32F429AI -if SWD-DP -speed 20000 ``` -#### Connect GDB #### 链接GDB ```bash arm-none-eabi-gdb @@ -82,13 +70,9 @@ arm-none-eabi-gdb (gdb) load aerofcv1_bl.elf ``` -### Troubleshooting ### 故障排除 -If any of the commands above are not found, you are either not using a Blackmagic probe or its software is outdated. Upgrade the on-probe software first. - 运行命令时,如果提示上述命令没有被找到,可能是你没有使用Black magic或者软件已经过期。此时,请先升级on-probe软件。 -If this error message occurs: 如果提示下方错误消息: @@ -105,6 +89,4 @@ attach 1 load tapv1_bl.elf ``` -This will disable target powering and attempt another flash cycle. - 此时将断开飞控板电源并尝试再次写入。 From 1c7fd139652c21870d393cd2888b815c74772714 Mon Sep 17 00:00:00 2001 From: ChPotato <554252585@qq.com> Date: Tue, 21 Mar 2017 20:51:59 +0800 Subject: [PATCH 4/4] Update stm32_bootloader.md --- stm32_bootloader.md | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/stm32_bootloader.md b/stm32_bootloader.md index a520461..0ed277f 100644 --- a/stm32_bootloader.md +++ b/stm32_bootloader.md @@ -1,8 +1,5 @@ - # STM32 引导程序 - -用于加载 PX4的引导程序可以从GitHub的[Bootloader](https://github.com/px4/bootloader)库中获得。 - + 用于加载 PX4的引导程序可以从GitHub的[Bootloader](https://github.com/px4/bootloader)库中获得。 ## 支持的硬件 * FMUv1 (PX4FMU, STM32F4) * FMUv2 (Pixhawk 1, STM32F4) @@ -11,26 +8,18 @@ * FMUv5 (Pixhawk 4, STM32F7) * TAPv1 (TBA, STM32F4) * ASCv1 (TBA, STM32F4) - - ## 编译引导程序 ```bash git clone https://github.com/PX4/Bootloader.git cd Bootloader make ``` - - 运行make后,编译产生一系列可执行文件(格式为elf)并保存在Bootloader文件下,所得可执行文件支持所有PX4硬件。 - ## 烧写引导程序 - >重要信息:对于一些允许JTAG/SWD的飞控板必须保证正确的上电顺序。请严格按照以下步骤完成。以下说明适用于Blackmagic / Dronecode仿真。其他JTAG仿真不同于前面两个,但步骤类似。试图刷写bootloader的编程人员应该具备这些知识。如果你不知道知道这些,你可能真的应该考虑,你是否真的需要修改bootloader引导加载程序。 - * 断开JTAG cable * 连接USB电源cable * 连接JTAG cable - #### 使用正确的串口 * On LINUX: ```/dev/serial/by-id/usb-Black_Sphere_XXX-if00``` * On MAC OS: Make sure to use the cu.xxx port, not the tty.xxx port: ```tar ext /dev/tty.usbmodemDDEasdf``` @@ -47,7 +36,6 @@ arm-none-eabi-gdb Transfer rate: 17 KB/sec, 828 bytes/write. (gdb) kill ``` - ### J-Link J-Link相关说明看[J-Link GDB server](https://www.segger.com/jlink-gdb-server.html). #### 前提条件 @@ -62,18 +50,15 @@ AeroFC: ```bash JLinkGDBServer -select USB=0 -device STM32F429AI -if SWD-DP -speed 20000 ``` - #### 链接GDB ```bash arm-none-eabi-gdb (gdb) tar ext :2331 (gdb) load aerofcv1_bl.elf ``` - ### 故障排除 运行命令时,如果提示上述命令没有被找到,可能是你没有使用Black magic或者软件已经过期。此时,请先升级on-probe软件。 - 如果提示下方错误消息: ```Error erasing flash with vFlashErase packet```