FireBLE/Build development environment

来自Firefly wiki
跳转至: 导航搜索

Foreword

This chapter mainly introduces how to establish the platform FireSmart development environment,it includes the introduction of Kunming days branch factory SDK - QBlue1.3.5,and is based on MDK4.60 IDE environment building and the simulation using of SWD.

Preparation

  1. Download and install the latest version QBlue1.3.5 of Quintic SDK from official website.
  2. Download and install the msysgit and tortoisegit tool.
  3. Obtain and install the MDK4.60.
  4. Install the JLink simulator driver,and configurate the engineering.

Quintic SDK Introduction

The latest SDK of Quintic is QBlue1.3.5,the SDK contains a lot of development tools,documentation,and routines.
QBlue1 3 5.png

  • Tools:
  1. QTool cooperate with Qdongle to do the BLE development of debugging tool on PC.
  2. QnISPStudio QN902x series tool of serial burning
  3. QnNVDSConfigurator QN902x series of NVDS(Non Volatile Data Storage)burning tool.
  4. QnDriverTools QN902x series of reuse pin configuration tool
  5. QnDevDBforDevelop The development environment build tools of MCU DB library
  • Document:
  1. Hardware Doc Hardware related documents
  2. Software Doc Software development related documents and tutorials
  • Project:
  1. BLE Example Bluetooth project routines
  2. Driver Example Naked flooding routines

Development environment to build

Original source code provides the IAR and keil development environment to choose for the user.

Installation and use keil

Both IDE are the most popular of the single chip microcomputer development environment,each has its strong point,so I randomly picked a keil as development environment.So I just introduce the construction of the keil environment,but the environment building are very much the same,you cannot build environment to investigate its root,it wastes of time and effort.

To install keil omitted,but pay attention to a note,if you need to online simulation,finally the pop-up appears a ULink driver installation interface,it must be checked and installation.
Keil ULink.png

I install the latest keil 5.0,please look at the following image.
Keil5 0.png

MCU DB Libraries installed

After the installation is complete,there are a few things to do,that is to install the MCU DB library of QN9021,the DB library in QBlue1.3.5 tools can be installed automatically. QnEnvDevelop.png

Use of keil

We first assume that the source code download and UnZip to XXX and XXX directory through the git clone or website directory,there will be a folder called FireBLE.FireBLE folder contains Demo_BLE,Demo_driver and Demo_project three child folder.Each folder contains a number of named after prj_xxx below the folder(or directly to drive the named folder)and a named after the src folder.

Please try to protect the contents of the src,that code in the src folder is all engineering common code,for any of these changes will affect the normal running of other projects.

If we want to start proxr project:

  1. In the project menu of keil choose to Open Project...
  2. In the pop-up file selection box, open the project file of xxx/FireBLE/Demo_BLE/prj_proxr/keil/proxr.uvproj
  3. The configuration of engineering(generally use the default configuration,have special requirements will change),Compile the connection,serial burning or simulation debugging.

Introduction to the use of a few keil skills,more convenient for the use of keil development

  • Set up your own project
  1. Choose a routine as the development of the template,put the clean engineering documents (not compile connected) copy to your project directory (including prj_xxx and src),and changes to the project file name.
  2. Open the Project after Project name remains unchanged,then need in the menu(project-- > Manage - > Components,Environment,Books...)of option to modify.in the option you can modify the project name,add group,rename group,management group,and so on.
  3. In the menu (Project-->Options for Target "xxx"),the Output TAB can be modified the Output filename,the User TAB can be modified(After the Build/Rebuild)the command in 1 parameter(fromelf --bin --output ./bin/xxx.bin ./obj/xxx.axf.)
  • Open the auto-complete function
Open the menu(Edit-->Configure),in the Text Completion TAB checked as shown:

FireBLE auto completion.png

  • Quick comments and annotations
Open the menu(Edit-->Configure),in the Select a Command box of Shortcut keys TAB to choose the option (Edit:Advanced:Comment Selection),click on the right side of the Creat Shortcut button to create shortcuts,and input in the pop-up window to configure Shortcut keys.I use the Ctrl + / as the annotation of shortcuts.The same to Edit the Advanced: Uncomment Selection set shortcut Ctrl + Alt + / as an annotation.The other functions similar.
  • Indent
Select a piece of code (a line can also be,but you must select an entire line,and quick click bank selected three times,the line of code should be the whole line is selected), and then press the Tab key to indent,press Shift + Tab indent.

Selection and configuration of JLink simulator

The default project configuration is commonly simulators simulation can be used directly,but if not installed Quintic QN9020 DB library, may lead to set up confusion.In addition,if you start a new project,usually tend to choose the most close to routine of a routine as basic template engineering,on the basis of the modification project information,thus becomes a new project.So it is necessary for us to understand some of the keil project configuration that is commonly used in some of the options.

Keil projects conventional settings

Open the keil projects,and in turn into the menu(project-->options for target"xxx"or ALT+F7),then enter the project Settings interface.
Options for target.png

Please make sure the project configuration is as follows

Configure the MCU DB library
KEIL MCU DB.png

Compiler output file of the configure project
KEIL OUTPUT.png

Configure some user-defined commands
KEIL USer.png

Configure the user needs to include the header file directory
KEIL C.png

Configure the option of DEBUG
KEIL DEBUG.png

The online simulation setting of skeil+Jlink

Due to the CPU sleep when simulators cannot identify development board,so the development board to find equipment in working condition. Our example program is directly into sleep mode after boot,so you need to put the five keys to push up to start the development board to send radio,and wake up the sleep state of development board,and then the real-time simulation and download firmware. It is important to note that after joining the OTA function with something extra to burn,so can only use the ISP serial burning tool to burn.

Click the setting button at the back of JLink emulator to start the emulator settings interface
KEIL DEBUG debug.png

Before the simulation to confirm the Flash address settings,otherwise the program download may be failed
KEIL DEBUG flash.png

Choose QN9020 corresponds to the flash
KEIL DEBUG flash2.png

Don't choose the option
KEIL DEBUG trace.png

So far,you can use the keil combination of simulators for single step debugging and tracking.