📄 c2xx_bpx.lst
字号:
81 ; PRIVATE DECLARATIONS
82 ;*******************************************************************************
83
84 0080 BUFFER_SIZE .set 128 ;Size of program buffer size
85 ;Can be increased based available
86 ;memory
87
88 ffff DEVICE_SIZE .set 0ffffh ;Size of device to be programmed.
89 ;Default is maximum address range for
90 ;the F2xx
91
92 ;*******************************************************************************
93 ; Define the PRG_parm section
94 ;*******************************************************************************
95 0000 .sect "PRG_parm" ;Actual location in memory defined is
96 0000 PARMS: ;linker command file
97 0000 0000+ PRG_bufaddr .word PrgBuffer ;Address of buffer for program
98 0001 0080 PRG_bufsize .word BUFFER_SIZE ;Tells host of buffer size
99 0002 ffff PRG_devsize .word DEVICE_SIZE ;Tells host of device size
100
101 * ;The following parameters will be redefined by
102 * ;PRG2xxw based on the flashcode.out
103 ;Algorithm Array variables
104 0003 0000 PRG_paddr .word 0 ;First address to program
105 0004 0000 PRG_page .word 0 ;Page to program
106 0005 0000 PRG_length .word 0 ;Length of block to program
107 0006 0000 PRG_status .word 0 ;Status of programming functions
108 0007 0000 Temp .word 0 ;Temp location for verify
109 0008 ff00 PROTECT .word 0FF00h ;Enable all 8 segments
110
111
112 ;*******************************************************************************
113 ; Define the PRG_data section
114 ;*******************************************************************************
115 0000 .sect "PRG_data" ;Flash code data buffer
116 0000 PrgBuffer .space BUFFER_SIZE*16 ;Initializes buffer for program data
117 0000 .sect "ary_var" ; Initialize buffer to 0x0000
118 0000 .space 16*16
119 ;
120 ;*******************************************************************************
121 ; Define the PRG_text section
122 ;*******************************************************************************
123 0000 .sect "PRG_text" ; Control and algorithm module
124
125 ;*******************************************************************************
126 ; Name: PRG_init
127 ;
128 ; Description
129 ; Initialize the F2xx device for programming
130 ;
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Sun May 6 00:03:29 2001
Copyright (c) 1987-1999 Texas Instruments Incorporated
c2xx_bpx.asm PAGE 10
131 ; Inputs
132 ; None
133 ; Outputs
134 ; int PRG_status Pass =0; Fail = 1;
135 ;
136 ; Notes: Can be used to include device specific initialization before executing
137 ; Flash algorithms in PRG_erase,PRG_program, PRG_verify and PRG_stop
138 ;
139 ;*******************************************************************************
140
141 0000 bce0 PRG_init: LDP #0E0h
142 0001 ae18 SPLK #PLL_RATIO_CONST,7018h
0002 0200
143 0003 ae19 SPLK #000bh,7019h
0004 000b
144 0005 ae29 SPLK #6fh,7029h
0006 006f
145
146 0007 bc00+ ldp #PARMS ; Defines data page
147 0008 ae06+ splk #0,PRG_status
0009 0000
148 000a ae74+ splk #0,ERROR
000b 0000
149 000c 7980 b PRG_stop
000d 0035+
150 ;
151 ;*******************************************************************************
152 ; Name: PRG_program
153 ;
154 ; Description
155 ; Transfers a block of data from RAM to Flash/programmable memory
156 ; PRG2xxw will execute this after PRG_init by default. If the command
157 ; line does not have any options -e or -v.
158 ; If the option specified is -e then the execution sequence will be:
159 ; PRG_init > PRG_erase > PRG_program and then PRG_stop
160 ; If the option specified is -v, then the execution sequence will be:
161 ; PRG_init > PRG_program, PRG_verify and then PRG_stop
162 ; Inputs
163 ; unsigned *PRG_paddr Pointer to first address to program
164 ; unsigned PRG_page Page to program, Program == 0, Data == 1
165 ; unsigned PRG_length Number of words to program
166 ; unsigned *PRG_bufaddr Pointer to program data buffer
167 ;
168 ; Outputs
169 ; int PRG_status Pass =0; Fail = 1;
170 ;
171 ; Notes:
172 ; The PRG_page value is setup by the host but not used in this case.
173 ; The assumption is that the programmable device is in program space.
174 ;*******************************************************************************
175
176 000e PRG_program:
177 000e bce0 LDP #0E0h
178 000f ae18 SPLK #PLL_RATIO_CONST,7018h
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Sun May 6 00:03:29 2001
Copyright (c) 1987-1999 Texas Instruments Incorporated
c2xx_bpx.asm PAGE 11
0010 0200
179 0011 ae19 SPLK #000bh,7019h
0012 000b
180 0013 ae29 SPLK #6fh,7029h
0014 006f
181
182
183 0015 bc00+ ldp #PARMS ;Point to data page
184 0016 1003+ LACC PRG_paddr
185 0017 bc00 LDP #0
186 0018 9068 SACL FL_SECST ;FIRST ADDRESS OF FLASH SEGMENT
187 0019 a860 BLDD #FL_SECST,ADDR ;ADDR -> START OF SECTOR
001a 0068
188 001b ae70 SPLK #0fh,SECTOR ;SECTOR KEY
001c 000f
189
190 001d bc00+ LDP #PARMS
191 001e 1000+ LACC PRG_bufaddr
192 001f bc00 LDP #0
193 0020 907a SACL DATA0
194 0021 bc00+ LDP #PARMS
195 0022 1005+ LACC PRG_length
196 0023 bc00 LDP #0
197 0024 9069 SACL FL_SECEND ;# OF DATA WORDS IN DATA BLOCK
198 0025 7a80 CALL PROGRAM ;PROGRAM SECTOR 1
0026 0000+
199
200
201 0027 ae06+ splk #0,PRG_status ;update algorithm status
0028 0000
202 0029 7980 b PRG_stop ;Branch to stop
002a 0035+
203
204
205 ;*******************************************************************************
206 ; Name: PRG_erase
207 ;
208 ; Description
209 ; Erase a programmed device. This module will be executed if the PRG2xxw
210 ; command line option specified is -e.
211 ; Inputs
212 ; None:
213 ;
214 ; Outputs
215 ; int PRG_status Pass =0; Fail = 1;
216 ;
217 ; Notes:
218 ; The erase is device specific.
219 ;*******************************************************************************
220
221 002b PRG_erase:
222 002b bc00+ err1: ldpk PRG_status
223 002c ae06+ splk #1,PRG_status; Error in CLEAR or Erase
002d 0001
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Sun May 6 00:03:29 2001
Copyright (c) 1987-1999 Texas Instruments Incorporated
c2xx_bpx.asm PAGE 12
224 002e 7980 b PRG_stop
002f 0035+
225
226 ;
227 ;*******************************************************************************
228 ; Name: PRG_verify
229 ;
230 ; Description
231 ; Verify a block of programmed data. This module will be excuted if the
232 ; command line option in PRG2xxw is -v.
233 ;
234 ; Inputs Defined by host
235 ; unsigned *PRG_paddr Pointer to first address to verify
236 ; unsigned PRG_page Page to verify, Program == 0, Data == 1
237 ; unsigned PRG_length Number of words to verify
238 ; unsigned *PRG_bufaddr Pointer to verify data buffer
239 ;
240 ; Outputs
241 ; int PRG_status Pass =0; Fail = 1;
242 ;
243 ; Notes:
244 ; The PRG_page value is setup by the host but not used in this case.
245 ; The assumption is that the programmable device is in program space.
246 ;*******************************************************************************
247
248 0030 PRG_verify:
249 0030 bc00+ ldp #PARMS
250 0031 ae06+ err2: splk #1,PRG_status ;
0032 0001
251 0033 7980 b PRG_stop ;Generate a breakpoint
0034 0035+
252
253 ;*******************************************************************************
254 ; Name: PRG_stop
255 ;
256 ; Description
257 ; Exit routine for all programming functions.
258 ;
259 ; Inputs
260 ; None
261 ;
262 ;
263 ; Outputs
264 ; None
265 ;
266 ; Notes:
267 ; Exit point for all programming functions
268 ; The ESTOP opcode gets executed as a NOP when not in emulation
269 ; mode. The "b $" will keep the program from running off if
270 ; not in emulation mode.
271 ;
272 ;*******************************************************************************
273 0035 PRG_stop:
274
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Sun May 6 00:03:29 2001
Copyright (c) 1987-1999 Texas Instruments Incorporated
c2xx_bpx.asm PAGE 13
275 0035 8b00 nop
276 0036 be90 .word 0BE90h ;SWI instruction
277 0037 8b00 nop
278 0038 7980 b $
0039 0038+
279 .end
No Errors, No Warnings
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -