找回密码
 注册
关于网站域名变更的通知
查看: 548|回复: 4
打印 上一主题 下一主题

DSP 烧写程序 进入非法中断

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2022-1-10 10:36 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

您需要 登录 才可以下载或查看,没有帐号?注册

x
编写DSP程序时,由于代码较长,超过片内RAM空间,所以改为烧写flash
5 Y7 G, }0 _" X6 T, M/ a     开始烧写代码,运行程序,结果均正常;然后在此基础上添加一段代码(代码内容类似,没有错误),结果运行程序后,程序跳入非法中断 interrupt void ILLEGAL_ISR(void),不知为何。仅仅是添加一段代码,结果出现非法中断,百思不得其解,请高手指点一下。多谢多谢。
% V, I1 Y, [3 X% ?1 p  x      程序中cmd文件如下:, X) d7 G3 q+ }- R# [8 U5 e& K  k+ Q
MEMORY
9 U4 V$ w  O) C{
$ h& c& k4 i; I9 D0 [" a1 {+ E* z" CPAGE 0:    /* Program Memory */
; v6 T8 `: e  X" K) ?           /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
* f( D1 Q7 k# m+ l, E8 P
" m" T  }1 ~; H3 _9 z6 Z   ZONE0       : origin = 0x004000, length = 0x001000     /* XINTF zone 0 */
' `' H# D5 k" S, L' l   RAML0       : origin = 0x008000, length = 0x005000     /* on-chip RAM block L0 */
- K5 B* \: Y  W( y! [) ]   /*RAML1       : origin = 0x009000, length = 0x001000*/     /* on-chip RAM block L1 */1 q0 d$ s, j* f) e5 z  H  n
   /*RAML2       : origin = 0x00A000, length = 0x001000*/     /* on-chip RAM block L2 */
$ y" F; Q( U: w   /*RAML3       : origin = 0x00B000, length = 0x001000*/     /* on-chip RAM block L3 */9 M  B* u& Z1 S
   ZONE6       : origin = 0x0100000, length = 0x100000    /* XINTF zone 6 */
  j" y' a1 A& z3 R   ZONE7A      : origin = 0x0200000, length = 0x00FC00    /* XINTF zone 7 - program space */, h- A$ q9 K$ R- I
   FLASHH      : origin = 0x300000, length = 0x008000     /* on-chip FLASH */
6 S6 {4 o: B2 S8 Z9 e) ^   /*FLASHG      : origin = 0x308000, length = 0x008000*/     /* on-chip FLASH */! j; U% G6 Y8 a6 ]2 B/ G6 f
   /*FLASHF      : origin = 0x310000, length = 0x008000*/     /* on-chip FLASH */: p& O# S" o1 z
   /*FLASHE      : origin = 0x318000, length = 0x008000*/     /* on-chip FLASH */# u3 o3 L3 ?8 O
   /*FLASHD      : origin = 0x320000, length = 0x008000*/     /* on-chip FLASH */
/ s" P, H7 ^# ^. a: i2 _   /*FLASHC      : origin = 0x328000, length = 0x008000*/     /* on-chip FLASH */
/ H& G- y' N. i7 N4 |4 s) S   FLASHA      : origin = 0x308000, length = 0x012000     /* on-chip FLASH */
3 {$ h& d. i9 a1 q6 ]8 W% ~0 w! N   CSM_RSVD    : origin = 0x33fF80, length = 0x000076     /* Part of FLASHA.  Program with all 0x0000 when CSM is in use. */) F  i( I( I( F; v- L6 E5 u
   BEGIN       : origin = 0x33FFF6, length = 0x000002     /* Part of FLASHA.  Used for "boot to Flash" bootloader mode. */# P6 y; B" m- ]: w; q. ^
   CSM_PWL     : origin = 0x33FFF8, length = 0x000008     /* Part of FLASHA.  CSM password locations in FLASHA */
* o6 _; e2 J5 J   OTP         : origin = 0x380400, length = 0x000400     /* on-chip OTP */2 K& @* f  |/ |+ Z* m
   ADC_CAL     : origin = 0x380080, length = 0x000009     /* ADC_cal function in Reserved memory */
) r' I4 ]5 l, P
2 B, X& [" y( p: N   IQTABLES    : origin = 0x3FE000, length = 0x000b50     /* IQ Math Tables in Boot ROM */1 q' N' x& }& W: O  m9 N6 D: A
   IQTABLES2   : origin = 0x3FEB50, length = 0x00008c     /* IQ Math Tables in Boot ROM */  
4 z+ R, l" z0 R4 m5 D: A2 O   FPUTABLES   : origin = 0x3FEBDC, length = 0x0006A0     /* FPU Tables in Boot ROM */
# g$ \8 w) B) X+ O9 Q' |6 K   ROM         : origin = 0x3FF27C, length = 0x000D44     /* Boot ROM */        
+ w5 k8 Y3 Z& |   RESET       : origin = 0x3FFFC0, length = 0x000002     /* part of boot ROM  */
7 d$ o5 s6 X% j# y   VECTORS     : origin = 0x3FFFC2, length = 0x00003E     /* part of boot ROM  */$ }. v* m' P2 P+ g% z

# R( Q- y5 Z% A) @; r3 TPAGE 1 :   /* Data Memory */
0 \; f  i0 j# ~/ s. T* G           /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
7 ~2 `7 b5 }7 q6 G9 o: p( Z           /* Registers remain on PAGE1                                                  */& g7 T3 z& K# W! i3 T4 b

- u+ f; K* Y* L/ Z   BOOT_RSVD   : origin = 0x000000, length = 0x000050     /* Part of M0, BOOT rom will use this for stack */
, {, E* A0 }( L+ N/ T+ G, C   RAMM0       : origin = 0x000050, length = 0x0003B0     /* on-chip RAM block M0 */
' R3 {% W. M% H+ y( q6 }   RAMM1       : origin = 0x000400, length = 0x000400     /* on-chip RAM block M1 */
1 A% M& X" {% I% c- o   /*RAML4       : origin = 0x00C000, length = 0x001000*/     /* on-chip RAM block L1 */
7 u& p% G1 z1 A# R! W   RAML5       : origin = 0x00D000, length = 0x001000     /* on-chip RAM block L1 */9 S& ?# p: @* Y
   RAML6       : origin = 0x00E000, length = 0x001000     /* on-chip RAM block L1 */( Z& T$ t6 B/ U! v8 `2 c0 N
   RAML7       : origin = 0x00F000, length = 0x001000     /* on-chip RAM block L1 */
8 x- h6 [% O  C9 Z9 x   ZONE7B      : origin = 0x20FC00, length = 0x000400     /* XINTF zone 7 - data space */
  b1 {6 y4 r1 ]2 t: a4 E" N   ZONE7A      : origin = 0x210000, length = 0x0100002 u" }4 E" o" E) p3 U( P: b. M
   /*FLASHB      : origin = 0x330000, length = 0x008000*/     /* on-chip FLASH */
1 r$ [8 v7 q- i. \; T}+ M4 y* X, Y- z  O) k# B* e

2 R8 K+ `& E% N6 M7 ^& l$ o/* Allocate sections to memory blocks.; `$ z) c5 ?7 g
   Note:5 }+ @" z) {6 U" e8 k
         codestart user defined section in DSP28_CodeStartBranch.asm used to redirect code. p; r+ w9 l/ u; [
                   execution when booting to flash: c7 o* d. ]. o7 N, f; M! O
         ramfuncs  user defined section to store functions that will be copied from Flash into RAM
3 r5 c0 O+ z' \0 z# q' ~) N: J*/% C# x' t- {" r- M: F4 u; b
1 m8 i, O$ C. G5 w$ x. g
SECTIONS
$ q/ B6 g* B: v4 T) y; |{
8 z) {. M/ ?+ x3 u6 A; P5 }9 O3 Z" E: S' w( L
   /* Allocate program areas: */
2 z5 ^+ ?3 Y' H$ C0 E7 O6 b$ g   .cinit              : > FLASHA      PAGE = 0
2 c. V) L2 P8 Q4 J9 L7 ]( t   .pinit              : > FLASHA,     PAGE = 0
& b2 [* W6 u5 Z1 w& A% S8 U8 d; P   .text               : > FLASHA      PAGE = 0
- k$ V% W! O" v7 y: ~* o2 w5 F   codestart           : > BEGIN       PAGE = 0
! a9 b5 h! t6 M( C   ramfuncs            : LOAD = FLASHA,0 F# i+ r* {" d) S
                         RUN = RAML0,+ y& V, _  s8 F2 [4 ~! P/ j
                         LOAD_START(_RamfuncsLoadStart),  t% r3 t5 u# l- R
                         LOAD_END(_RamfuncsLoadEnd),  M" l. d+ F6 M" `1 d, Q
                         RUN_START(_RamfuncsRunStart),+ g* @4 U! P& n, B* `: g1 ]
                         PAGE = 0( W" n+ [- N- F& ~% q

1 `4 ]& O: z! z# h! A4 u   csmpasswds          : > CSM_PWL     PAGE = 0$ g: V, x! [9 k- C
   csm_rsvd            : > CSM_RSVD    PAGE = 0
4 o3 T* f% z6 y5 M  [
$ T  d2 }! U" q& u8 n. e. t0 f2 x   /* Allocate uninitalized data sections: */
! H* S+ D6 \  T+ V   .stack              : > RAMM1       PAGE = 1+ Y+ E4 t4 ]0 Z" g0 F/ y
   .ebss               : > RAML5       PAGE = 1
9 @9 Q" C. |$ \3 P! j   .esysmem            : > RAMM1       PAGE = 1: x3 }8 X- z0 Y
" r- [. D; h7 J
   /* Initalized sections go in Flash */
/ b9 [# |6 k/ [. c+ w' j- z" Y   /* For SDFlash to program these, they must be allocated to page 0 */
0 u! F5 f- l3 R0 W7 g/ L6 A* V   .econst             : > FLASHA      PAGE = 00 X0 v. A4 D4 A" P' D/ E2 X3 N0 E5 s6 y
   .switch             : > FLASHA      PAGE = 0      3 o8 T6 M  {- f$ e
' B5 G$ t) E2 \) C
   /* Allocate IQ math areas: */
! v1 v: H5 ?7 w5 O# T  a. }7 d: j5 W   IQmath              : > FLASHA      PAGE = 0                  /* Math Code */
0 U- B7 k# e( Z! S% D1 I   IQmathTables     : > IQTABLES,  PAGE = 0, TYPE = NOLOAD& `# u8 c% v8 t6 u: C
   IQmathTables2    : > IQTABLES2, PAGE = 0, TYPE = NOLOAD% K- J+ a) B% M' b
   FPUmathTables    : > FPUTABLES, PAGE = 0, TYPE = NOLOAD7 X& v) @- _. t- ]0 s+ Q
6 x# O0 L4 s1 W& a9 [
   /* Allocate DMA-accessible RAM sections: */  F1 x: I. n! e! u" j+ p( c- T
   DMARAML4         : > RAML5,     PAGE = 1& U0 w0 e( r/ U2 p3 `: [
   DMARAML5         : > RAML5,     PAGE = 14 R2 T) s5 G" c& p4 K; E) k
   DMARAML6         : > RAML6,     PAGE = 1
3 D! {' q: C) i/ _/ s2 c   DMARAML7         : > RAML7,     PAGE = 1/ H- k3 s$ ^" U( w4 v) y1 P" F

) I6 K5 F( n- G* U& q2 C7 W$ z   /* Allocate 0x400 of XINTF Zone 7 to storing data */
* m: L6 s8 k$ W   data                                : > ZONE7A,    PAGE = 1
( D0 o+ V: T( j: C4 G7 i   ZONE7DATA        : > ZONE7B,    PAGE = 1# U( ?7 R+ x4 J7 @
! u* W0 O# e+ y# L4 v* Z
   /* .reset is a standard section used by the compiler.  It contains the */
6 _' G( v- j5 u8 h$ V) ^' S   /* the address of the start of _c_int00 for C Code.   /*
$ ^, r, i  y5 p   /* When using the boot ROM this section and the CPU vector */4 l) m9 {0 f1 v
   /* table is not needed.  Thus the default type is set here to  */
" g1 L3 e' O/ X% N/ }% M   /* DSECT  */
; F' `, n2 M& J   .reset              : > RESET,      PAGE = 0, TYPE = DSECT
9 ^" L7 o$ z6 i. q1 F   vectors             : > VECTORS     PAGE = 0, TYPE = DSECT
; T; }0 v- a$ p# ]0 r: A) K5 p; [- ?+ {1 m% p/ ^
   /* Allocate ADC_cal function (pre-programmed by factory into TI reserved memory) */
! V9 y7 Q/ ~0 W  D3 M* ]) t1 F   .adc_cal     : load = ADC_CAL,   PAGE = 0, TYPE = NOLOAD1 s; _- D8 W  F6 d* }6 ?
* J) O  m, ~6 j9 N1 J+ s
}
  l8 ?: H2 e4 H- E3 v1 e

该用户从未签到

2#
发表于 2022-1-10 11:20 | 只看该作者
这个问题可以从这个思路走一下:
0 _; B: b% ^! h  d6 N( o4 }(1)检查一下,新添加的代码是否在某个中断内不?原因是因为中断没有执行完,异常结束了。
' O8 g! O  v% b, e( R3 j( ]3 e(2)找问题,首先不找cmd文件的问题。8 Y- c* h2 [9 n) b4 }% W
我个人见解。

该用户从未签到

3#
发表于 2022-1-10 13:11 | 只看该作者
是和程序的代码长度有关,或者是类似堆栈缓存空间不足

该用户从未签到

4#
发表于 2022-1-10 13:32 | 只看该作者
如果方便,可以把你添加的代码和被添加的部分,粘出来,我看一下

该用户从未签到

5#
发表于 2022-1-10 13:53 | 只看该作者
利用单步执行,看程序执行情况
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

推荐内容上一条 /1 下一条

EDA365公众号

关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

GMT+8, 2025-11-24 00:36 , Processed in 0.171875 second(s), 23 queries , Gzip On.

深圳市墨知创新科技有限公司

地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

快速回复 返回顶部 返回列表