This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
DSP281X的CodeStartBranch.asm
是Boot的一部分 引导作用
;//########################################################################### |
02 |
;// |
03 |
;// FILE: DSP281x_CodeStartBranch.asm |
04 |
;// |
05 |
;// TITLE: Branch for redirecting code execution after boot. |
06 |
;// |
07 |
;//########################################################################### |
08 |
;// |
09 |
;// Ver | dd mmm yyyy | Who | Description of changes |
10 |
;// =====|=============|======|=============================================== |
11 |
;// 1.00| 11 Sep 03 | L.H. | Updated based on D.A source to allow |
12 |
;// | | | disabling the watchdog before branching to |
13 |
;// | | | the C init routine. This is useful if the |
14 |
;// | | | watchdog is timing out before main() is reached. |
15 |
;//########################################################################### |
16 |
|
17 |
|
18 |
*********************************************************************** |
19 |
|
20 |
WD_DISABLE .set 1 ;set to 1 to disable WD, else set to 0 |
21 |
|
22 |
.ref _c_int00 |
23 |
|
24 |
*********************************************************************** |
25 |
* Function: codestart section |
26 |
* |
27 |
* Description: Branch to code starting point |
28 |
*********************************************************************** |
29 |
|
30 |
.sect "codestart" |
31 |
|
32 |
code_start: |
33 |
.if WD_DISABLE == 1 |
34 |
LB wd_disable ;Branch to watchdog disable code |
35 |
.else |
36 |
LB _c_int00 ;Branch to start of boot.asm in RTS library |
37 |
.endif |
38 |
|
39 |
;end codestart section |
40 |
|
41 |
|
42 |
*********************************************************************** |
43 |
* Function: wd_disable |
44 |
* |
45 |
* Description: Disables the watchdog timer |
46 |
*********************************************************************** |
47 |
.if WD_DISABLE == 1 |
48 |
|
49 |
.text |
50 |
wd_disable: |
51 |
SETC OBJMODE ;Set OBJMODE for 28x object code |
52 |
EALLOW ;Enable EALLOW protected register access |
53 |
MOVZ DP, #7029h>>6 ;Set data page for WDCR register |
54 |
MOV @7029h, #0068h ;Set WDDIS bit in WDCR to disable WD |
55 |
EDIS ;Disable EALLOW protected register access |
56 |
LB _c_int00 ;Branch to start of boot.asm in RTS library |
57 |
|
58 |
.endif |
59 |
|
60 |
;end wd_disable |
61 |
|
62 |
|
63 |
|
64 |
.end |
65 |
|
66 |
; end of file CodeStartBranch.asm |
bootloader 与CodeStartBranch有点类似物流系统与收货方的关系,bootloader 会根据不同的引导模式进行相应的操作。如果是flash与ram模式就会比较简单,bootloader会比较直接地引导到CodeStartBranch,而其他模式则会比较曲折,类似经过一些“中转站”。所以,CodeStartBranch应该只是bootloader 的最终入口,与bootloader机制并不具有严格的包含关系。当然,如果把概念放大一些,也是可以作为一部分的。看你的个人理解了。