Moto Mods --Setup Environment

Preparing For Application Development

Follow these instructions to add Moto Mod specific support to your applications:

Step 1) Download and Install Android Studio

To develop a Moto Z application that interacts with Moto Mods, you must be familiar with Android Studio 2.0 and it must be installed on your development environment. If you don’t already have it, download Android Studio 2.0 here.  Unlike firmware development which requires Linux currently, APK development may be done on the platform of your choice.

Note: You’ll also need to make sure that Android Studio has the Android SDK API 23 or later installed.

Step 2) Download the Moto Mods SDK Library

Next, you’ll need to download the Moto Mods SDK Library.

All Downloads

Step 3) Place the Moto Mods SDK Library For Use In Your App

Once ModLib-01.00.000.zip is downloaded and unzipped, place the modlib-01.00.000.jar file in your Android Studio project libs/ folder, and the the version.xml in your res/values folder. By including this library in your Android application project, you will be able to include Moto Mod specific functionality in your app.

Run these commands from a terminal to copy modlib.jar and version.xml files to the appropriate location:

cp modlib-01.00.000.jar $APP_TOP/app/libs
cp res/version.xml $APP_TOP/app/src/main/res/values


Embedded Firmware Development

Currently, developing firmware for Moto Mods requires a Linux environment. This may be run either native or within a virtual machine (VM). When running in a VM, Virtual Box has been tested on Win7 and MacOS environments. Commands below are for Ubuntu (14.04 or 16.04).

If using a VM, configure with at least 2GB of RAM and 10GB of hard disk space for optimal performance.

Build Dependencies

All of the tools needed to build Moto Mods firmware are provided in the Ubuntu package management system. To download these to your system use the following commands from a terminal:

$ sudo apt-get install -y git gperf flex bison libncurses5-dev gcc-arm-none-eabi python-pip
$ sudo pip install pyelftools



Debugging and Flashing Tools

The Reference MotoMod provides an FTDI4232 to emulate JTAG for the HSB and SWD for the MuC. This gives access to debug and install software (flash) using just a USB C port cable. Support for this connection requires slightly modified version of OpenOCD. You will need to build this from source. Again packages for building these are available in the Ubuntu package management system.

OpenOCD

OpenOCD is used for flashing and debugging. You will need to download and build the OpenOCD code as follows:

$ sudo apt-get install -y libusb-1.0-0-dev libftdi-dev libtool autoconf texinfo
$ git clone https://github.com/MotorolaMobilityLLC/openocd
$ cd openocd
$ git submodule init
$ git submodule update
$ ./bootstrap
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
$ cd -

Note: If you are using Ubuntu 16.10 or later, you will need to install gcc-5 (sudo apt install gcc-5) and add "CC=gcc-5" to the above ./configure statement. This is only required for OpenOCD.

OpenOCD talks to the chip through USB, so you need grant your account access to the FTDI.

$ id -u -n

Replace <user name> below with the results of the previous command.

$ sudo -s
# echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", MODE="0666", OWNER="<user name>"'  >> /etc/udev/rules.d/20-ftdi.rules
# udevadm control --reload
# exit

The new permissions will take effect the next time you plug in your USB cable.

GDB

GDB is required for low-level debugging. The MDK provides some utility functions that make working with the debugger easier. If you wish to use these utilities you have to download and build the debugger with Python scripting enabled as follows:

$ sudo apt-get install -y libexpat1-dev zlib1g-dev guile-2.0-dev python2.7-dev
$ wget http://ftp.gnu.org/gnu/gdb/gdb-7.11.tar.gz
$ tar -zxf gdb-7.11.tar.gz
$ cd gdb-7.11
$ ./configure --prefix=/usr/local --program-prefix=arm-none-eabi- --target=arm-none-eabi --with-python --with-guile
$ make
$ sudo make install


Further information

Additional information about each tool referenced can be found at the originators site:

深度学习是机器学习的一个子领域,它基于人工神经网络的研究,特别是利用多层次的神经网络来进行学习和模式识别。深度学习模型能够学习数据的高层次特征,这些特征对于图像和语音识别、自然语言处理、医学图像分析等应用至关重要。以下是深度学习的一些关键概念和组成部分: 1. **神经网络(Neural Networks)**:深度学习的基础是人工神经网络,它是由多个层组成的网络结构,包括输入层、隐藏层和输出层。每个层由多个神经元组成,神经元之间通过权重连接。 2. **前馈神经网络(Feedforward Neural Networks)**:这是最常见的神经网络类型,信息从输入层流向隐藏层,最终到达输出层。 3. **卷积神经网络(Convolutional Neural Networks, CNNs)**:这种网络特别适合处理具有网格结构的数据,如图像。它们使用卷积层来提取图像的特征。 4. **循环神经网络(Recurrent Neural Networks, RNNs)**:这种网络能够处理序列数据,如时间序列或自然语言,因为它们具有记忆功能,能够捕捉数据中的时间依赖性。 5. **长短期记忆网络(Long Short-Term Memory, LSTM)**:LSTM 是一种特殊的 RNN,它能够学习长期依赖关系,非常适合复杂的序列预测任务。 6. **生成对抗网络(Generative Adversarial Networks, GANs)**:由两个网络组成,一个生成器和一个判别器,它们相互竞争,生成器生成数据,判别器评估数据的真实性。 7. **深度学习框架**:如 TensorFlow、Keras、PyTorch 等,这些框架提供了构建、训练和部署深度学习模型的工具和库。 8. **激活函数(Activation Functions)**:如 ReLU、Sigmoid、Tanh 等,它们在神经网络中用于添加非线性,使得网络能够学习复杂的函数。 9. **损失函数(Loss Functions)**:用于评估模型的预测与真实值之间的差异,常见的损失函数包括均方误差(MSE)、交叉熵(Cross-Entropy)等。 10. **优化算法(Optimization Algorithms)**:如梯度下降(Gradient Descent)、随机梯度下降(SGD)、Adam 等,用于更新网络权重,以最小化损失函数。 11. **正则化(Regularization)**:技术如 Dropout、L1/L2 正则化等,用于防止模型过拟合。 12. **迁移学习(Transfer Learning)**:利用在一个任务上训练好的模型来提高另一个相关任务的性能。 深度学习在许多领域都取得了显著的成就,但它也面临着一些挑战,如对大量数据的依赖、模型的解释性差、计算资源消耗大等。研究人员正在不断探索新的方法来解决这些问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值