在Yocto中为NXP的i.MX系列芯片构建Linux系统时,可以加入一些实用工具,比如直接操作内存的memtool。
这些工具在imx-test包中,比如imx-test_git.bb里。
比如在imx-image-core.bb中,IMAGE_INSTALL += "imx-test" ,在build出来的image文件里就会包含这些工具。烧写到板子上,在文件系统中找到工具就可以使用。
或者可以使用预先编译好的二进制工具,copy到板子里来运行也可以。
比如我将官方提供的二进制烧写文件mount到Ubuntu上,再从里面copy出memtool,copy到板子上,运行如下:
~# memtool
Usage:
Read memory: memtool [-8 | -16 | -32] <phys addr> <count>
Write memory: memtool [-8 | -16 | -32] <phys addr>=<value>
List SOC module: memtool *. or memtool .
Read register: memtool UART1.*
memtool UART1.UMCR
memtool UART1.UMCR.MDEN
memtool UART1.-
Write register: memtool UART.UMCR=0x12
memtool