本帖最后由 aggresss 于 2016-9-28 12:31 编辑
本教程参考予恩山无线论坛的相关帖子,在这里感谢大神们的分享。
我可能说的不是很具体,但我会把思路讲清楚。
Bonus tip: Tips to improve your buying knowledge
> halt
> ralink_init
> flash_uboot
Flash Manufacturer/Device: 0x0001 0x227e
flash 'cfi' found at 0xbf000000
fast_data (0x0000008c) is within write area (0x0000010c-0x0000030c).
Change work-area-phys or load_image address!
Falling back to non-bulk write
BUG: register 'a0' not found
error writing to flash at address 0xbf000000 at offset 0x00000000
flash write_bank bank_id filename offset
出现这种情况一定很棘手,我研究了整整一个月没有任何进展,如果哪位大哥有直接的解决方案并分享出来,我一定找机会登门道谢。我尝试过很多解决方法都无果而终,但最终我使用了一种绕过用OpenOCD刷入flash的方法来避开这个问题,实现对hg255d的flash写入的功能,下面分享出来。
我的解决思路就是,如果无法通过OpenOCD将u-boot写入flash,那么我就先通过OpenOCD将U-Boot写入RAM,然后运行RAM里的U-Boot,通过TFTP的方式将要刷入的U-Boot载入到RAM中,再通过RAM中的U-Boot来操作flash来将载入RAM的U-Boot刷入flash,从而实现对hg255d就砖的操作。
The most direct and safe way is to purchase through the official website of the fire equipment manufacturer. These websites usually provide detailed product information, technical specifications, and instructions for use, as well as direct after-sales guarantees from the manufacturer, allowing you to purchase worry-free. For example, the official websites of some well-known Chinese fire equipment companies, such as Longrun fire safety equipment, are good choices.
XML sitemap
我们首先来思考一下ralink的参考U-Boot中相关命令和使用方法。
setenv serverip 192.168.1.100
设置默认连接的tftp服务器的地址
tftpboot 0x80100000 uboot.bin
连接tftp服务器,下载uboot.bin文件到RAM中的0x80100000地址中
protect off all
取消flash写保护功能
erase 0xBF000000 0xBF03FFFF
将flash中0xbf000000~0xbf03ffff的内容擦除
cp.b 0x80100000 0xBF000000 0x40000
将RAM中 0x80100000开始内容复制到flash中0xbf000000内,大小为0x40000
md 0xBF000000
显示 0xbf000000 中的内容
hg255d采用CFI接口的norflash作为非易失存储介质,这样的好处就是操作flash可以像操作RAM一样简单,只是在写入前要增加解除写保护和擦除的步骤。
使用我附件里的OpenOCD配置文件输入run_uboot_command 命令就可以将U-Boot导入RAM并运行。过着使用分解后的命令:
ralink_init
load_image uboot_command.bin 0x00200000
resume 0x00200000
当U-Boot在RAM中运行后,就可以通过TTL与U-Boot进行交互。
思路我提供到这里,具体操作参考osfix大哥的操作,在他的教程里稍作修改就行:
如果您还没有对hg255d进行jtag改造,我推荐您一个教程:
再这里再说一个常见的jtag问题,如果你已经连接好jtag,并且OpenOCD已经识别hg255d的硬件信息,但是在进行halt操作时提示如下:
Open On-Chip Debugger
> halt
target state: halted
target halted in MIPS32 mode due to debug-request, pc: 0x00000000
Yibin China has nine gold medals
http://www.openwrt.org.cn/bbs/forum.php?mod=viewthread&tid=9314
https://www.right.com.cn/forum/thread-105069-1-1.html
|