python for i.mx boards documentation

37
Python for i.MX Boards Documentation Release 0.0.1b Diego Dorta Apr 24, 2018

Upload: others

Post on 25-Feb-2022

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Python for i.MX Boards Documentation

Python for i.MX Boards DocumentationRelease 0.0.1b

Diego Dorta

Apr 24, 2018

Page 2: Python for i.MX Boards Documentation
Page 3: Python for i.MX Boards Documentation

Contents

1 PyIMX Overview 3

2 Supported Boards 52.1 i.MX8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 i.MX7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.3 i.MX6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3 Environment Setup 73.1 Yocto Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4 Installation 94.1 Obtaining the Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94.2 Installing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94.3 Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94.4 License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104.5 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

5 Example Module 11

6 Utils Module 13

7 Multimedia Modules 15

8 Security Modules 17

9 Machine Learning Modules 19

10 Unit Test Modules 21

11 Field Trial Modules 23

12 Contribute 25

13 Release Notes 27

14 Indices and tables 29

Python Module Index 31

i

Page 4: Python for i.MX Boards Documentation

ii

Page 5: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

Contents:

Contents 1

Page 6: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

2 Contents

Page 7: Python for i.MX Boards Documentation

CHAPTER 1

PyIMX Overview

PyIMX is a python package which provide high-level abstraction for i.MX boards manipulation. It includes functionsfor multimedia, security, unit test, field trial and machine learning. This package was created with the aim to providea simple and powerful tool to allow users all over the world to develop their own codes for i.MX boards.

This package offers a very wide abstraction using Python to access data, even you are not familiar with programminglanguage it can be handle easily. For those interest on executing manual tests, or developing applications will finduseful a set of classes and methods, as well as types formats, etc., of input parameters and expected results.

3

Page 8: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

4 Chapter 1. PyIMX Overview

Page 9: Python for i.MX Boards Documentation

CHAPTER 2

Supported Boards

Here are the boards which PyIMX package can provide and support the features:

2.1 i.MX8

• i.MX8M Scale

2.2 i.MX7

• i.MX7D Sabre SD

2.3 i.MX6

• i.MX6Q Sabre SD

• i.MX6QP Sabre SD

• i.MX6DL Sabre SD

• i.MX6SL EVK

• i.MX6UL EVK

5

Page 10: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

6 Chapter 2. Supported Boards

Page 11: Python for i.MX Boards Documentation

CHAPTER 3

Environment Setup

To use PyIMX on your image you must have installed a few prerequisites. Here are the list and a basic guide to helpyou to setup your build machine:

• Python3.x or higher.

• Pip3 package manager.

• Pyspeedtest

3.1 Yocto Source Code

To download the platform source code. Start by the following steps:

You need to have repo utility installed:

$ mkdir ~/bin$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo$ chmod a+x ~/bin/repo

Download the source code:

$ PATH=${PATH}:~/bin$ mkdir fsl-community-bsp$ cd fsl-community-bsp$ repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b rocko$ repo sync

For including Python and pip tool, add the following line inside local.conf :

CORE_IMAGE_EXTRA_INSTALL += " python3 pip3 "

Then, run the bitbake command:

7

Page 12: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

$ bitbake core-image-base

8 Chapter 3. Environment Setup

Page 13: Python for i.MX Boards Documentation

CHAPTER 4

Installation

After follow the setup you are now able to successfully install PyIMX library in your computer.

4.1 Obtaining the Package

You can download the latest version by clicking on the proper link below:

Download Type Python Version LocationSource tarball 3.x or Higher (Not done yet)Development 3.x or Higher PyIMX GitHub Repo

4.2 Installing

To install from source do:

$ tar -xf pyimx-x.x.x.tar.gz$ cd pyimx-x.x.x/$ python3.x setup.py build$ python3.x setup.py install

To install using pip3:

$ sudo pip3 install pyimx

4.3 Getting Help

For questions, bug reports, feature request, please consider using the following methods:

9

Page 14: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

1. Create an Issue for PyIMX on GitHub.

2. If you’re sure you’ve found a bug in existing code, or have some code you think would be useful to add toPyIMX create a pull request on GitHub.

3. In case you need help to start developing PyIMX, read the section How to contribute.

4.4 License

The MIT License (MIT)

Copyright (c) 2018 NXP Semiconductors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documen-tation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use,copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whomthe Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of theSoftware.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PAR-TICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHTHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTIONOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT-WARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

4.5 Acknowledgments

PyIMX was written and is maintained by the System & Application’s Engineer Team. The library started as an idea topromote basic scripts and functions to i.MX boards for those who are interest in start developing applications. Thanksto all who contributed to this idea.

10 Chapter 4. Installation

Page 15: Python for i.MX Boards Documentation

CHAPTER 5

Example Module

Sample Module

Python sample to start developing on i.MX Boards.

platform Unix

synopsis This module contains functions to return basic features.

sample.code_version()Returns code version.

sample.machine()Returns a hardware-type identifier such as ‘i386’

sample.release()Returns the operating system release number

sample.system()Returns the operating system name.

sample.version()Returns the more detailed system version

sample.who()Returns developer name.

11

Page 16: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

12 Chapter 5. Example Module

Page 17: Python for i.MX Boards Documentation

CHAPTER 6

Utils Module

13

Page 18: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

14 Chapter 6. Utils Module

Page 19: Python for i.MX Boards Documentation

CHAPTER 7

Multimedia Modules

15

Page 20: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

16 Chapter 7. Multimedia Modules

Page 21: Python for i.MX Boards Documentation

CHAPTER 8

Security Modules

17

Page 22: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

18 Chapter 8. Security Modules

Page 23: Python for i.MX Boards Documentation

CHAPTER 9

Machine Learning Modules

19

Page 24: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

20 Chapter 9. Machine Learning Modules

Page 25: Python for i.MX Boards Documentation

CHAPTER 10

Unit Test Modules

21

Page 26: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

22 Chapter 10. Unit Test Modules

Page 27: Python for i.MX Boards Documentation

CHAPTER 11

Field Trial Modules

23

Page 28: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

24 Chapter 11. Field Trial Modules

Page 29: Python for i.MX Boards Documentation

CHAPTER 12

Contribute

If you interest on helping with PyIMX project, you can start by downloading the github repo:

$ git clone https://github.com/diegohdorta/pyimx.git$ cd pyimx/

Then, you can use a script to help creating the required files:

$ sh script/new_module.sh

Enter the following requirements:

Module name: testDeveloper: John

Your python file will be created on imx/developing folder. To import it use the following line:

$ python3Python 3.6.5 (default, Apr 1 2018, 05:46:30)[GCC 7.3.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>>>>> from imx.developing import test>>> test.who()>>> Written by: John

Now you can read your module. Generate a patch with your modifications and send to PyIMX team:

$ git add imx/developing/test.py$ git commit -s -m "NM: Test for ..."$ git format-patch -1$ git send-email --to [email protected] test.patch

We will review your module, in case something went wrong you will be notified, if not it will be release on our nextrelease.

25

Page 30: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

26 Chapter 12. Contribute

Page 31: Python for i.MX Boards Documentation

CHAPTER 13

Release Notes

Version 0.1.0b:

• Release Date: 2018-04-09

– Beta Version Released

27

Page 32: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

28 Chapter 13. Release Notes

Page 33: Python for i.MX Boards Documentation

CHAPTER 14

Indices and tables

• genindex

• modindex

• search

29

Page 34: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

30 Chapter 14. Indices and tables

Page 35: Python for i.MX Boards Documentation

Python Module Index

ssample, 11

31

Page 36: Python for i.MX Boards Documentation

Python for i.MX Boards Documentation, Release 0.0.1b

32 Python Module Index

Page 37: Python for i.MX Boards Documentation

Index

Ccode_version() (in module sample), 11

Mmachine() (in module sample), 11

Rrelease() (in module sample), 11

Ssample (module), 11system() (in module sample), 11

Vversion() (in module sample), 11

Wwho() (in module sample), 11

33