建了一个循环点灯的BIOS小工程,成功bootload到IRAM,实现循环点灯。现在想把这个点灯工程bootload到SDRAM里,我把Memory Section manager里的配置改成图中所示:
EMIF的配置为:
;EMIF Register Addresses for c671x family
EMIF_GCTL .equ 0x01800000 ;EMIF global control
EMIF_CE1 .equ 0x01800004 ;address of EMIF CE1 control reg.
EMIF_CE0 .equ 0x01800008 ;EMIF CE0control
EMIF_CE2 .equ 0x01800010 ;EMIF CE2control
EMIF_CE3 .equ 0x01800014 ;EMIF CE3control
EMIF_SDRAMCTL .equ 0x01800018 ;EMIF SDRAM control
EMIF_SDRAMTIM .equ 0x0180001c ;EMIF SDRAM timer
EMIF_SDRAMEXT .equ 0x01800020 ;EMIF SDRAM extension
; EMIF Register Values specifically for 6713 DSK
EMIF_GCTL_V .equ 0x00000078 ;
EMIF_CE0_V .equ 0xffffff23 ;EMIF CE0 SDRAM
EMIF_CE1_V .equ 0xffffff13 ;EMIF CE1 Flash 8-bit
EMIF_CE2_V .equ 0xffffbf93 ;EMIF CE2 Daughtercard 32-bit async
EMIF_CE3_V .equ 0xffffff13 ;EMIF CE3 Daughtercard 32-bit async
EMIF_SDRAMCTL_V .equ 0x53115000 ;EMIF SDRAM control
EMIF_SDRAMTIM_V .equ 0x00000578 ;SDRAM timing (refresh)
EMIF_SDRAMEXT_V .equ 0x000a8529 ;SDRAM extended control
复制表内容为:
mvkl copyTable, a3 ; load table pointer
mvkh copyTable, a3
ldw *a3++, b1 ; Load entry point
copy_section_top:
ldw *a3++, b0 ; byte count
ldw *a3++, a4 ; ram start address
nop 3
[!b0] b copy_done ; have we copied all sections?
nop 5
copy_loop:
ldb *a3++,b5
sub b0,1,b0 ; decrement counter
[ b0] b copy_loop ; setup branch if not done
[!b0] b copy_section_top
zero a1
[!b0] and 3,a3,a1
stb b5,*a4++
[!b0] and -4,a3,a5 ; round address up to next multiple of 4
[ a1] add 4,a5,a3 ; round address up to next multiple of 4
;****************************************************************************
; jump to entry point
;****************************************************************************
copy_done:
b .S2 b1
nop 5
转换cmd的内容:
debug\Dsp6713BootLoadSDRAM.out
-a
-memwidth 8
-map Dsp6713BootLoadSDRAM.map
-boot
-bootorg 0x90000400
-bootsection .boot_load 0x90000000
ROMS
{
FLASH: org = 0x90000000, len = 0x33000, romwidth = 8, files = {Dsp6713BootLoadSDRAM.hex}
}
但是重新上电并没有实现bootload到SDRAM里(灯不亮),此时用ccs3.3 的memory窗口可以看到IRAM前1KB地址范围里内容与Flash前1KB的内容一样,但是为什么不亮呢。