/*
作者简介:
南京惊鸣航空科技有限公司创始人
先后于2010年,2013年获得南京航空航天大学学士学位、硕士学位,
现于东南大学毫米波国家重点实验室攻读博士学位。
发表SCI期刊论文多篇;获得校级奖学金两次,国家奖学金两次;
江苏省科研创新基金、东南大学优秀博士论文基金获得者。
学术主页:https://scholar.google.com/citations?user=zUngf3oAAAAJ&hl=zh-CN
淘宝店铺主页:http://shop115844451.taobao.com/
文档版本:1.1
修改记录:1.1 添加启动顺序描述
如需进一步交流请加QQ群:34528825
*/
阅读官方的解释:
This software is part of the Paparazzi UAV Project.
Luftboot is the bootloader for stm32 based autopilots to enable upgrading the autopilotfirmwareusing usb. It implements thedfu standard.
讲解:Luftboot实质是针对PPZ硬件STM32设计的bootloader,bootloader指的是引导程序,该程序负责在硬件上电后初始化CPU等硬件设备,再将OS(操作系统)镜像或者固化的APP(应用程序)加载到内存中,然后跳转到OS/APP所在空间,执行之。
具体来说,PPZ对应的是把什么“加载到内存中呢”?——称为“firmware”的APP。(简单插一句,firmware严格来讲是介于“软件”和“硬件”之间的概念,大陆称为“固件”,湾湾称为“韧件”)。
那么,把PPZ代码下载后,对应firmware在哪?——在sw目录下的一个叫airborne的目录里面。根据配置方式不同,会选择性编译出fixwing(固定翼)或者rotocraft(旋翼)的firmware出来。
小结概念:
bootloader=luftboot
APP=firmware=airborne
这里特别强调了USB更新firmware又是怎么回事?bootloader可以选择更新或者不更新firmware:1.如果不更新,则从某个存储器内将firmware加载运行,这种模式被称为“自启动”;2.如果更新,则通过USB从主机(Ubuntu)下载,这种模式被称为“交互启动”。
Luftboot在更新firmware时候所用的标准的是DFU,DFU全称Device Firmware Upgrade,PPZ使用了一个叫dfu-util的开源工具。
Call 'make' inside the src directory.
Luftboot needs libopencm3 and an appropriate arm-none-eabi gcc cross compiler. If you don't have these in your PATH, specify them with e.g.
make LIBOPENCM3=path/to/libopencm3 PREFIX=path/to/bin/arm-none-eabi
By default, Luftboot uses a 12MHz external clock to PLL it to 72MHz. If no external clock is available, or for any other reason, one can build Luftboot to use the 8MHz internal RC oscillator to PLL it to 48MHz. Call make as follows from inside ./src:
make LUFTBOOT_USE_48MHZ_INTERNAL_OSC=1
At bootup, Luftboot uses several criteria (in this order) to decide whether to jump to the payload or to initiate the bootloader: