作者的封存文章

Note: build Opencv 3.3.0 with TBB/IPP/Qt 5.8 and Eigen on Windows 10/Win64

Posted in programming, QT5 with tags , on 2017 年 10 月 22 日 by Kun-Yi

modify  the below in CMakeCache.txt

//Build with Qt Backend support
WITH_QT:BOOL=ON

//Include Intel TBB support
WITH_TBB:BOOL=ON

//Include Eigen2/Eigen3 support
WITH_EIGEN:BOOL=ON

//The path to Eigen3/Eigen2 headers
EIGEN_INCLUDE_PATH:PATH=D:/gits/ExternalLib/src/eigen/eigen-eigen-5a0156e40feb

//The directory containing a CMake configuration file for Qt5Concurrent.
Qt5Concurrent_DIR:PATH=D:/Qt/Qt5.8.0/5.8/msvc2015_64/lib/cmake/Qt5Concurrent

//The directory containing a CMake configuration file for Qt5Core.
Qt5Core_DIR:PATH=D:/Qt/Qt5.8.0/5.8/msvc2015_64/lib/cmake/Qt5Core

//The directory containing a CMake configuration file for Qt5Gui.
Qt5Gui_DIR:PATH=D:/Qt/Qt5.8.0/5.8/msvc2015_64/lib/cmake/Qt5Gui

//The directory containing a CMake configuration file for Qt5OpenGL.
Qt5OpenGL_DIR:PATH=D:/Qt/Qt5.8.0/5.8/msvc2015_64/lib/cmake/Qt5OpenGL

//The directory containing a CMake configuration file for Qt5Test.
Qt5Test_DIR:PATH=D:/Qt/Qt5.8.0/5.8/msvc2015_64/lib/cmake/Qt5Test

//The directory containing a CMake configuration file for Qt5Widgets.
Qt5Widgets_DIR:PATH=D:/Qt/Qt5.8.0/5.8/msvc2015_64/lib/cmake/Qt5Widgets

//Path to a file.
TBB_ENV_INCLUDE:PATH=D:/gits/ExternalLib/tbb-2018u1/include

//Path to a library.
TBB_ENV_LIB:FILEPATH=D:/gits/ExternalLib/tbb-2018u1/lib/intel64/vc14/tbb.lib

//Path to a library.
TBB_ENV_LIB_DEBUG:FILEPATH=D:/gits/ExternalLib/tbb-2018u1/lib/intel64/vc14/tbb_debug.lib

//Path to a file.
TBB_VER_FILE:FILEPATH=D:/gits/ExternalLib/tbb-2018u1/include/tbb/tbb_stddef.h

then run cmake again, use Visual Studio to open Solutions

D:\gits\ExternalLib\opencv-3.3.0>cmake ..\src\opencv-3.3.0
-- Could NOT find PythonInterp (missing:  PYTHON_EXECUTABLE) (Required is at least version "3.4")
-- Could NOT find PythonInterp (missing:  PYTHON_EXECUTABLE) (Required is at least version "3.2")
-- Found TBB: D:/gits/ExternalLib/tbb-2018u1/lib/intel64/vc14/tbb.lib
-- found Intel IPP (ICV version): 2017.0.2 [2017.0.2]
-- at: D:/gits/ExternalLib/opencv-3.3.0/3rdparty/ippicv/ippicv_win
-- found Intel IPP IW binaries: 2017.0.2
-- at: D:/gits/ExternalLib/opencv-3.3.0/3rdparty/ippicv/ippicv_win/../ippiw_win/
-- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-- A library with BLAS API not found. Please specify library location.
-- LAPACK requires BLAS
-- A library with LAPACK API not found. Please specify library location.
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
-- Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
-- Could NOT find Matlab (missing:  MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN)
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- Excluding from source files list: D:/gits/ExternalLib/opencv-3.3.0/modules/imgproc/accum.neon.cpp
-- Torch importer has been enabled. To run the tests you have to install Torch ('th' executable should be available) and generate testdata using opencv_extra/testdata/dnn/generate_torch_models.py script.
--
-- General configuration for OpenCV 3.3.0 =====================================
--   Version control:               868747e
--
--   Platform:
--     Timestamp:                   2017-10-22T14:41:14Z
--     Host:                        Windows 10.0.15063 AMD64
--     CMake:                       3.6.3
--     CMake generator:             Visual Studio 14 2015 Win64
--     CMake build tool:            C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
--     MSVC:                        1900
--
--   CPU/HW features:
--     Baseline:                    SSE SSE2 SSE3
--       requested:                 SSE3
--     Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2
--       requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2
--       SSE4_1 (2 files):          + SSSE3 SSE4_1
--       SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
--       FP16 (1 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
--       AVX (5 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
--       AVX2 (7 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
--
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++11:                       YES
--     C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe  (ver 19.0.24215.1)
--     C++ flags (Release):         /DWIN32 /D_WINDOWS /W4 /GR  /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi      /wd4251 /wd4324 /wd4275 /wd4589 /MP8  /MD /O2 /Ob2 /DNDEBUG  /Zi
--     C++ flags (Debug):           /DWIN32 /D_WINDOWS /W4 /GR  /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi      /wd4251 /wd4324 /wd4275 /wd4589 /MP8  /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
--     C Compiler:                  C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
--     C flags (Release):           /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi        /MP8  /MD /O2 /Ob2 /DNDEBUG  /Zi
--     C flags (Debug):             /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi        /MP8  /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
--     Linker flags (Release):      /machine:x64  /INCREMENTAL:NO  /debug
--     Linker flags (Debug):        /machine:x64  /debug /INCREMENTAL
--     ccache:                      NO
--     Precompiled headers:         YES
--     Extra dependencies:          comctl32 gdi32 ole32 setupapi ws2_32 Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Test Qt5::Concurrent Qt5::OpenGL vfw32 glu32 opengl32 D:/gits/ExternalLib/tbb-2018u1/lib/intel64/vc14/tbb.lib
--     3rdparty dependencies:
--
--   OpenCV modules:
--     To be built:                 core flann imgproc ml objdetect photo video dnn imgcodecs shape videoio highgui superres ts features2d calib3d stitching videostab
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 python3 viz
--
--   Windows RT support:            NO
--
--   GUI:
--     QT 5.x:                      YES (ver 5.8.0)
--     QT OpenGL support:           YES (Qt5::OpenGL 5.8.0)
--     OpenGL support:              YES (glu32 opengl32)
--     VTK support:                 NO
--
--   Media I/O:
--     ZLib:                        build (ver 1.2.8)
--     JPEG:                        build (ver 90)
--     WEBP:                        build (ver encoder: 0x020e)
--     PNG:                         build (ver 1.6.24)
--     TIFF:                        build (ver 42 - 4.0.2)
--     JPEG 2000:                   build (ver 1.900.1)
--     OpenEXR:                     build (ver 1.7.1)
--     GDAL:                        NO
--     GDCM:                        NO
--
--   Video I/O:
--     Video for Windows:           YES
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  NO
--     FFMPEG:                      YES (prebuilt binaries)
--       avcodec:                   YES (ver 57.89.100)
--       avformat:                  YES (ver 57.71.100)
--       avutil:                    YES (ver 55.58.100)
--       swscale:                   YES (ver 4.6.100)
--       avresample:                YES (ver 3.5.0)
--     GStreamer:                   NO
--     OpenNI:                      NO
--     OpenNI PrimeSensor Modules:  NO
--     OpenNI2:                     NO
--     PvAPI:                       NO
--     GigEVisionSDK:               NO
--     DirectShow:                  YES
--     Media Foundation:            NO
--     XIMEA:                       NO
--     Intel PerC:                  NO
--
--   Parallel framework:            TBB (ver 2018.0 interface 10001)
--
--   Trace:                         YES (with Intel ITT)
--
--   Other third-party libraries:
--     Use Intel IPP:               2017.0.2 [2017.0.2]
--                at:               D:/gits/ExternalLib/opencv-3.3.0/3rdparty/ippicv/ippicv_win
--     Use Intel IPP IW:            prebuilt binaries (2017.0.2)
--     Use Intel IPP Async:         NO
--     Use Lapack:                  NO
--     Use Eigen:                   YES (ver 3.3.4)
--     Use Cuda:                    NO
--     Use OpenCL:                  YES
--     Use OpenVX:                  NO
--     Use custom HAL:              NO
--
--   OpenCL:                        
--     Include path:                D:/gits/ExternalLib/src/opencv-3.3.0/3rdparty/include/opencl/1.2
--     Use AMDFFT:                  NO
--     Use AMDBLAS:                 NO
--
--   Python 2:
--     Interpreter:                 C:/Python27/python.exe (ver 2.7.14)
--
--   Python 3:
--     Interpreter:                 NO
--
--   Python (for build):            C:/Python27/python.exe
--
--   Java:
--     ant:                         NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
--
--   Matlab:                        Matlab not found or implicitly disabled
--
--   Documentation:
--     Doxygen:                     NO
--
--   Tests and samples:
--     Tests:                       YES
--     Performance tests:           YES
--     C/C++ Examples:              YES
--
--   Install path:                  D:/gits/ExternalLib/opencv-3.3.0/install
--
--   cvconfig.h is in:              D:/gits/ExternalLib/opencv-3.3.0
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: D:/gits/ExternalLib/opencv-3.3.0

 

廣告

Note: XBL for Qualcomm

Posted in ARM, DragonBoard, Qualcomm with tags , on 2017 年 10 月 16 日 by Kun-Yi

Qualcomm 的平台從原本的 自家的SBL (Second Boot Loader) 改成走 UEFI 的 XBL (eXtensible Boot loader)

而且Toolchain 從以前的ARM DS-5 改成自家的Snapdragon LLVM, 最新的LLVM 是4.0.2(Oct. 2017), 但是平台上用的 XBL toolchain 可能是舊的

要看ReleaseNote 裡面用的版本, 因為他基於llvm.org 的版本不同, 跟改進的週期因素, 常常Compiler optional 關鍵字會起變化 需要特別的版本才能正確的re-build XBL (最近遇到必須是 SD LLVM 3.5.x, 但是官方支援管道, 極有可能會遇到不熟的跟你扯半天也沒正確結果)

今天找了一下 https://github.com/sudosurootdev/prebuilts_clang_linux-x86_host_msm-3.5/tree/pointers 這有一個 For Android NDK 用的版本 但是可以順利Rebuild XBL

 

 

Note: Kontron SMARC-sAMX6i

Posted in ARM, i.MX6 with tags on 2017 年 10 月 11 日 by Kun-Yi

from https://lists.yoctoproject.org/pipermail/meta-freescale/2014-December/011841.html download device tree files

The board always boot from ECSPI4, use W25Q16DW (16MBits/2MBytes)
ECSPI4 memory space layout

Partition 0, from 0 ~ 0xbffff (768KB), for bootloader
Partition 1, from 0xc0000 ~ 0xcffff (64KB), for U-Boot Environment use 32KB
Partition 2, others space, for user

LCD Brightness control through the below pins

MX6QDL_PAD_SD1_DAT0__GPIO1_IO16, Backlight Enabled
MX6QDL_PAD_SD1_DAT1__GPIO1_IO17, LCD Power Enabled
MX6QDL_PAD_SD1_CMD__PWM4_OUT, Brightness PWM ouput

I2C ports

I2C1, for SMARC General Purpose

MX6QDL_PAD_CSI0_DAT8__I2C1_SDA
MX6QDL_PAD_CSI0_DAT9__I2C1_SCL

I2C2, for HDMI

MX6QDL_PAD_KEY_COL3__I2C2_SCL
MX6QDL_PAD_KEY_ROW3__I2C2_SDA

I2C3, for Power Managmenet
I2C-GPIO0, for System management (PMIC:PFUZE100 on the bus)

MX6QDL_PAD_ENET_TXD0__GPIO1_IO30, SCL   MX6QDL_PAD_ENET_TX_EN__GPIO1_IO28, SDA

I2C-GPIO1, for SMARC CAMERA

MX6QDL_PAD_GPIO_6__GPIO1_IO06, SCL
MX6QDL_PAD_KEY_COL2__GPIO4_IO10, SDA

I2C-GPIO2, for SMARC LCD

MX6QDL_PAD_SD1_DAT2__GPIO1_IO19, SCL
MX6QDL_PAD_SD1_DAT3__GPIO1_IO21, SDA

 

 

2018計劃

Posted in Plan on 2017 年 10 月 11 日 by Kun-Yi

2018計劃

  • 區塊鏈 剩下共識演算法 雙花等要學
  • 實作一個有功能的server
  • 砸時間金錢 試著突破某些必須面對的問題
  • 影像演算法 處理接案事宜
  • 關掉 台灣 香港 公司 找其他路徑 前進
  • 砸資源(時間與金錢)突破自己的弱點, 不需要到很強, 但是要練到一定基本可以用的程度

Note: How to use SD LLVM 3.9.x toolchain to rebuild devcfg/QSEE 4.0

Posted in Qualcomm with tags , on 2017 年 09 月 18 日 by Kun-Yi

need modify  toolchain path, I modify the below for change to SD llvm 3.9.9

--- a/trustzone_images/build/ms/setenv.sh
+++ b/trustzone_images/build/ms/setenv.sh

@@ -9,16 +9,16 @@ unamestr=`uname`
MAKE_PATH=/pkg/gnu/make/3.81/bin
export ARMTOOLS=ARMCT6 #FIXME
export LLVMTOOLS=LLVM
-export LLVMROOT=/pkg/qct/software/llvm/release/arm/3.5.2.4
+export LLVMROOT=/media/kunyi/Works/qcom-llvm/v3.9.9
export LLVMBIN=$LLVMROOT/bin
-export LLVMLIB=$LLVMROOT/lib/clang/3.5.2/lib/linux
-export MUSLPATH=$LLVMROOT/tools/lib64
-export MUSL32PATH=$LLVMROOT/tools/lib32
+export LLVMLIB=$LLVMROOT/lib/clang/3.9.9/lib/linux
+export MUSLPATH=$LLVMROOT/aarch64-linux-gnu/libc
+export MUSL32PATH=$LLVMROOT/armv7-linux-gnueabi/libc
export LLVMINC=$MUSLPATH/include
export LLVM32INC=$MUSL32PATH/include
export LLVMTOOLPATH=$LLVMROOT/tools/bin
-export GNUROOT=/pkg/qct/software/arm/linaro-toolchain/aarch64-none-elf/4.9-2014.07
-export GNUARM7=/prj/llvm-arm/home/common/build_tools/gcc-linaro-arm-linux-gnueabihf-4.8-2014.02_linux
+export GNUROOT=/media/kunyi/Works/gcc-linaro-aarch64-none-elf-4.9-2014.07_linux
+export GNUARM7=/media/kunyi/Works/gcc-linaro-arm-linux-gnueabihf-4.8-2014.02_linux

and modify llvm.py to support 3.9.x version toolchain

diff --git a/trustzone_images/tools/build/scons/scripts/llvm.py b/trustzone_images/tools/build/scons/scripts/llvm.py
index 0133201..b4daab7 100755
--- a/trustzone_images/tools/build/scons/scripts/llvm.py
+++ b/trustzone_images/tools/build/scons/scripts/llvm.py
@@ -222,6 +222,11 @@ def generate(env):
     is37llvm=True
     LinkByGNU=False
 
+   if llvmbin.find("3.9")!= -1:
+    LinkByQCLD=True
+    is39llvm=True
+    LinkByGNU=False
+
    #----------------------------------------------------------------------------
    # GNU path definitions - begin
    #----------------------------------------------------------------------------
@@ -293,10 +298,13 @@ def generate(env):
    -enable-android-compat: is to use hardware div which is available on QC hardware, so keep it.
    -mllvm -post-RA-scheduler=false is added a workaround for  issue in the scheduling algorithm, due to which when we select -mcpu=cortex-a7 , clang gets infinitely hung'''
    if do_64:
-      if is37llvm:
-        LLVMFlags += " -target aarch64-linux-gnu -w -mllvm -aarch64-strict-align -mcpu=cortex-a53 -mllvm -enable-global-merge=false -nostdinc -mllvm -inline-threshold-multicaller-size=20 "
+      if is39llvm:
+        LLVMFlags += " -target aarch64-linux-gnu -w -mcpu=cortex-a53 -mllvm -enable-global-merge=false -nostdinc -mllvm -inline-threshold-multicaller-size=20 "
       else:
-        LLVMFlags += " -target aarch64-linux-gnu -Werror -mllvm -aarch64-strict-align -mcpu=cortex-a53 -mllvm -enable-global-merge=false -nostdinc "
+        if is37llvm:
+            LLVMFlags += " -target aarch64-linux-gnu -w -mllvm -aarch64-strict-align -mcpu=cortex-a53 -mllvm -enable-global-merge=false -nostdinc -mllvm -inline-threshold-multicaller-size=20 "
+        else:
+            LLVMFlags += " -target aarch64-linux-gnu -Werror -mllvm -aarch64-strict-align -mcpu=cortex-a53 -mllvm -enable-global-merge=false -nostdinc "
       #env.Replace(AS = ARMBIN + "armasm${EXE_EXT} -g --no_unaligned_access ")
       if UseClangAs:
          #env.Replace(AS = "clang_wrap " + "aarch64-linux-gnu-as -c ")
@@ -314,10 +322,13 @@ def generate(env):
          ASM_DBG = "-g "
    else:
       do_32 = True
-      if is37llvm:
+      if is39llvm:
         LLVMFlags += " -target arm-linux-gnueabi -w -mfloat-abi=softfp -mllvm -enable-android-compat -mcpu=cortex-a7 -mllvm -post-RA-scheduler=false -mno-unaligned-access  -mllvm -inline-threshold-multicaller-size=20 "
       else:
-        LLVMFlags += " -target arm-linux-gnueabi -Werror -mfloat-abi=softfp -mfpu=none -fno-vectorize-loops -mllvm -enable-android-compat -mcpu=krait2 -mno-unaligned-access "        
+        if is37llvm:
+            LLVMFlags += " -target arm-linux-gnueabi -w -mfloat-abi=softfp -mllvm -enable-android-compat -mcpu=cortex-a7 -mllvm -post-RA-scheduler=false -mno-unaligned-access  -mllvm -inline-threshold-multicaller-size=20 "
+        else:
+            LLVMFlags += " -target arm-linux-gnueabi -Werror -mfloat-abi=softfp -mfpu=none -fno-vectorize-loops -mllvm -enable-android-compat -mcpu=krait2 -mno-unaligned-access "        
       #env.Replace(AS = ARMBIN + "armasm${EXE_EXT} --apcs /noswst/interwork --no_unaligned_access ")
       if UseClangAs:
         env.Replace(AS = LLVMBIN + "clang${EXE_EXT} -target arm-linux-gnu -mfloat-abi=softfp -mcpu=cortex-a8 -x assembler -allow-integrated-as-for-asm-input -c ")

 

Note: Qualcomm BLSP/UART loopback testing

Posted in Qualcomm with tags , , on 2017 年 09 月 14 日 by Kun-Yi

when ref. lm80-p0436-5_peripherals_programming_guide.pdf to testing loopback method. you need break RX path if you have external UART connection and continuous send packet to your board, will confuse your testing result.

I guess just enabled an wire-and function by loopback. so recv. external packet & internal tx packet on same time.

 

 

Note: BAM/BLSP_UART IRQ Table for MSM8996

Posted in Qualcomm with tags , , , on 2017 年 09 月 12 日 by Kun-Yi

 

BLSP1:MasterID:86, BAM IRQ: 238, Below Core IRQ

  • BLSP1_QUP1, 95
  • BLSP1_QUP2, 96
  • BLSP1_QUP3, 97
  • BLSP1_QUP4, 98
  • BLSP1_QUP5, 99
  • BLSP1_QUP6, 100
  • BLSP1_UART1,107
  • BLSP1_UART2,108
  • BLSP1_UART3,109
  • BLSP1_UART4,110
  • BLSP1_UART5,111
  • BLSP1_UART6,112

BLSP2:MasterID:84, BAM IRQ: 239, Below Core IRQ

  • BLSP2_QUP1, 101
  • BLSP2_QUP2, 102
  • BLSP2_QUP3, 103
  • BLSP2_QUP4, 104
  • BLSP2_QUP5, 105
  • BLSP2_QUP6, 106
  • BLSP2_UART1,113
  • BLSP2_UART2,114
  • BLSP2_UART3,115
  • BLSP2_UART4,116
  • BLSP2_UART5,117
  • BLSP2_UART6,118