Linux常用命令2

发布时间 2023-09-21 15:31:44作者: Charles_hui

cat /proc/mtd 查看 Nand Flash 分区情况

flash_erase /dev/mtd3 0 0
nandwrite -s 0x60000 -p /dev/mtd3 /home/root/imx6ull-14x14-nand-7-1024x600-c.dtb
sync

flash_erase /dev/mtd4 0 0
nandwrite -p /dev/mtd4 /home/root/zImage
sync

ps-A
kill 100

 

ls /dev/tty* “ttymxc0”就是开发板的串口 1,它已被默认被用在命令行的终端上。
stty -F/dev/ttymxc0 //查看串口信息 (这个是调试串口) echo "Hello" > /dev/ttymxc0

arm-linux-gnueabihf-gcc test_uart.c -o test_uart //指定32位系统编译
arm-linux-gnueabihf-gcc test_uart.c -o test_uart -pthread
scp demo root@192.168.1.113:/home/root

 

 


/**********************************************************************************************************************************************************/

1.编译uboot:

a.make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
b.make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mx6ull_14x14_ddr256_nand_defconfig (正点原子)
b.make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihfmx6ull_14x14_evk_nand_defconfig (nxp官方)
c.make V=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16

2.Uboot命令

nand-flash开发板在tftp环境下,uboot网络烧写程序:
1.tftp 80800000 zImage
2.tftp 83000000 imx6ull-14x14-nand-7-1024x600-c.dtb or tftp 83000000 imx6ull-alientek-nand.dtb
3.bootz 80800000 - 83000000

使用bootcmd封装上述命令:
1.setenv bootcmd 'tftp 80800000 zImage; tftp 83000000 imx6ull-14x14-nand-7-1024x600-c.dtb; bootz 80800000 - 83000000'
2.saveenv
3.boot (启动开发板)
uboot 倒计时结束以后就会启动 Linux 系统,其实就是执行的 bootcmd 中的启动命令。


从网络启动 Linux 系统:
1.setenv bootargs 'console=ttymxc0,115200 root=/dev/mmcblk1p2 rootwait rw'
2.setenv bootcmd 'tftp 80800000 zImage; tftp 83000000 imx6ull-14x14-nand-7-1024x600-c.dtb; bootz 80800000 - 83000000'
3.saveenv

下载裸机到SD_card:
./imxdownload adc.bin /dev/sdb


run命令r:
run 命令最大的作用在于运行我们自定义的环境变量

进程相关命令
“./hello &”就是让 hello 在后台运行
“ps”命令查看要关闭的软件 PID 是多少
“kill -9 pid”(进程 ID) 例如kill -9 166

更新内核和设备数:
06【正点原子】I.MX6U开发板文件拷贝及固件更新参考手册V1.2