|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
编写DSP程序时,由于代码较长,超过片内RAM空间,所以改为烧写flash
+ p3 g2 J: y& ~ 开始烧写代码,运行程序,结果均正常;然后在此基础上添加一段代码(代码内容类似,没有错误),结果运行程序后,程序跳入非法中断 interrupt void ILLEGAL_ISR(void),不知为何。仅仅是添加一段代码,结果出现非法中断,百思不得其解,请高手指点一下。多谢多谢。7 Y, u* _+ c1 _/ T: p
程序中cmd文件如下:* ^$ U% v$ ~8 E5 T' `
MEMORY
( y, j) S, c* Q& ?( u1 k{
8 y1 s" \* S' ~# m, j VPAGE 0: /* Program Memory */5 q! P1 D% v; P1 B0 `% B, N
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */+ N; M2 m6 k% q- v/ z* h! I
* k% d4 Y# r9 _( a( u9 k8 a( \# q
ZONE0 : origin = 0x004000, length = 0x001000 /* XINTF zone 0 */. K1 K) @) O. z- V) W) {' H& W) _
RAML0 : origin = 0x008000, length = 0x005000 /* on-chip RAM block L0 */$ Y+ D6 [* t! B9 s' f5 ?
/*RAML1 : origin = 0x009000, length = 0x001000*/ /* on-chip RAM block L1 */# H6 j! J, G$ c+ ~1 G% c
/*RAML2 : origin = 0x00A000, length = 0x001000*/ /* on-chip RAM block L2 */
2 D) H% X- T& h/ S /*RAML3 : origin = 0x00B000, length = 0x001000*/ /* on-chip RAM block L3 */2 a4 `# W" z/ F: M4 O
ZONE6 : origin = 0x0100000, length = 0x100000 /* XINTF zone 6 */
7 [5 W7 U* F( Q J ZONE7A : origin = 0x0200000, length = 0x00FC00 /* XINTF zone 7 - program space */
! P; C1 Y( w: D; ~9 R FLASHH : origin = 0x300000, length = 0x008000 /* on-chip FLASH */' [ v* t$ P& M1 G0 D+ k/ k5 c
/*FLASHG : origin = 0x308000, length = 0x008000*/ /* on-chip FLASH */
) L+ f/ O: a7 b! E* N4 m5 S) ^ /*FLASHF : origin = 0x310000, length = 0x008000*/ /* on-chip FLASH */
! ~6 x) t( d( g1 O( k, h5 c, s% C! e; Z! a /*FLASHE : origin = 0x318000, length = 0x008000*/ /* on-chip FLASH */; X3 Y: ^# I1 `! q
/*FLASHD : origin = 0x320000, length = 0x008000*/ /* on-chip FLASH */5 N, S9 _; K |( _2 _2 D
/*FLASHC : origin = 0x328000, length = 0x008000*/ /* on-chip FLASH */
0 T& V; e# R# t0 N) G- y FLASHA : origin = 0x308000, length = 0x012000 /* on-chip FLASH */
; z+ {/ b" Z$ @$ ]- `' q* [ CSM_RSVD : origin = 0x33fF80, length = 0x000076 /* Part of FLASHA. Program with all 0x0000 when CSM is in use. */) |1 P4 U7 \1 c6 @. P# H
BEGIN : origin = 0x33FFF6, length = 0x000002 /* Part of FLASHA. Used for "boot to Flash" bootloader mode. */
2 z8 ]* }7 S5 ]* J6 p3 u4 o& l CSM_PWL : origin = 0x33FFF8, length = 0x000008 /* Part of FLASHA. CSM password locations in FLASHA */4 r9 f, F0 b; S9 L
OTP : origin = 0x380400, length = 0x000400 /* on-chip OTP */
4 s H3 K7 ?6 u, l. B ADC_CAL : origin = 0x380080, length = 0x000009 /* ADC_cal function in Reserved memory */4 r( _* F' @+ x
6 Y0 b, ~; F, p8 K IQTABLES : origin = 0x3FE000, length = 0x000b50 /* IQ Math Tables in Boot ROM */8 ^' s q6 _# ^ [: J& t
IQTABLES2 : origin = 0x3FEB50, length = 0x00008c /* IQ Math Tables in Boot ROM */
/ f3 z: _3 ]+ K! v( D FPUTABLES : origin = 0x3FEBDC, length = 0x0006A0 /* FPU Tables in Boot ROM */+ v& S6 c# \& U) X- O
ROM : origin = 0x3FF27C, length = 0x000D44 /* Boot ROM */
# S9 m$ Q0 I& \# } RESET : origin = 0x3FFFC0, length = 0x000002 /* part of boot ROM */% n5 Z( `0 M+ X
VECTORS : origin = 0x3FFFC2, length = 0x00003E /* part of boot ROM */
* g; f( f' c q& O- U- T3 V" V1 D9 r4 u; e& k- e
PAGE 1 : /* Data Memory */
, S# L* X& P+ j* [: f: h: l /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */7 B @* S2 P/ c# X& ^0 S" |3 B. ?2 Y
/* Registers remain on PAGE1 */
5 N: O: [) v( J$ ^2 A( Q9 A/ o j" G% n8 l
BOOT_RSVD : origin = 0x000000, length = 0x000050 /* Part of M0, BOOT rom will use this for stack */8 `4 m" U! R# D! e
RAMM0 : origin = 0x000050, length = 0x0003B0 /* on-chip RAM block M0 */2 S: P( l6 \8 r/ O; Z. B% T
RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */
( A; J; m4 J& `: j- G /*RAML4 : origin = 0x00C000, length = 0x001000*/ /* on-chip RAM block L1 */) I" n7 e) m% ]7 V7 o( B0 W
RAML5 : origin = 0x00D000, length = 0x001000 /* on-chip RAM block L1 */1 {% a( l1 X5 v+ H4 E
RAML6 : origin = 0x00E000, length = 0x001000 /* on-chip RAM block L1 */
- O4 W+ C& K# l RAML7 : origin = 0x00F000, length = 0x001000 /* on-chip RAM block L1 */$ h8 R2 [& U) r" J+ r+ l0 a( B
ZONE7B : origin = 0x20FC00, length = 0x000400 /* XINTF zone 7 - data space */
+ x; Y/ V9 S& z1 @3 U! g$ f, W3 Z ZONE7A : origin = 0x210000, length = 0x010000* V+ z- G+ _6 g5 R: P
/*FLASHB : origin = 0x330000, length = 0x008000*/ /* on-chip FLASH */
' K5 I1 g. r+ `}
: k1 v5 j( Z6 k. L8 C3 h& a j4 y5 Z% }6 T) Z3 w& R6 S
/* Allocate sections to memory blocks.
" E; n; y5 M" J% [ Note:; F1 p" e9 b: w- G O' L$ {
codestart user defined section in DSP28_CodeStartBranch.asm used to redirect code; j" ?) J, X y- N7 m
execution when booting to flash
( f7 \% Z) L4 f1 @. I. |* i S ramfuncs user defined section to store functions that will be copied from Flash into RAM/ W' C1 p) ^$ u% O2 w8 O; I
*/' G0 ~" a% a; \, n* B
; D7 I% j0 @8 DSECTIONS
1 G ?* h9 f- [* W7 G" P( Q{
' B% c& v7 `$ j- X; W/ k1 U' q1 w8 M) {7 e
/* Allocate program areas: */
; ?7 T7 o1 {' P: W, F .cinit : > FLASHA PAGE = 0
# B. V% A0 R5 b5 P0 A .pinit : > FLASHA, PAGE = 0
4 `$ z/ g) c5 J" K2 N. h: d .text : > FLASHA PAGE = 0! y: d# [3 U4 ~2 s$ j) n& r& B3 ?
codestart : > BEGIN PAGE = 0& ]2 k5 T' F Q. U8 Q# k6 e- |; t
ramfuncs : LOAD = FLASHA,
) ~' ?& z4 r( a RUN = RAML0,
9 N% C0 b7 _3 t LOAD_START(_RamfuncsLoadStart),
8 O& d8 s$ P8 x+ t1 _ LOAD_END(_RamfuncsLoadEnd),
+ G2 J" y, b& _. b* f' t RUN_START(_RamfuncsRunStart),
0 w' h, x4 U7 n' N' K; g9 d PAGE = 0
$ T( S( w, t( D2 g W" F: m1 S" l6 _) \
csmpasswds : > CSM_PWL PAGE = 00 E1 t; B% I: ~, \. {; Q" w9 J
csm_rsvd : > CSM_RSVD PAGE = 07 ^# z/ l3 h4 V% W) A4 J4 d2 C
! s% d; N0 n7 x! c7 K6 q /* Allocate uninitalized data sections: */' _! p1 i( z h, G- _% S2 E. n
.stack : > RAMM1 PAGE = 1
7 z) {1 B' x5 ^! D1 `$ @: w .ebss : > RAML5 PAGE = 1
D6 R+ @4 L9 u X4 f* L .esysmem : > RAMM1 PAGE = 1
2 }. ^) N- G; W: w" z6 l
# x& |& @6 ?' G4 E! m( Y /* Initalized sections go in Flash */3 y/ d, j0 P% X. W0 J
/* For SDFlash to program these, they must be allocated to page 0 */
& u& W3 G2 q6 k9 ?0 \! M .econst : > FLASHA PAGE = 0, I" g- u, H& H- H4 P
.switch : > FLASHA PAGE = 0
" O# N" k: N" T$ Q" ~& Y( L7 f# r* C1 m- R H
/* Allocate IQ math areas: */
' t6 c; H9 k3 c5 K1 [" p IQmath : > FLASHA PAGE = 0 /* Math Code *// x8 o. x* l/ n
IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD$ F, y3 k& C7 M- p0 R
IQmathTables2 : > IQTABLES2, PAGE = 0, TYPE = NOLOAD8 E5 T$ W: u& H& L, \
FPUmathTables : > FPUTABLES, PAGE = 0, TYPE = NOLOAD, j! }$ _! l% b5 v$ q+ I
0 P( M: u! G+ K. M
/* Allocate DMA-accessible RAM sections: */6 l/ C2 R$ ]3 a y
DMARAML4 : > RAML5, PAGE = 1
) j9 l5 r" x' `' J6 w DMARAML5 : > RAML5, PAGE = 12 A/ a; u" Q% x
DMARAML6 : > RAML6, PAGE = 1
6 Z+ T6 a% j- D/ B' P' z ]' y. O DMARAML7 : > RAML7, PAGE = 1
" b* K, w: q* y* j$ X+ a4 ?
% b3 h/ G. R- B0 j /* Allocate 0x400 of XINTF Zone 7 to storing data */7 R* X) b4 I5 F( d
data : > ZONE7A, PAGE = 1: \3 o5 w1 n9 c4 ~' j7 u) T# A
ZONE7DATA : > ZONE7B, PAGE = 1
' ^$ Y4 M& v+ z+ L$ Y
1 x) y, E+ l0 l! C. R1 A" s /* .reset is a standard section used by the compiler. It contains the */+ I" Q# y- I& E3 M0 }2 u
/* the address of the start of _c_int00 for C Code. /*9 w- M9 i/ ~+ L. D# ]
/* When using the boot ROM this section and the CPU vector */
* Z ^6 Y0 y2 x2 ] /* table is not needed. Thus the default type is set here to */
3 y# b4 c' Z8 C+ o0 p /* DSECT */
+ ^& e. ]2 J7 L5 _ C .reset : > RESET, PAGE = 0, TYPE = DSECT- g1 d& R8 n* q& u! V7 W& k
vectors : > VECTORS PAGE = 0, TYPE = DSECT% J: g3 A T$ v" ~
* P M, u* w. B! M% b
/* Allocate ADC_cal function (pre-programmed by factory into TI reserved memory) */
8 b4 a4 Y/ O4 y% f7 f4 s7 ?: V N* F .adc_cal : load = ADC_CAL, PAGE = 0, TYPE = NOLOAD W, M9 e2 T6 w; _% K# i2 G8 L
: P% S# r+ B! F: m0 y1 [}8 Z4 N* O6 E+ s9 {% w
|
|