星期四, 27. 九月 2018 12:00上午 - BEAUTIFULZZZZ
一、前言
前几天给大家介绍了如何手动搭建安卓APP命令行开发环境和nRF51822命令行开发环境,中秋这几天我把上面篇文章的操作流程全部做成了shell脚本,使得可以让其他人简单运行下脚本、就能够直接建立绿色开发环境,岂不美哉?
- 《[编译] 5、在Linux下搭建安卓APP的开发烧写环境(makefile版)—— 在Linux上用命令行+VIM开发安卓APP》
- 《[编译] 4、在Linux下搭建nRF51822的开发烧写环境(makefile版)》
二、nrf_linux_tool开源项目介绍
2.1)项目简介
The project provides a nRF51 APP command-line development environment based on Linux system.
You can directly write、build、install APP(HEX/BIN) without using IDE.
git clone git@github.com:nbtool/nrf_linux_tool.git
2.2)如何使用
If it is the first time to compile, It is recommended to run goto tool directly, and then run the './run.sh tool' to download gcc、SDK、build-tools etc.
cd ./tool ./run.sh toolBuild the project(for example:app_nrf51_hids_keyboard):
cd ./app/app_nrf51_hids_keyboard/build make clean make allInstall the APP:
make erase make flash_flash_softdevice make flash
2.3)DEMO介绍
- app_nrf51_peri_blinky > 简单工程,主要用nRF51的GPIO外设控制一个LED闪烁;
- app_nrf51_ble_hrs > BLE工程,心律计,BLE DEMO级工程,展示心律、电池电量等特征;
- app_nrf51_hids_mouse > BLE工程,蓝牙鼠标DEMO级工程,了解HID;
- app_nrf51_hids_keyboard > BLE工程,蓝牙键盘DEMO级工程,按动按键给上位机发送hello;
2.4)工程结构介绍
未运行run.sh构建环境前的目录结构:(可见,当前app层只有4个简单的DEMO,tool里面只有一个run.sh脚本)
➜ nrf_linux_tool git:(master) tree -L 2 . ├── app │ ├── app_nrf51_ble_hrs │ ├── app_nrf51_hids_keyboard │ ├── app_nrf51_hids_mouse │ └── app_nrf51_peri_blinky ├── README.md └── tool └── run.sh构建之后的目录结构:(比未构建多了一个sdk/nRF5_SDK_12.3.0_d7731ad、gcc-arm编译器、和nRF5x命令行工具)
➜ nrf_linux_tool git:(master) tree -L 2 . ├── app │ ├── app_nrf51_ble_hrs │ ├── app_nrf51_hids_keyboard │ ├── app_nrf51_hids_mouse │ └── app_nrf51_peri_blinky ├──
