codewarrior烧录_codewarrior烧写u-boot到nor(1)

这篇博客详细介绍了如何使用Codewarrior烧写u-boot到P1020RDB-PD板上的nor闪存。内容包括设置SW1拨位、创建SRAM程序、配置Flash Programmer、初始化TCL文件,以及烧写过程中需要注意的地址映射和调试步骤。在烧写完成后,博主遇到了u-boot启动时的乱码和重复打印问题,并通过调整CPU启动配置解决了问题。
摘要由CSDN通过智能技术生成

这里的烧写方法是一次次尝试出来的,也是加强一下自己对p1020启动流程的理解吧。

注意:烧写时,sw1拨位为0111,启动时拨位应该为0000

使用codewarrior来烧写.

创建SRAM程序,debug测试一下

创建flash programmer

打开flash file to target

image

检查以下选项

image

点击connection的edit

image

检查initialization和memory的tcl和mem

image

附烧录的tcl文件,我是将flash映射的地址改成了0xF8000000,其他基本没变

########################################################################################

# Initialization file for P1020RDB-PD board - SRAM

# Clock Configuration:

# CPU0: 800 MHz, CPU1:800 MHz, CCB: 400 MHz,

# DDR: 667 MHz, SYSCLK: 100 MHz

########################################################################################

variable CCSRBAR 0xff700000

proc CCSR {reg_off} {

global CCSRBAR

return p:0x[format %x [expr {$CCSRBAR + $reg_off}]]

}

proc apply_e500v2_workaround {} {

# After reset, e500 cores need to run before being able to enter debug mode.

# Work-around: set a HW BP at reset address and run the core; after the core hits the BP, it enters debug mode

# e500 cores need to have valid opcode at the interrupt vector

variable SPR_GROUP "e500 Special Purpose Registers/"

#######################################################################

# Set a breakpoint at the reset address

reg ${SPR_GROUP}IAC1 = 0xfffffffc

reg ${SPR_GROUP}DBCR0 = 0x40800000

reg ${SPR_GROUP}DBCR1 = 0x00000000

# Run the core

config runcontrolsync off

go

wait 50

config runcontrolsync on

stop

# Clear affected registers

# Claer TRAP,IAC1,IAC2,DAC1R,DAC1W,DAC2R,DAC2W debug events label

reg ${SPR_GROUP}DBSR = 0x01CF0000

# Internal debug mode(IDM=1),TRAP=1

reg ${SPR_GROUP}DBCR0 = 0x41000000

# Instruction Address Compare with 0x0

reg ${SPR_GROUP}IAC1 = 0x00000000

reg ${SPR_GROUP}CSRR0 = 0x00000000

reg ${SPR_GROUP}CSRR1 = 0x00000000

}

proc init_board {} {

global CCSRBAR

# bits 4-7 - ROM_LOC

# 1000 Local bus FCM 8-bit NAND flash small page

# 1010 Local bus FCM 8-bit NAND flash large page

# 1101 Local bus GPCM 8-bit ROM

# 1110 Local bus GPCM 16-bit ROM

# 1111 Local bus GPCM 16-bit ROM (default)

# using PORBMSR registers from Global Utilities

variable ROM_LOC 0x[format %x [expr {[mem [CCSR 0xe0004] -np] & 0x0f000000}]]

variable FCM_SMALL_PAGE_BOOT_LOC "0x08000000"

variable FCM_LARGE_PAGE_BOOT_LOC "0x0A000000"

variable GPCM_8BIT_BOOT_LOC "0x0D000000"

<
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值