Linux Driver

2016年6月28日 星期二

mbed client using Raspberry Pi with IT-Pi Shield

介紹如何利用yotta 工具進行編譯 linux mbed client

what is yotta ? 

  • mbed OS applications as yotta executables 
  • yotta - to build the mbed example programs
  • yotta is a module management system for C++ and C designed to make it easier to build better software by re-using code.
  • yotta uses the CMake build system, and targets describe how the compiler should be run by providing a CMake
  • yotta is written in python, and distributed using pip, the python package manager
  • 利用yotta 可以到yotta 公開的 module registry (下載 module (即library)來使用. 另外, yotta 目標希望可以用同一份原始碼來編譯出不同平台上的code
     (yotta target <target_name>)  

linux mbed client 安裝 

1.) Installing Dependencies
sudo apt-get install python-setuptools cmake build-essential ninja-build python-dev 
libffi-dev libssl-dev 

sudo easy_install pip

2.) Install yotta

成功安裝完(沒有任何錯誤)必要的dependency後 , 再進行安裝yotta

sudo pip install yotta     //wait and pray......

sudo apt-get install libffi-dev
sudo apt-get install libssl-dev

Yotta 成功安裝

 3.) 取得mbed client

git clone

4.) made sure you have installed yotta and all necessary toolchains.
  1. In the command prompt, go to mbed-client-linux-example.
  2. Set up the application with correct Certificate and Domain:
    B. Go to My devices -> Security credentials.
    C. Click GET MY DEVICE SECURITY CREDENTIALS. You will get the needed certificate information as well as the endpoint name and domain.
    D. Copy the security credentials to source/security.h.
  3. In the command prompt, type yotta target arm-linux-native to set up the target device., 這裡會產生出資料匣 build/arm-linux-native
  4. In the command prompt, type yotta build. The executable file will be created in the folder build/arm-linux-native/source/.

    (yotta build -d: 可加入debug 訊息輸出)
編譯code 時會去pubic repository 下載module , 故要求驗證身份


  1. In the folder mbed-client-linux-example/build/arm-linux-native/source/, run the executable from the command line, type ./mbed-client-linux-example.
整個project 清空: yotta clean


沒有留言 :