• STM32MP157F-DK2 使用体验


    This is designed for STM32MP157F-DK2

    It costs me almost two years.

    FPS
    (while true; do export fps=`cat /sys/kernel/debug/dri/0/state | grep fps -m1 | grep -o '[0-9]\+'`; echo display ${fps}fps; sleep 4; done) &
    
    • 1
    curl
    curl http://121.5.149.236/snow.mpg --verbose --output snow.mpg
    
    • 1
    gstreamer
    Internet file

    Run After Exit SSH

    nohup gst-launch-1.0 playbin uri=http://XX.157.101.63/watch.mp4 &
    
    • 1
    local file
    gst-launch-1.0 playbin uri=file:///home/root/watch.mp4
    /* Display in framebuffer (usually a TFT LCD)*/
    gst-launch-1.0 filesrc location=/home/root/littleVGL/maria.mpg ! decodebin ! videoconvert ! fbdevsink device=/dev/fb0
    #test
    gst-launch-1.0 -v videotestsrc ! video/x-raw,format=YUY2 ! videoconvert ! autovideosink
    #playbin or filesrc >> pipe
    gst-launch-1.0 playbin uri=file:///home/root/Video/sight.mp4 ! decodebin ! videoconvert ! autovideosink
    
    gst-launch-1.0 filesrc location=/home/root/Video/sight.mp4 ! decodebin ! videoconvert ! videoscale ! video/x-raw,width=320,height=240,framerate=30/1 ! autovideosink
    #play online video
    gst-launch-1.0 uridecodebin uri=http://XX.157.101.63/Watch.mp4 ! videoscale ! video/x-raw,width=800,height=480 ! autovideosink
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    ffmpeg
    display video information
    ffmpeg -i Video/Watch.mp4 w.mpeg
    ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
      built with gcc 9.3.0 (GCC)
      configuration: --disable-stripping --enable-pic --enable-shared --enable-pthreads --cross-prefix=arm-ostl-linux-gnueabi- --ld=u=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/recipe-sysroot' --cc='arm-ostl-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpsroot=/recipe-sysroot' --cxx='arm-ostl-linux-gnueabi-g++ -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/reux --enable-cross-compile --extra-cflags=' -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map==/usr/src/debug/ffmpegebug/ffmpeg/4.2.2-r0 -fdebug-prefix-map=/recipe-sysroot= -fdebug-prefix-map=/recipe-sysroot-native= -mthumb -mfpu=neon-vfpv4 -mf/recipe-sysroot' --extra-ldflags='-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed' --sysroot=/recipe-sysroot --libdir=/usr/lib --shpeg --disable-mipsdsp --disable-mipsdspr2 --cpu=cortex-a7 --pkg-config=pkg-config --disable-static --enable-alsa --enable-avcodeenable-avformat --enable-avresample --enable-bzlib --disable-libfdk-aac --enable-gpl --disable-libgsm --disable-indev=jack --disibmfx --disable-libmp3lame --disable-openssl --enable-postproc --disable-sdl2 --disable-libspeex --enable-swresample --enable-sw --disable-vdpau --disable-libvpx --enable-libx264 --disable-libx265 --enable-libxcb --enable-outdev=xv --enable-zlib
      libavutil      56. 31.100 / 56. 31.100
      libavcodec     58. 54.100 / 58. 54.100
      libavformat    58. 29.100 / 58. 29.100
      libavdevice    58.  8.100 / 58.  8.100
      libavfilter     7. 57.100 /  7. 57.100
      libavresample   4.  0.  0 /  4.  0.  0
      libswscale      5.  5.100 /  5.  5.100
      libswresample   3.  5.100 /  3.  5.100
      libpostproc    55.  5.100 / 55.  5.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Video/Watch.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf58.29.100
      Duration: 00:03:02.37, start: 0.000000, bitrate: 714 kb/s
        Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x480 [SAR 16:15 DAR 16:9], 578 kb/s, 29.97 fps, 29.97
        Metadata:
          handler_name    : ISO Media file produced by Google Inc. Created on: 01/03/2019.
        Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
        Metadata:
          handler_name    : ISO Media file produced by Google Inc. Created on: 01/03/2019.
    Stream mapping:
      Stream #0:0 -> #0:0 (h264 (native) -> mpeg1video (native))
      Stream #0:1 -> #0:1 (aac (native) -> mp2 (native))
    Press [q] to stop, [?] for help
    [mpeg @ 0x60a10] VBV buffer size not set, using default size of 230KB
    If you want the mpeg file to be compliant to some specification
    Like DVD, VCD or others, make sure you set the correct buffer size
    Output #0, mpeg, to 'w.mpeg':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf58.29.100
        Stream #0:0(und): Video: mpeg1video, yuv420p, 800x480 [SAR 16:15 DAR 16:9], q=2-31, 200 kb/s, 29.97 fps, 90k tbn, 29.97 tbc
        Metadata:
          handler_name    : ISO Media file produced by Google Inc. Created on: 01/03/2019.
          encoder         : Lavc58.54.100 mpeg1video
        Side data:
          cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
        Stream #0:1(eng): Audio: mp2, 44100 Hz, stereo, s16, 384 kb/s (default)
        Metadata:
          handler_name    : ISO Media file produced by Google Inc. Created on: 01/03/2019.
          encoder         : Lavc58.54.100 mp2
    frame= 5465 fps= 29 q=31.0 Lsize=   19288kB time=00:03:02.37 bitrate= 866.4kbits/s speed=0.972x
    video:10562kB audio:8549kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.924291%
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51

    Useful Command

    ffmpeg -i norway.mp4 -s 800*480 output.mp4 -q:v 1
    /* A different encode for Video contrast to H.264 */
    ffmpeg -i radio.mp4 maria.mpeg
    #LOW Quality but the file is small
    ffmpeg -i in.mp4 -vcodec libx264 -preset veryslow -threads 2 -s 800*480 -acodec copy out.mp4
    #High Quality but the file is large
    ffmpeg -i now.mp4 -preset ultrafast -s 800*480 Apple.mp4
    #crop w:h:x:y
    ffmpeg -i input.mp4 -vf crop=400:400:10:10 output.mp4 -y
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    information
    gst-discoverer-1.0 sight.mp4
     
    Analyzing file:///home/root/Video/sight.mp4
    Done discovering file:///home/root/Video/sight.mp4
    
    Topology:
      container: Quicktime
        audio: MPEG-4 AAC
        video: H.264 (High Profile)
    
    Properties:
      Duration: 0:00:09.267000000
      Seekable: yes
      Live: no
      Tags:
          audio codec: MPEG-4 AAC audio
          maximum bitrate: 69000
          bitrate: 55392
          encoder: Lavf58.29.100
          container format: ISO MP4/M4A
          video codec: H.264 / AVC
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21

    gst-inspect-1.0

    gst-inspect-1.0 fbdevsink
    Factory Details:
      Rank                     none (0)
      Long-name                fbdev video sink
      Klass                    Sink/Video
      Description              Linux framebuffer videosink
      Author                   Sean D'Epagnier 
    
    Plugin Details:
      Name                     fbdevsink
      Description              Linux framebuffer video sink
      Filename                 /usr/lib/gstreamer-1.0/libgstfbdevsink.so
      Version                  1.14.4
      License                  LGPL
      Source module            gst-plugins-bad
      Source release date      2018-10-02
      Binary package           GStreamer Bad Plug-ins source release
      Origin URL               Unknown package origin
    
    GObject
     +----GInitiallyUnowned
           +----GstObject
                 +----GstElement
                       +----GstBaseSink
                             +----GstVideoSink
                                   +----GstFBDEVSink
    
    Pad Templates:
      SINK template: 'sink'
        Availability: Always
        Capabilities:
          video/x-raw
                     format: { (string)RGB, (string)BGR, (string)BGRx, (string)xBGR, (string)RGB, (string)RGBx, (string)xRGB, (string)RGB15, (string)RGB16 }
                      width: [ 1, 2147483647 ]
                     height: [ 1, 2147483647 ]
                  framerate: [ 0/1, 2147483647/1 ]
    
    Element has no clocking capabilities.
    Element has no URI handling capabilities.
    
    Pads:
      SINK: 'sink'
        Pad Template: 'sink'
    
    Element Properties:
      name                : The name of the object
                            flags: readable, writable
                            String. Default: "fbdevsink0"
      parent              : The parent of the object
                            flags: readable, writable
                            Object of type "GstObject"
      sync                : Sync on the clock
                            flags: readable, writable
                            Boolean. Default: true
      max-lateness        : Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited)
                            flags: readable, writable
                            Integer64. Range: -1 - 9223372036854775807 Default: 20000000
      qos                 : Generate Quality-of-Service events upstream
                            flags: readable, writable
                            Boolean. Default: true
      async               : Go asynchronously to PAUSED
                            flags: readable, writable
                            Boolean. Default: true
      ts-offset           : Timestamp offset in nanoseconds
                            flags: readable, writable
                            Integer64. Range: -9223372036854775808 - 9223372036854775807 Default: 0
      enable-last-sample  : Enable the last-sample property
                            flags: readable, writable
                            Boolean. Default: true
      last-sample         : The last sample received in the sink
                            flags: readable
                            Boxed pointer of type "GstSample"
      blocksize           : Size in bytes to pull per buffer (0 = default)
                            flags: readable, writable
                            Unsigned Integer. Range: 0 - 4294967295 Default: 4096
      render-delay        : Additional render delay of the sink in nanoseconds
                            flags: readable, writable
                            Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0
      throttle-time       : The time to keep between rendered buffers (0 = disabled)
                            flags: readable, writable
                            Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0
      max-bitrate         : The maximum bits per second to render (0 = disabled)
                            flags: readable, writable
                            Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0
      show-preroll-frame  : Whether to render video frames during preroll
                            flags: readable, writable
                            Boolean. Default: true
      device              : The framebuffer device eg: /dev/fb0
                            flags: readable, writable
                            String. Default: null
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    display the fps of mi-pi
    cat /sys/kernel/debug/dri/0/state | grep fps -m1
    
    • 1
    iw
    #scan SSID
    iw dev wlan0 scan | grep SSID
    #link status
    iw dev wlan0 link
    #list dev performance
    iw dev list
    #connect SSID without password
    iw dev wlan0 connect mteaching
    #connect SSID with password
    iw dev wlan0 connect mteaching keys d:0:12345678
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    connect to wireless network
    ifconfig wlan0 up
    sleep 5
    
    wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
    iw dev wlan0 link
    udhcpc -i wlan0
    ping www.baidu.com -c 4
    ntpdate ntp1.aliyun.com
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    initial wireless network
    wpa_passphrase mteaching 12345678 >> /etc/wpa_supplicant.conf
    
    • 1
    #No Password
    wpa_passphrase longsys >> /etc/wpa_supplicant.conf
    
    • 1
    • 2
    wpa_supplicant.conf
    root@stm32mp1:~# cat /etc/wpa_supplicant.conf
    ctrl_interface=/var/run/wpa_supplicant
    ctrl_interface_group=0
    update_config=1
    
    network={
            key_mgmt=NONE
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    script
    download
    echo "- - - - Viedo Download - - - -"
    
    items=(
    "arduino.mp4" "done.mp4" "ferrari.mp4" "mac.mp4" "mpu.mp4"
    "norway.mp4" "sight.mp4" "signal.mp4" "travel.mp4" "watch.mp4"
    )
    
    for item in ${items[*]}
    do 
    	wget "http://82.157.101.63/${item}" 
    	echo "[done]"
    done
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    without certificate
    wget https://www.apple.com.cn/105/media/cn/iphone-12/2020/7f5b7de7-9f8c-41eb-bf3b-f294773108e6/anim/hero-purple/large_2x.mp4 --no-check-certificate
    
    • 1
    play
    ehco "- - - Video Player by GStreamer - - -"
    for item in `ls *.mp4`
    do
    	echo "Now Play Video -->[${item}]"
    	gst-launch-1.0 playbin uri=file:///home/root/Video/${item}
    	echo -e "- - - End - - -\r\n"
    done
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    scp

    transfer file between hosts

    scp output.mpeg  root@192.168.137.10:/home/root/Video
    
    • 1
    pscp
    #'r' means directory supported, pscp is provided by SSH
    pscp -r D:\Web\monkey root@120.26.185.144:/var/www/html
    
    • 1
    • 2
    weston

    version V1.2.0

    #start
    systemctl start weston
    #stop
    systemctl stop weston
    
    • 1
    • 2
    • 3
    • 4

    version 3.0.0

    systemctl start weston@root.service
    
    systemctl stop weston@root.service
    
    • 1
    • 2
    • 3

    Some Linux Cmd

    fbtft
    fb-test
    fb-test -r
    sleep 1
    fb-test -g
    sleep 1
    fb-test -b
    sleep 1
    fb-test -w
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    monitor
    cpu temperature
    root@stm32mp1:/sys/devices/virtual/thermal/thermal_zone0# cat temp
    62866
    
    • 1
    • 2
    package
    process
    apt-get install nano
    apt-get install redis
    apt-get install nginx
    apt-get install mosquitto mosquitto-clients
    
    • 1
    • 2
    • 3
    • 4
    hardware supported by python
    apt-get install python3-pip
    apt-get install libgpiod-python
    apt-get install python3-smbus	
    apt-get install python3-spidev
    
    • 1
    • 2
    • 3
    • 4
    software supported by python
    apt-get install python3-dbus
    apt-get install python3-sqlite3
    apt-get install python3-gi
    
    • 1
    • 2
    • 3
    install package with pip
    pip3 install paho-mqtt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
    pip3 install requests -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
    pip3 install --user meson
    export PATH=/home/pi/.local/bin:$PATH
    
    alias python="python3"
    sudo mv /usr/bin/python3 python
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    update dtb
    make dtbs
    scp arch/arm/boot/dts/stm32mp157c-dk2.dtb root@192.168.7.1:/boot
    
    • 1
    • 2
    apt
    search
    apt-cache searsh redis
    
    • 1
    update
    install
    apt-get install ntpdate
    
    • 1
    synchronization
    ntpdate ntp1.aliyun.com
    
    • 1
    add timezone
    apt-cache search zone
    
    • 1
    install timezone
    apt-get install tzdata-asia
    
    • 1
    set timezone
    timedatectl set-timezone 'Asia/Shanghai'
    
    • 1
    Glib
    install
    sudo apt-get install libglib2.0-dev
    reference url:
    	https://www.cnblogs.com/alexyuyu/articles/2555216.html
        https://blog.csdn.net/andylauren/category_6219334.html
    
    • 1
    • 2
    • 3
    • 4
    C Build
    pkg-config --cflags --libs glib-2.0
    	-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lglib-2.0
    
    • 1
    • 2
    timestamp

    millisecond

    #include 
    #include 
    
    int main() {
        struct timeval start, end;
        gettimeofday( &start, NULL );
        sleep(3); 
        gettimeofday( &end, NULL );
        int timeInterval = 1000000 * ( end.tv_sec - start.tv_sec ) + end.tv_usec - start.tv_usec; 
        printf("time: %d us\n", timeInterval);
        return 0;
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    compression and decompression
    #compression 
    zip:
    	zip -q -r GDBus-master.zip GDBus-master
    tar:
    	tar -cvf file.tar file
    tar.gz
    	tar -czf file.tar.gz file
    
    #decompression
    *.zip
    	unzip master.zip
    *.tar
    	tar -xvf file.tar
    *.tar.gz
    	tar -xzvf file.tar.gz
    *.tar.bz2
    	tar xjvf file.tar.bz2
    *.tar.Z
    	tar -xZvf file.tar.Z
    *rar
    	unrar e file.rar
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    Shell
    echo "We used the Linux shell script mainly for the installation."
    
    if [ $EUID != 0 ];then
        echo "You aren't the root."
    fi
    
    array=(ABCDEF)
    echo $array
    echo ${#array[@]}
    
    array=(A B C D E F)
    echo $array
    echo ${#array[@]}
    
    for i in ${array[*]}
    do
        echo $i
    done
    
    i=0
    sum=0
    while(( $i != 10 ))
    do
    #    let "i++"
        i=`expr $i + 1`
        echo $i
    done
    
    i=0
    sum=0
    while [[ $i != 10 ]]
    do
        #let "i++"
        i=`expr $i + 1`
        echo $i
    done
    
    echo ******************************
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    modetest
    root@stm32mp1:~# modetest -M stm
    Encoders:
    id      crtc    type    possible crtcs  possible clones
    34      40      DSI     0x00000001      0x00000002
    
    Connectors:
    id      encoder status          name            size (mm)       modes   encoders
    35      34      connected       DSI-1           52x86           2       34
      modes:
            index name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
      #0 480x800 50.00 480 578 610 708 800 815 825 839 29700 flags: nhsync, nvsync; type: preferred, driver
      #1 480x800 60.00 480 550 582 654 800 815 825 841 33000 flags: nhsync, nvsync; type: driver
      props:
            1 EDID:
                    flags: immutable blob
                    blobs:
    
                    value:
            2 DPMS:
                    flags: enum
                    enums: On=0 Standby=1 Suspend=2 Off=3
                    value: 0
            5 link-status:
                    flags: enum
                    enums: Good=0 Bad=1
                    value: 0
            6 non-desktop:
                    flags: immutable range
                    values: 0 1
                    value: 0
            4 TILE:
                    flags: immutable blob
                    blobs:
    
                    value:
            20 CRTC_ID:
                    flags: object
                    value: 40
    
    CRTCs:
    id      fb      pos     size
    40      0       (0,0)   (480x800)
      #0 480x800 50.00 480 578 610 708 800 815 825 839 29700 flags: nhsync, nvsync; type: preferred, driver
      props:
            22 ACTIVE:
                    flags: range
                    values: 0 1
                    value: 1
            23 MODE_ID:
                    flags: blob
                    blobs:
    
                    value:
                            04740000e00142026202c40200002003
                            2f03390347030000320000000a000000
                            48000000343830783830300000000000
                            00000000000000000000000000000000
                            00000000
            19 OUT_FENCE_PTR:
                    flags: range
                    values: 0 18446744073709551615
                    value: 0
            24 VRR_ENABLED:
                    flags: range
                    values: 0 1
                    value: 0
            31 BACKGROUND_COLOR:
                    flags: range
                    values: 0 18446744073709551615
                    value: 18446462598732840960
            28 GAMMA_LUT:
                    flags: blob
                    blobs:
    
                    value:
            29 GAMMA_LUT_SIZE:
                    flags: immutable range
                    values: 0 4294967295
                    value: 256
    
    Planes:
    id      crtc    fb      CRTC x,y        x,y     gamma size      possible crtcs
    36      0       0       0,0             0,0     0               0x00000001
      formats: AR24 XR24 RG24 RG16 AR15 XR15 AR12 XR12 C8
      props:
            8 type:
                    flags: immutable enum
                    enums: Overlay=0 Primary=1 Cursor=2
                    value: 1
            17 FB_ID:
                    flags: object
                    value: 0
            18 IN_FENCE_FD:
                    flags: signed range
                    values: -1 2147483647
                    value: -1
            20 CRTC_ID:
                    flags: object
                    value: 0
            13 CRTC_X:
                    flags: signed range
                    values: -2147483648 2147483647
                    value: 0
            14 CRTC_Y:
                    flags: signed range
                    values: -2147483648 2147483647
                    value: 0
            15 CRTC_W:
                    flags: range
                    values: 0 2147483647
                    value: 480
            16 CRTC_H:
                    flags: range
                    values: 0 2147483647
                    value: 800
            9 SRC_X:
                    flags: range
                    values: 0 4294967295
                    value: 0
            10 SRC_Y:
                    flags: range
                    values: 0 4294967295
                    value: 0
            11 SRC_W:
                    flags: range
                    values: 0 4294967295
                    value: 31457280
            12 SRC_H:
                    flags: range
                    values: 0 4294967295
                    value: 52428800
            30 IN_FORMATS:
                    flags: immutable blob
                    blobs:
    
                    value:
                            01000000000000000900000018000000
                            01000000400000004152323458523234
                            52473234524731364152313558523135
                            41523132585231324338202000000000
                            ff010000000000000000000000000000
                            0000000000000000
                    in_formats blob decoded:
                             AR24:  LINEAR
                             XR24:  LINEAR
                             RG24:  LINEAR
                             RG16:  LINEAR
                             AR15:  LINEAR
                             XR15:  LINEAR
                             AR12:  LINEAR
                             XR12:  LINEAR
                             C8  :  LINEAR
            38 alpha:
                    flags: range
                    values: 0 65535
                    value: 65535
            39 zpos:
                    flags: immutable range
                    values: 0 0
                    value: 0
    41      0       0       0,0             0,0     0               0x00000001
      formats: AR24 RG24 RG16 AR15 AR12 C8
      props:
            8 type:
                    flags: immutable enum
                    enums: Overlay=0 Primary=1 Cursor=2
                    value: 0
            17 FB_ID:
                    flags: object
                    value: 0
            18 IN_FENCE_FD:
                    flags: signed range
                    values: -1 2147483647
                    value: -1
            20 CRTC_ID:
                    flags: object
                    value: 0
            13 CRTC_X:
                    flags: signed range
                    values: -2147483648 2147483647
                    value: 0
            14 CRTC_Y:
                    flags: signed range
                    values: -2147483648 2147483647
                    value: 0
            15 CRTC_W:
                    flags: range
                    values: 0 2147483647
                    value: 0
            16 CRTC_H:
                    flags: range
                    values: 0 2147483647
                    value: 0
            9 SRC_X:
                    flags: range
                    values: 0 4294967295
                    value: 0
            10 SRC_Y:
                    flags: range
                    values: 0 4294967295
                    value: 0
            11 SRC_W:
                    flags: range
                    values: 0 4294967295
                    value: 0
            12 SRC_H:
                    flags: range
                    values: 0 4294967295
                    value: 0
            30 IN_FORMATS:
                    flags: immutable blob
                    blobs:
    
                    value:
                            01000000000000000600000018000000
                            01000000300000004152323452473234
                            52473136415231354152313243382020
                            3f000000000000000000000000000000
                            0000000000000000
                    in_formats blob decoded:
                             AR24:  LINEAR
                             RG24:  LINEAR
                             RG16:  LINEAR
                             AR15:  LINEAR
                             AR12:  LINEAR
                             C8  :  LINEAR
            43 alpha:
                    flags: range
                    values: 0 65535
                    value: 65535
            44 zpos:
                    flags: immutable range
                    values: 1 1
                    value: 1
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    make some test
    #RGB Display
    root@stm32mp1:~#modetest -s 35@40:480x800@RG24 -M stm
    setting mode 480x800-50.00Hz@RG24 on connectors 35, crtc 40
    
    • 1
    • 2
    • 3
    find
    #Find files in current directory by name.
    find . | grep weston.ini
    #Find special text in the files.
    find main.c | xargs grep -rin sync
    
    • 1
    • 2
    • 3
    • 4
    hexdump
    hexdump -C main -s 5672 -n 16
    
    • 1
    convert
    convert m.png -resize 64x gnu.png
    convert ios.jpg -resize x480 1.jpg
    
    convert 1.jpg -crop 480x800+0+28 iOS.jpg
    identify iOS.jpg
    
    • 1
    • 2
    • 3
    • 4
    • 5
    Thread
    show thread(s) in process
    ps
    ps -T -p PID
    
    • 1
    top
    top -H -p PID
    
    • 1
    kill a process
    ps afx | grep ...
    
    • 1

    Blue Z Stack

    hcitool

    Query Information
    hcitool leinfo B8:8A:5E:78:7E:1E
    Requesting information ...
            Handle: 64 (0x0040)
            LMP Version: 4.2 (0x8) LMP Subversion: 0x321
            Manufacturer: Texas Instruments Inc. (13)
            Features: 0x19 0x00 0x00 0x00 0x00 0x00 0x00 0x00
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    dump
    #btmon may be more helpful
    btmon
    
    hcidump --raw -i hci0 -t -X
    
    • 1
    • 2
    • 3
    • 4

    How to save logs and open with wireShark

    Open the file directly.

    whitelist

    BLE Whitelist

    The relationship between Character ID and Blue Z
    In Arduino Code
    #define SERVICE_UUID        "4FAFC201-1FB5-459E-8FCC-C5C9C331914B"
    #define CHARACTERISTIC_UUID "BEB5483E-36E1-4688-B7F5-EA07361B26A8"
    
    • 1
    • 2

    In Blue Z

    root@stm32mp1:~# hcitool lescan | grep mon
    4C:75:25:BB:86:EA mongoose OS
    
    root@stm32mp1:~# bluetoothctl
    Agent registered
    [CHG] Controller 43:43:A1:12:1F:AC Pairable: yes
    [bluetooth]# connect 4C:75:25:BB:86:EA
    Attempting to connect to 4C:75:25:BB:86:EA
    [CHG] Device 4C:75:25:BB:86:EA Connected: yes
    [CHG] Device 4C:75:25:BB:86:EA Name: mongoose OS
    [CHG] Device 4C:75:25:BB:86:EA Alias: mongoose OS
    Connection successful
    [CHG] Device 4C:75:25:BB:86:EA UUIDs: 00001800-0000-1000-8000-00805f9b34fb
    [CHG] Device 4C:75:25:BB:86:EA UUIDs: 00001801-0000-1000-8000-00805f9b34fb
    [NEW] Primary Service (Handle 0x17c4)
            /org/bluez/hci0/dev_4C_75_25_BB_86_EA/service0001
            00001801-0000-1000-8000-00805f9b34fb
            Generic Attribute Profile
    [NEW] Characteristic (Handle 0x179c)
            /org/bluez/hci0/dev_4C_75_25_BB_86_EA/service0001/char0002
            00002a05-0000-1000-8000-00805f9b34fb
            Service Changed
    [NEW] Descriptor (Handle 0xb5ac)
            /org/bluez/hci0/dev_4C_75_25_BB_86_EA/service0001/char0002/desc0004
            00002902-0000-1000-8000-00805f9b34fb
            Client Characteristic Configuration
    [NEW] Secondary Service (Handle 0x17c4)
            /org/bluez/hci0/dev_4C_75_25_BB_86_EA/service0028
            /* service */
            4fafc201-1fb5-459e-8fcc-c5c9c331914b
            Vendor specific
    [NEW] Characteristic (Handle 0x179c)
            /org/bluez/hci0/dev_4C_75_25_BB_86_EA/service0028/char0029
            CHARACTERISTIC_UUID
            /* characteristic */
            beb5483e-36e1-4688-b7f5-ea07361b26a8
            Vendor specific
    [NEW] Descriptor (Handle 0xc2dc)
            /org/bluez/hci0/dev_4C_75_25_BB_86_EA/service0028/char0029/desc002b
            00002902-0000-1000-8000-00805f9b34fb
            Client Characteristic Configuration
    [CHG] Device 4C:75:25:BB:86:EA UUIDs: 00001800-0000-1000-8000-00805f9b34fb
    [CHG] Device 4C:75:25:BB:86:EA UUIDs: 00001801-0000-1000-8000-00805f9b34fb
    [CHG] Device 4C:75:25:BB:86:EA UUIDs: 4fafc201-1fb5-459e-8fcc-c5c9c331914b
    [CHG] Device 4C:75:25:BB:86:EA ServicesResolved: yes
    [mongoose OS]#
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46

    CAN Bus

    Link layer

    ip addr
    #what's dbitrate and fd?
    ip link set can0 type can bitrate 500000
    ip link set can0 up type can bitrate 1000000 dbitrate 2000000 fd on
    ip -details link show can0
    ip link set can0 up
    ip -details link show can0
    ifconfig
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8

    DTS

    SPI

    &spi5 {
    	cs-gpios = <&gpiof 6 0>;
        status = "okay";
    	spidev@0{
            compatible = "spidev";
            reg = <0>;
            spi-max-frequency = <100000000>;
        };
    };
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    mcp2515
    &spi5 {
    	cs-gpios = <&gpiof 6 0>;
        status = "okay";
    		
        mcp2515@0{
        	compatible = "microchip,mcp2515";
            reg = <0>;
            spi-max-frequency = <100000000>;
    	};
    };
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    PWM
    /sys/class/pwm
    
    • 1
    /*ACT*/
    pwm1_pins_a: pwm1-0 {
    	pins {
    		pinmux = <STM32_PINMUX('E', 9, AF1)>, /* TIM1_CH1 */
    				 <STM32_PINMUX('E', 11, AF1)>, /* TIM1_CH2 */
    				 <STM32_PINMUX('E', 14, AF1)>; /* TIM1_CH4 */
    		bias-pull-down;
    		drive-push-pull;
    		slew-rate = <0>;
    		};
    	};
    /*NO ACT*/
    pwm1_pins_a: pwm1-0 {
    	pins {
        	pinmux = <STM32_PINMUX('E', 9, AF1)>,  /* TIM1_CH1 */
    				 <STM32_PINMUX('D', 15, AF1)>,  /* TIM1_CH4 */
            bias-pull-down;
    		drive-push-pull;
    		slew-rate = <0>;
    		};
    	};
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    Support for ST7701
    panel_otm8009a: panel-otm8009a@0 {
        compatible = "techstar,ts8550b";
        reg = <0>;
        reset-gpios = <&gpioe 4 GPIO_ACTIVE_LOW>;
        VCC-supply = <&v3v3>;
        IOVCC-supply = <&v3v3>;
        status = "okay";
    
        port {
        	panel_in: endpoint {
        		remote-endpoint = <&dsi_out>;
        	};
        };
    };
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
  • 相关阅读:
    计算机毕业设计(附源码)python疫情医疗物资管理系统
    Flutter异步与线程详解
    JavaScript:模拟拍照
    用C语言列出Linux或Unix上的网络适配器
    简单易懂的 全景图高清下载方法以及原理简要解析(支持下载建E、720yun、酷雷曼、景站、酷家乐、百度街景原图)
    02房价预测
    Go语言中接口interface(多接口,空接口,类别开关)的应用
    IO流:java中解码和编码出现乱码说明及代码实现
    【CSDN高校社区&兰州理工大学】# 新学期,新Flag # 开学季征文活动
    NDK 是什么 | FFmpeg 5.0 编译 so 库
  • 原文地址:https://blog.csdn.net/Cloud_1234_5678/article/details/126872278