📄 reset.s
字号:
;/*
;*********************************************************************************************************
;* File Name:Reset.s
;* Description: 完成上电时的设置.
;* Author: kaka (sn.kaka@yahoo.com).
;*********************************************************************************************************
;*/
IMPORT __main
IMPORT InitStack
IMPORT InitClock
IMPORT InitMemory
IMPORT InitCPU
IMPORT InitPort
IMPORT InitUart
IMPORT InitInt
IMPORT Init_Timer5
IMPORT RStartup
EXPORT HandlerReset
;set the WTCON =0x01d30000
;a Global variable
WTCON EQU 0x01d30000 ;//设置全局变量 WTCON =0x01d30000
;
INTMSK EQU 0x01e0000c
BDIDES0 EQU 0x01f80008 ; BDMA destination register.
BDIDES1 EQU 0x01f80028
EXPORT HandlerReset
AREA Resetfun,CODE,READONLY
CODE32
HandlerReset ; Disable Watchdog
LDR R0, =WTCON ; //关掉看门狗
LDR R1, =0x00
STR R1, [R0]
LDR R0, =INTMSK ; Mask the all interrupt source
LDR R1, =0x07ffffff ; //屏蔽 所有中断
STR R1, [R0]
; Init Memory Controller.
;you can find it in initmemory.s
BL InitMemory ; //初始化内存控制其
;//在文件initmemory.s中
; Init the stack
BL InitInt ;//初始化中断控制器
BL InitStack ; //初始化堆栈邋(各种模式下的 )
BL InitPort ; //初始化邋I/O 口
; Init the port ,such as SDRAM interface
; Set the system clock .such as PLL
BL InitClock ; //设置系统时钟,在文件中
;//我写了一个小程序,可以很方便的
;//设置系统在不同时钟频率下要达到
;//某一个特定频率的PLL 在程序包中可以找到
BL InitUart ;//init UART
; Init the CPU Wrapper, and the cache
BL InitCPU ; //初始化 cache
LDR R0, =BDIDES0 ; Must do it by the datasheet
LDR R1, =0x40000000 ; BDIDESn reset value should be 0x40000000
STR R1, [R0]
LDR R0, =BDIDES1
LDR R1, =0x40000000 ; BDIDESn reset value should be 0x40000000
STR R1, [R0]
;//==================================================
B __main ;//利用关键字_main()跳转到
;//main(void){},省掉了我们自己写
;//程序将RW 和ZI段的搬运工作
;jump to the main(void){}
;/*
;*********************************************************************************************************
END
;*********************************************************************************************************
;*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -