TCP送信

TCP送信

PowerShell

参考

スクリプト

# 
# TCP送信
# https://qiita.com/LazarusMakoto/items/631af8aba4079f82c7c3
# 
# コマンドプロンプトで
# powershell -ExecutionPolicy RemoteSigned -File socket_client.ps1
# 

while ($TRUE)
{
  $soc = New-Object System.Net.Sockets.tcpClient
  $soc.connect("192.168.0.1", 80) # ポート番号はサーバプログラムにあわせる
  
  # 同じTCPコネクション内でループ
  while ($TRUE)
  {
    try {
      sleep -m 200 # 待機(ミリ秒)
      $sendData=cat -en by "sample2.bin" # ファイルから送信データを読み込み
      $soc.GetStream().Write($sendData, 0, $sendData.Length)
      $now= Get-Date -Format "yyyy/MM/dd HH:mm:ss.fff"
      echo "[$now] 送信成功"
    } catch {
      break
    }
  }
  
  $now= Get-Date -Format "yyyy/MM/dd HH:mm:ss.fff"
  echo "[$now] エラー、リトライ .."
  $soc.close()
}

$soc.close()

NXP i.MX 6 メモ

iperf

STREAM

sysbench

TEMPMON(Temperature Monitor)

Kernel config

SD Card

試したこと

local.conf の変更

ひとまず試すということで ./conf/local.conf に以下を追記(あるいは変更) local.conf は fsl-setup-release.sh の実施で初期化されるので注意

EXTRA_IMAGE_FEATURES ?= "debug-tweaks tools-sdk dev-pkgs"
INHERIT_append = " extrausers"
EXTRA_USERS_PARAMS = "useradd -P userpass user;usermod -P rootpass root;"
IMAGE_ROOTFS_EXTRA_SPACE = "1048576"

iperf

ターゲットでgccでビルド

curl -OL https://iperf.fr/download/source/iperf-3.1.3-source.tar.gz
./configure 
make
sudo make install

sysbench

./configure にて以下の通りエラーになるので mysql を無効化

configure: error: mysql_config executable not found
********************************************************************************
ERROR: cannot find MySQL libraries. If you want to compile with MySQL support,
       you must either specify file locations explicitly using
       --with-mysql-includes and --with-mysql-libs options, or make sure path to
       mysql_config is listed in your PATH environment variable. If you want to
       disable MySQL support, use --without-mysql option.
********************************************************************************

以下を実施した。

$ curl -OL http://downloads.mysql.com/source/sysbench-0.4.12.5.tar.gz
$ gunzip -c sysbench-0.4.12.5.tar.gz |tar zx

$ ./autogen.sh 
$ ./configure --without-mysql
$ sudo make install

$ sysbench --test=cpu run --max-requests=1000 --num-threads=2

なお、sysbench-0.4.12.14.tar.gz は make 時に以下のエラーになるのが解消できなかったのであきらめた。

gcc: error: unrecognized command line option '-m64'

NXP i.MX 6 Docker

ターゲット上でDockerを動作させることができるか、調べたのでメモ。

なお、Yoctoのビルド環境をDockerコンテナで構築する、という件ではなく、YoctoのrecipeとしてDockerをターゲットに導入できるか、という観点である。

結論

NXPの標準のBSPだと今のところ無理そう。 以下だとできそう。

hostとしてUbuntuを採用し、その上でDockerを動作させる

hostが標準のLinux distributionsを採用している

その他の環境、ディストリビューション

Raspberry Piは可能

軽量なDocker ホスト用のOSが対応すれば可能そう

BSP(Linux)で実施した例(いずれも最終的には成功していない模様)

NXP i.MX 6 uuuによるflash

今後のTODOメモ

uuu

したいこと

  • i.MX_Linux_User's_Guide.pdf を参照して、以下を試す
  • 4.2.2 Using UUU
    • For example, the following command writes rootfs.wic into eMMC.
    • uuu -b emmc_all <bootloader> <rootfs.wic>

      手順

  • インストール
git clone https://github.com/NXPmicro/mfgtools.git
cd mfgtools
sudo apt-get install libusb-1.0-0-dev libzip-dev libbz2-dev pkg-config cmake libssl-dev
cmake .
make
  1. 接続
  2. USB OTGポートとPCを接続(シリアル経由の書き込み用)
  3. debug用USBポートとPCを接続(デバッグコンソール用)
  4. ブートモードを Serial download mode for the Manufacturing Tool に切り替える
  5. 起動して uuu コマンドを実行

わかったこと

  • NXPで配布しているイメージのzipファイルには uuu.auto が含まれるので、 uuu L4.9.123_2.3.0_8mm-ga.zip とするだけで書き込み可能。(もし複数のボード用のイメージが含まれたzipなら、 release.zip/uuu.auto-<boardname> とする。)
  • eMMCを搭載していないボードもあるので注意(実施できない)

参考

NXP i.MX 6 yoctoビルド環境構築と作成イメージのSDカードへの書き込み

メモ

試したこと

  • yoctoビルド

  • i.MX_Yocto_Project_User's_Guide.pdf を参照して、以下でビルドに必要なパッケージをインストール

$ sudo apt install gawk wget git diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev
$ sudo apt install xterm sed cvs subversion coreutils texi2html docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc
$ sudo apt install u-boot-tools
  • i.MX_Yocto_Project_User's_Guide.pdf を参照して、以下でgit レポジトリの管理ツールを準備し、
$ mkdir ~/bin
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

.bashrc に以下を追記して~/binにパスを通す。

export PATH=~/bin:$PATH
  • 以下でビルド(bitbake)までを実施。
$ git config --global user.name "Your Name"
$ git config --global user.email "Your Email"
$ git config --list

$ mkdir imx-yocto-bsp
$ cd imx-yocto-bsp
$ repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-warrior -m imx-4.19.35-1.1.0.xml
$ repo sync

$ DISTRO=fsl-imx-wayland MACHINE=imx6ull14x14evk source fsl-setup-release.sh -b build-wayland
$ bitbake imx-image-full

上記で実施して以下のコメントが表示されたので気づいたのだけれど、

WARNING: You have included the meta-gnome layer, but 'x11' has not been enabled in your DISTRO_FEATURES. Some bbappend files may not take effect. See the meta-gnome README for details on enabling meta-gnome support.

おそらく実施するのは

$ bitbake imx-image-multimedia

で よかった。ドキュメントに記載があるようにiMX 6UltraLiteLiteはimx-image-fullで作成される機能をサポートしていない。

  • 最後に以下でSDカードにイメージをコピーして、SDカードからブートできた。
$ # bunzip2 -dk -f imx-image-full-imx6ull14x14evk.wic.bz2 
$ # sudo dd if=./imx-image-full-imx6ull14x14evk.wic of=/dev/sdc bs=1M conv=fsync
$ bunzip2 -dk -f imx-image-multimedia-imx6ull14x14evk.wic.bz2 
$ sudo dd if=./imx-image-multimedia-imx6ull14x14evk.wic of=/dev/mmcblk0 bs=1M conv=fsync

TODO