|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
编写DSP程序时,由于代码较长,超过片内RAM空间,所以改为烧写flash! Q/ g5 I X" d! F7 D0 l8 i
开始烧写代码,运行程序,结果均正常;然后在此基础上添加一段代码(代码内容类似,没有错误),结果运行程序后,程序跳入非法中断 interrupt void ILLEGAL_ISR(void),不知为何。仅仅是添加一段代码,结果出现非法中断,百思不得其解,请高手指点一下。多谢多谢。
0 U( I+ M: |( V- z( y0 c" X 程序中cmd文件如下:
5 o# D- O3 I' kMEMORY) {4 @& } k- C R% v# w( w, y! a
{0 |( x) z: s9 I s2 }( n# v
PAGE 0: /* Program Memory */' \9 ]7 W5 S& N: }
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
4 y0 `3 ^1 l3 I7 d* q% g6 i0 N, a9 @+ m- P
ZONE0 : origin = 0x004000, length = 0x001000 /* XINTF zone 0 */
" K+ T7 K3 p% _4 ]& O RAML0 : origin = 0x008000, length = 0x005000 /* on-chip RAM block L0 */
- W! s& k) f* R0 | /*RAML1 : origin = 0x009000, length = 0x001000*/ /* on-chip RAM block L1 */
+ C) I1 h6 b: D& u! h& k$ Q: o /*RAML2 : origin = 0x00A000, length = 0x001000*/ /* on-chip RAM block L2 */
7 h* O! I1 f; u% j( r /*RAML3 : origin = 0x00B000, length = 0x001000*/ /* on-chip RAM block L3 */( ~! e6 r9 U! C. _3 M: ^
ZONE6 : origin = 0x0100000, length = 0x100000 /* XINTF zone 6 */! v1 y- ^7 J7 g. |* Z
ZONE7A : origin = 0x0200000, length = 0x00FC00 /* XINTF zone 7 - program space */
: {5 o% m! `; B$ \) [ FLASHH : origin = 0x300000, length = 0x008000 /* on-chip FLASH */' R, R0 X4 |' z% K
/*FLASHG : origin = 0x308000, length = 0x008000*/ /* on-chip FLASH */
2 K: t/ o$ y9 d6 R, T /*FLASHF : origin = 0x310000, length = 0x008000*/ /* on-chip FLASH */& F' l" h( z7 c3 o3 G b
/*FLASHE : origin = 0x318000, length = 0x008000*/ /* on-chip FLASH */9 b4 ^/ S3 [9 h! `4 e1 ]! u
/*FLASHD : origin = 0x320000, length = 0x008000*/ /* on-chip FLASH */
$ }6 a* e8 w+ i: Q/ a. l /*FLASHC : origin = 0x328000, length = 0x008000*/ /* on-chip FLASH */
' f$ E# S. K) h7 m FLASHA : origin = 0x308000, length = 0x012000 /* on-chip FLASH */
' O/ m/ n9 ]9 d1 H* X) H6 X CSM_RSVD : origin = 0x33fF80, length = 0x000076 /* Part of FLASHA. Program with all 0x0000 when CSM is in use. */
! b1 `6 _8 E! a: H7 B BEGIN : origin = 0x33FFF6, length = 0x000002 /* Part of FLASHA. Used for "boot to Flash" bootloader mode. */
5 P; B- n% G1 W' C$ B CSM_PWL : origin = 0x33FFF8, length = 0x000008 /* Part of FLASHA. CSM password locations in FLASHA */$ f A6 |' k9 S& ^9 y2 Q% ?
OTP : origin = 0x380400, length = 0x000400 /* on-chip OTP */( t f7 W" a) L# Q# P, I
ADC_CAL : origin = 0x380080, length = 0x000009 /* ADC_cal function in Reserved memory */
8 \8 o2 j8 G) }
# U4 [: Y9 g0 p9 O# R) D IQTABLES : origin = 0x3FE000, length = 0x000b50 /* IQ Math Tables in Boot ROM */7 m s& X0 }0 F3 \7 n* R" c6 Y2 O$ y
IQTABLES2 : origin = 0x3FEB50, length = 0x00008c /* IQ Math Tables in Boot ROM */ + L' F5 a4 @9 F/ K$ a* j
FPUTABLES : origin = 0x3FEBDC, length = 0x0006A0 /* FPU Tables in Boot ROM */; W2 m1 b k' v, S4 f- O$ W% u
ROM : origin = 0x3FF27C, length = 0x000D44 /* Boot ROM */ # e$ | X. H7 d6 L* }1 m
RESET : origin = 0x3FFFC0, length = 0x000002 /* part of boot ROM */
- }& i1 e8 t1 D VECTORS : origin = 0x3FFFC2, length = 0x00003E /* part of boot ROM */ F2 J# Y( h/ N! Z" F8 s
0 b8 o+ N: P( }0 i# ePAGE 1 : /* Data Memory */ L7 E+ N- L9 ^: @. q, e M
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */# O+ Z+ V: X# w, [/ o/ `
/* Registers remain on PAGE1 */& l; H% t7 }6 n
3 c* y# ?0 W! o( O0 \ BOOT_RSVD : origin = 0x000000, length = 0x000050 /* Part of M0, BOOT rom will use this for stack */$ d1 F+ d) B5 x7 H$ A1 N$ z
RAMM0 : origin = 0x000050, length = 0x0003B0 /* on-chip RAM block M0 */, Y* Z8 r7 o6 N3 H: ~/ d5 t6 S
RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */
) p, ^% X+ K0 l /*RAML4 : origin = 0x00C000, length = 0x001000*/ /* on-chip RAM block L1 */- W; M$ D' x. H9 ~) U1 V5 b% Z+ t9 [
RAML5 : origin = 0x00D000, length = 0x001000 /* on-chip RAM block L1 */8 k. L, \" k- ]* \6 ~& _
RAML6 : origin = 0x00E000, length = 0x001000 /* on-chip RAM block L1 */# P# g, ^1 t o6 I
RAML7 : origin = 0x00F000, length = 0x001000 /* on-chip RAM block L1 */0 S l, ]. H9 U" Q8 _
ZONE7B : origin = 0x20FC00, length = 0x000400 /* XINTF zone 7 - data space */
( y7 l/ s; H4 n, e/ |1 O# g% ^ ZONE7A : origin = 0x210000, length = 0x010000
8 r4 i/ a4 q0 N7 l9 ?3 { /*FLASHB : origin = 0x330000, length = 0x008000*/ /* on-chip FLASH */
' Q5 u9 {8 H8 N% j# e}
( M1 J3 a; w; @
$ V+ c% x( y) l0 v/* Allocate sections to memory blocks.
+ D+ M# w' w, D5 E! {# e6 J Note:
7 {2 K7 K& _: R, w codestart user defined section in DSP28_CodeStartBranch.asm used to redirect code
" D1 n2 u( R1 K/ ~ execution when booting to flash0 C4 Z8 j& C: u4 l
ramfuncs user defined section to store functions that will be copied from Flash into RAM
|& G0 J, J5 q( G4 e3 r*/
, w& `6 C, Y+ a1 O0 { ?+ d* Q& V+ D* Q9 X) Q
SECTIONS0 U+ d. R0 \" g- I" `; c4 x* U
{. G/ V! Z2 U8 F8 K
' n/ M. b9 ~% O. Z& R7 |% o9 G& o
/* Allocate program areas: */# e. f7 J' O2 q4 g- d* s
.cinit : > FLASHA PAGE = 09 Z! a$ T5 \0 K* X L
.pinit : > FLASHA, PAGE = 0; B( N0 G$ C. p# E) R6 V0 D
.text : > FLASHA PAGE = 0: V& @. f7 A1 b7 c! P C9 C
codestart : > BEGIN PAGE = 0
5 h# g% X: k& u$ X# G! M ramfuncs : LOAD = FLASHA,
& k4 d4 E7 b6 j5 _# n RUN = RAML0,
' b W8 d$ R, u. X& m4 ` LOAD_START(_RamfuncsLoadStart),- M1 @2 H# N c5 i! g
LOAD_END(_RamfuncsLoadEnd),
3 ]$ _3 _6 }' r RUN_START(_RamfuncsRunStart),# u7 {1 c+ v5 v( R- s! Z
PAGE = 0
' C" J+ @6 P8 q8 o
8 Y3 [% p& A* n1 W0 O1 B csmpasswds : > CSM_PWL PAGE = 0
/ k* w3 y3 ~5 n$ k" S& U9 |6 H3 F csm_rsvd : > CSM_RSVD PAGE = 0
. ~$ x. H. W# [2 p G
/ j$ v9 y9 j5 Z# U /* Allocate uninitalized data sections: */
C9 |# o: j/ t .stack : > RAMM1 PAGE = 1
+ K" K) @5 H& Y u8 k" ?. b .ebss : > RAML5 PAGE = 1
* P' I: P1 ^- S0 \* l2 Q .esysmem : > RAMM1 PAGE = 1
- h3 |) y' w0 X" O- Q* O- x$ ~, ]! W" K8 J [3 u+ P
/* Initalized sections go in Flash */
: y7 S: E0 i' E /* For SDFlash to program these, they must be allocated to page 0 */; D6 s, J6 D/ S1 L" A
.econst : > FLASHA PAGE = 0& s. R6 j8 K0 P/ @ s- f
.switch : > FLASHA PAGE = 0 + b' n8 L- V: j; p
% r; Q/ S! m: M j /* Allocate IQ math areas: */
) ] {: j5 w, {6 B- L IQmath : > FLASHA PAGE = 0 /* Math Code */
8 Y2 m) P4 N8 w. ]4 Y! m( K IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD
; w$ m+ c6 L& X" G1 m IQmathTables2 : > IQTABLES2, PAGE = 0, TYPE = NOLOAD
' L7 x% }1 d% F0 l9 {" J FPUmathTables : > FPUTABLES, PAGE = 0, TYPE = NOLOAD
+ g1 ]0 G5 T' J% t/ w2 F/ p) ?9 l
/* Allocate DMA-accessible RAM sections: */
6 R# x6 {3 W; ~ DMARAML4 : > RAML5, PAGE = 19 Y% [& r! w6 A8 e9 o
DMARAML5 : > RAML5, PAGE = 1! y5 D# e' k) g
DMARAML6 : > RAML6, PAGE = 1* ]3 [' U9 l+ h; D: M! O, q
DMARAML7 : > RAML7, PAGE = 1
2 V9 X I ]0 S6 J( h4 p/ s
8 W! d* t6 m9 _( {+ q8 w /* Allocate 0x400 of XINTF Zone 7 to storing data */
t2 ]# M v; ^, J! G2 P& f data : > ZONE7A, PAGE = 18 C! n7 _1 H2 c2 r8 Z
ZONE7DATA : > ZONE7B, PAGE = 1
. f4 D) D B( k; n) `" O9 _; d% U1 P/ l# F6 B0 e; o; @' |
/* .reset is a standard section used by the compiler. It contains the *// A6 ]) p% ?. R* {4 m
/* the address of the start of _c_int00 for C Code. /*
/ f' u5 E x, {8 E, K4 O /* When using the boot ROM this section and the CPU vector */0 ?; W; [" u+ q
/* table is not needed. Thus the default type is set here to */# C; r3 L) s! K/ I" }/ u9 ?6 o; m, T
/* DSECT */" @5 n1 f" w0 @% u, B
.reset : > RESET, PAGE = 0, TYPE = DSECT1 W; A% y+ Q% R& ?. [
vectors : > VECTORS PAGE = 0, TYPE = DSECT
M$ a3 l( x* f; e7 d/ w
6 R, B3 I5 X: }" s. M' j4 T /* Allocate ADC_cal function (pre-programmed by factory into TI reserved memory) */
* k; ^6 j4 n$ S' o" Y .adc_cal : load = ADC_CAL, PAGE = 0, TYPE = NOLOAD: c- Z; k$ r" \/ T4 A! \% o% B
& J% L1 t+ n( ]; P3 j}
( o# C3 h( h9 v! w% q) e3 \3 A |
|