在/sys/devices/platform/6b030000.esdhc/mmc_host/mmc0/mmc0:0001/目录下可以读取到cid、csd、dsr、ocr、寄存器的值.
# mount -t debugfs none /sys/kernel/debug/
@xxx:/sys/kernel/debug/mmc0 # cat ios
@xxx:/sys/kernel/debug/mmc0/mmc0:0001 # cat ext_csd
00000000000000000000000000000000390300c0470700c04707000000000000000101000000000000000000000000000000000000000000000000000a000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000900e00070100000000151f20000000000000000000000000000000010100090000000008000200571f0a0aeeee8888001e0f460f78140100c0470710140a0a090201320808400007fdfb550100640aeeeeee99011e0200000000320a00100000ee01000000000000000000012020010100000000000000000000000000000000000000000000000000000000000000000000000000001f0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ffffffff00000103007f0003013f3f01010100000000000000
当然这样看很难看,无法很快的确认寄存器中某些位的值。因此,网上就有个小哥写了个python脚本来解析这512字节的数据,以常人可以理解的格式进行解析。详见:https://blog.kylemanna.com/linux/parse-emmc-extended-csd-ecsd-registers-with-python/ 输出的格式如下:
victor @victor-HP:~/ work2/cal_time$ python analysis_ext_csd.py
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0016: 39 03 00 c0 47 07 00 c0 47 07 00 00 00 00 00 00
0032: 00 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00
0048: 00 00 00 00 00 00 00 00 00 00 00 00 0a 00 00 01
0064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0096: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0112: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0128: 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
0144: 00 00 00 00 00 00 00 00 00 00 00 00 00 90 0e 00
0160: 07 01 00 00 00 00 15 1f 20 00 00 00 00 00 00 00
0176: 00 00 00 00 00 00 00 00 01 01 00 09 00 00 00 00
0192: 08 00 02 00 57 1f 0a 0a ee ee 88 88 00 1e 0f 46
0208: 0f 78 14 01 00 c0 47 07 10 14 0a 0a 09 02 01 32
0224: 08 08 40 00 07 fd fb 55 01 00 64 0a ee ee ee 99
0240: 01 1e 02 00 00 00 00 32 0a 00 10 00 00 ee 01 00
0256: 00 00 00 00 00 00 00 00 01 20 20 01 01 00 00 00
0272: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0288: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0304: 00 00 00 1f 01 00 00 00 00 00 00 00 00 00 00 00
0320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0336: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0352: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0368: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0384: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0416: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0432: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0448: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0464: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0480: 00 00 00 00 00 00 01 ff ff ff ff 00 00 01 03 00
0496: 7f 00 03 01 3f 3f 01 01 01 00 00 00 00 00 00 00
BOOT_SIZE_MULTI[226] = 0x20
Python内容如下:
#!/usr/bin/env python
"""
Author: Kyle Manna <kyle@kylemanna.com>
Blog: https://blog.kylemanna.com
"""
import binascii
import re
import sys
def str2bytearray(s):
if len(s) % 2:
s = '0' + s
reorder = True
if reorder:
r = []
i = 1
while i <= len(s):
r.append(s[len(s) - i - 1])
r.append(s[len(s) - i])
i += 2
s = ''.join(r)
out = binascii.unhexlify(s)
return out
if __name__ == '__main__':
ecsd_str = '00000000000000000000000000000000390300c0470700c04707000000000000000101000000000000000000000000000000000000000000000000000a000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000900e00070100000000151f20000000000000000000000000000000010100090000000008000200571f0a0aeeee8888001e0f460f78140100c0470710140a0a090201320808400007fdfb550100640aeeeeee99011e0200000000320a00100000ee01000000000000000000012020010100000000000000000000000000000000000000000000000000000000000000000000000000001f0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ffffffff00000103007f0003013f3f01010100000000000000'
#ecsd_str = '320100'
ecsd = str2bytearray(ecsd_str)
csd_len = len(ecsd)
line_len = 16
i = 0
while i < len(ecsd):
sys.stdout.write("{0:04d}:\t".format(i))
for j in range(line_len):
if (i < csd_len):
sys.stdout.write("{0:=02x}".format(ord(ecsd[csd_len-i-1])))
i = i + 1
else:
break
if (j == (line_len - 1)): pass
elif (i % 4): sys.stdout.write(" ")
else: sys.stdout.write(" ")
sys.stdout.write("\n")
print "BOOT_SIZE_MULTI[226] = 0x{:x}".format(ord(ecsd[csd_len-168-1]))
让cp显示进度的工具,拷贝文件夹也是可以的
$ wget http://ftp.gnu.org/gnu/coreutils/coreutils-9.1.tar.xz
$ tar -xf coreutils-9.1.tar.xz
$ cd coreutils-9.1/
$ curl -JLO https://raw.githubusercontent.com/jarun/advcpmv/master/advcpmv-0.9-9.1.patch
$ patch -p1 -i advcpmv-0.9-9.1.patch
$ export FORCE_UNSAFE_CONFIGURE=1
$ ./configure
$ make
$ sudo cp src/cp /usr/bin/cp
$ sudo cp src/mv /usr/bin/mv
# 用的时候要切换到root模式才行
# cp -r -g /root /home/
#(显示总大小、速度、剩余时间、不显示已拷贝大小,一般速度200kb/s)
$ rsync -av --progress /mnt /home
# (显示拷贝速度、剩余时间、已拷贝大小、进度%,不显示总大小,一般速度为300kb/s)
$ cp -rv 1113 1113_cr7_2
只适用于远程两节点间拷贝
$ scp -r /mnt root@127.0.0.1:/home (拷贝文件夹要加参数 -r,拷贝文件不需要)
#(显示拷贝速度、剩余时间、已拷贝大小、进度%,不显示总大小,一般速度为10M/s)
# (显示速度、进度、不显示总大小、剩余时间、已拷贝大小,一般速度300kb-1M/s不等)
# vi cp.sh
#!/bin/bash
trap 'exit_fun' 2
usage(){
echo "Usage: `basename $0` \"src file\" \"dst file\""
exit 1
}
exit_fun(){
echo -e "\033[?25h"
kill -9 $(ps -ef|awk '/ [c]p /{print $2}') &>/dev/null
exit 1
}
[ "$#" -ne "2" ] && usage
[ -d "$2" ] && k=${2%%/}/`basename $1` || k=$2
fromsize=`ls -s $1|cut -d" " -f1`
cp $1 $k &
start=`date +%s`
sleep 0.2
echo -ne "\033[?25l"
while :;do
tosize=`ls -s $k|cut -d" " -f1`
x=`echo "$tosize $fromsize"|awk '{print int($1*100/$2)}'`
[ $x -eq 99 ] && x=100
echo -n "["
for((i=0;i<x;i=$i+2));do echo -n "=";done
echo -n ">"
for((j=i;j<=99;j=$j+2));do echo -n " ";done
now=$[`date +%s` - $start]
[ $now -eq 0 ] && now=1
avg=$[$tosize/$now]
printf "] %4s%% %4sKb/s" $i $avg
[ $x -ge 100 ] && break
sleep 0.1
echo -ne "\r"
done
echo -e "\033[?25h"
:wq
# chmod +x cp.sh
# 示例:
# ./cp.sh /mnt/a.tar.gz /home
注: 不能拷贝文件夹,只能拷贝单个文件
转自
串行器 | 解串器 | ||
---|---|---|---|
GMSL1 | MAX96701/MAX96715 | MAX9286 | |
12bit DVP IN 1 SIO OUT@1.76Gbps | 4IN 1OUT@MIPI 1.5Gbps | ||
GMSL1/2 兼容 | MAX9295A | MAX9296 | MAX96722 |
4-MIPI IN 1 SIO OUT@6Gbps | 2IN 2OUT@MIPI 2.5Gbps | 4IN 1OUT@MIPI 2.5Gbps | |
GMSL2 | MAX96717/MAX96717F | MAX96712 | |
4-MIPI IN 1 SIO OUT@6Gbps/3Gbps | 4IN 1OUT@MIPI 2.5Gbps |
** GMSL的通信机理 **
(以下信息可以参考Serializer的手册,比如,MAX96705)
图像传感器Image Sensor将捕获的光信号转为数字信号,经CSI2协议传输给串行器(MAX9295A), 传输内容包括:图像数据信息,像素时钟,行同步信号,帧同步信号,其中raw12表示摄像头的传输数据格式为原始数据raw格式,每个像素点有12bit数据,30fps表示每秒发送30张图像
串行器接收到数据信息后,对信息进行串行化处理,将数据整理成包的形式,然后通过同轴电缆,将包以串行的形式发送出去,我们注意到在通过同轴电缆时,有两个方向的数据流传输,其中一个是前向通道,用于发送摄像头捕捉的图像数据,其带宽为6Gbps,还有一个为回馈通道,用以接收应答信息,带宽为187Mbps,这两个通道的传输速率是不一样的,可以根据实际需要进行设定,这也是GMSL的一大特色
之后解串器会接收到串行器串行化的数据,对数据再进行解串,使数据回复至原来模样,然后将原始数据传给FPGA,这个一个定制电路板,一般图像处理器ISP模块会集成到里面,原始数据其实就是发送给了FPGA里面的ISP模块,在它里面对数据进行一些算法处理,最终输出RGB或者YUV格式
图中是将处理好的数据发送给了LCD(液晶显示器),但在自动驾驶中,这个地方就会有些差异,ISP会将处理好的图像数据发送给FPGA里的AI芯片,通过卷积神经网络(CNN)对图像进行分类,检测,跟踪等等,然后根据实际情况,指挥FPGA中的MCU对底盘进行控制,以达到自动驾驶的目的
Step 1. 下载
下载地址 官网
Step 2. 安装
双击安装包下载。
从Cygwin Mirror Sites选择国内镜像并添加,然后选择一个mirror进行安装:
安装 Devel -binutils、 gcc 、mingw 、gdb
Step 3. 使用
a5059726@RECH-0054891 /cygdrive/c
$ cygcheck -c cygwin
Cygwin Package Information
Package Version Status
cygwin 3.4.6-1 OK
Step 4. 配置 将以下目录添加到环境变量:
C:\cygwin64\bin
C:\cygwin64\sbin
a5059726@RECH-0054891 /cygdrive/c
$ gcc --version
gcc (GCC) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
a5059726@RECH-0054891 /cygdrive/c
$ make --version
GNU Make 4.4
Built for x86_64-pc-cygwin
Copyright (C) 1988-2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
参考:
"And here's to you, <span style="background-color:green">Mrs. Robinson</span>, Jesus loves you more than you will know."
“And here’s to you, Mrs. Robinson, Jesus loves you more than you will know.”