ARM Mbed OS 5.15 + Mbed CLI build combat

Why choose ARM Mbed OS?

The main is that it uses C / C ++ development attracted another powerful ARM technology as the bottom, personally I feel that the system would be more suitable for strong performance MCU development of it. Of course, it is currently facing a finite number of evaluation development board, some of the interface on the hardware level has been done adaptation of the package. Happen to have a DISCO_F769NI on hand, he did not talk much, line and open.

note

ARM Mbed OS supports a variety of tools chain (toolchain) compilation.

  1. . ARM Compiler for Mbed OS 5.15, compiler of the minimum requirements version is: V6.11 or above. Here pit more, tried V6.7 and V6.10.1 are not working OS. Link mainly as a warning, the program can not function properly after the burn.
  2. GCC_ARM. Biggest feature is the free open source. Inadequate in front of those that:
1. 编译时间较长
2. 编译文件较大
  1. IAR, uARM. Not understand. Hope supplementary reader

Were used and the ARM Compiler V6.13.1 GCC_ARM compiler for mbed-os-example-blinky to compile, the following comparison:

ARM Compiler V6.13.1 GCC_ARM
When compiling long \leq 7min \leq 12min
.bin size 52KB 62KB
Number of warnings 24 53

Note that using the old compiler (6.11 or less) will link a number of warnings, the burning does not work properly! Mainly for thread delay is not accurate, the program interrupts and so strange inexplicable phenomenon.

Mbed CLI

This is a use Command line Interface Python development, a collection of project management, remote library import, export IDE project files, use aids external toolchain Mbed OS project.
Can roughly say that it is a Git superset.

Project Import

mbed new .
或
mbed import https://github.com/ARMmbed/mbed-os-example-blinky.git

Note that the latter will mbed-os project import, if you have downloaded the os, this is not necessary.
You can use git directly clone, or specific query parameters, common help format:

mbed import -h

Export to IDE

mbed export -i IDE -t BOARD
mbed export -S //查询支持的IDE和board

MDK-SDK developers need to pay attention, for OS V5.15, IDE may only need to select uvision6 oh.

Compile

First of all, you have to configure the path tool chain.

mbed config -G ARM_PATH C:\Keil_v5\ARM\ARMCC
\\对于V6编译器, 精确到的bin是必须的
mbed config -G ARMC6_PATH C:\Keil_v5\ARM\ARMCLANG\bin 
mbed config -G ARMC6_PATH C:\Keil_v5\ARM\ARMCLANG\bin 
mbed config -G GCC_ARM_PATH C:\GCC_ARM\安装目录\bin

Belt -Gmeans Global parameters.

Here two essential concepts:

  • Tool Chain: What you want to use compiler tool chain projects, such as: GCC_ARM, ARM, IAR ...
  • Target Board: you want to compile the project is running on which platform, such as: DISCO_F769NI ...

To find mbed-OS which supports popular development boards and tool chain, you can:

mbed compile -S

If there os and program files directory under the project directory, then the most simple instructions:

mbed compile -t ARM -m DISCO_F769NI

Under normal circumstances, I do not like to copy to copy a few hundred MB and piecemeal mbed-os, so the operation is more scientific:

mbed compile -t ARM -m DISCO_F769NI --source ./ --source ../mbed-os

If not given --buildparameters, creates the BUILD directory under the current project directory, compiled + program after the link to .binthe form to save them, you can use the burn tool (STM32 STLINK Utility) were burning.

Configuration

If used in Comparative toolchain fixed, global parameters may be set such that:

mbed config -G TOOLCHAIN ARM

And for embedded applications, different items may be burned onto a different board, you can set the configuration file for the project:

mbed config TARGET DISCO_F769NI

More configuration can refer Mbed CLI Configuration options

Quote

[1] An introduction to Arm Mbed OS 5

[2] Developing: Mbed CLI

[3] Arm Mbed tools->Arm Mbed Online Compiler

Released three original articles · won praise 2 · Views 302

Guess you like

Origin blog.csdn.net/aldfaaa/article/details/104074902