uboot下内存操作指令mw和md

md指令
uboot下输入指令md,会提示md的用法,memory display,即内存显示。

U-Boot-PetaLinux> md
md - memory display
Usage:
md [.b, .w, .l] address [# of objects]

b:8位 
w:16位 
l:32位(默认值) 
示例: 
 
上述0x10000000是要显示内存的那个地址,后面的数字是输出的个数,注意是16进制的。 
直接输入md来显示,默认是以32位为单位输出 。

mw指令
uboot下输入指令mw,会提示md的用法,memory write,即向内存中写入数据。

U-Boot-PetaLinux> mw
mw - memory write (fill)
Usage:
mw [.b, .w, .l] address value [count]

b\w\l的意思同上,address是要写入内存的地址,value是要写入的值,count是从address开始要写入多少个数,这些都是16进制数。 
示例: 

U-Boot-PetaLinux> mw.w 0x10000000 0x1234 1 
U-Boot-PetaLinux> md.w 0x10000000  1       
10000000: 1234 

示例
 
在0x10000000地址内存的起始位置写入0x12345678,打印出内存的输出。发现低位0x78是写在低地址0x10000000,高位0x12是写在高地址0x10000003上,也就是常说的小端模式(little endian),简单记忆:低低模式,即低位在低地址。
 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
=> help ? - alias for 'help' autoscr - run script from memory base - print or set address offset bdinfo - print Board Info structure boot - boot default, i.e., run 'bootcmd' bootd - boot default, i.e., run 'bootcmd' bootm - boot application image from memory bootp - boot image via network using BootP/TFTP protocol cmp - memory compare coninfo - print console devices and information cp - memory copy crc32 - checksum calculation dhcp - invoke DHCP client to obtain IP/boot params echo - echo args to console erase - erase FLASH memory flinfo - print FLASH memory information go - start application at address 'addr' help - print online help iminfo - print header information for application image imls - list all images found in flash itest - return true/false on integer compare loadb - load binary file over serial line (kermit mode) loads - load S-Record file over serial line loop - infinite loop on address range md - memory display mm - memory modify (auto-incrementing) mtest - simple RAM test mw - memory write (fill) nfs - boot image via network using NFS protocol nm - memory modify (constant address) printenv - print environment variables protect - enable or disable FLASH write protection rarpboot - boot image via network using RARP/TFTP protocol reset - Perform RESET of the CPU run - run commands in an environment variable saveenv - save environment variables to persistent storage setenv - set environment variables sleep - delay execution for some time tftpboot - boot image via network using TFTP protocol version - print monitor version
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值