|
FPGA和Omapl138的dsp核使用upp通信,总是出现uor错误中断,这时为什么?
' J. y e+ V+ q; s2 v8 a6 D) V9 |( V8 W& adsp使用i发送到fpga,fpga使用q发送数据到dsp,dsp的发送中断间隔是40us左右,经常收到uori错误,不知道是什么原因。示波器看每次upp发送时间都是很少的。upp中断服务程序如下:
0 v$ G, P a# @4 T; pu32 UPP_Isr()
7 E2 [$ g& u9 `0 V. @+ N4 s{2 n* Z* d% C5 c4 J$ `1 _/ w3 n
Uint32 intr_status = upp_reg_hdl->UPIER;
) t$ [9 F- O& w5 K upp_reg_hdl->UPIER = intr_status;//clear
j+ B3 m' m6 Y// Log_print0(Diags_ENTRY | Diags_INFO, "--> UPP_Isr:");* S2 G5 J9 w' M, j+ A
u32 ret=0;
3 b6 s6 K |) @
3 _3 k- m" N! f3 `, `2 K+ W! L% J // inline functions+ J' }9 D! H8 H3 s/ a( ]# a+ R
while (intr_status != 0)# X! E8 I! _$ E7 b! ]5 y; R
{
5 x. W% U. x. x, y1 u% f if (intr_status & CSL_UPP_UPISR_EOLI_MASK)//Line结束事件
" X# Z9 R0 a% Y {
7 N k9 n6 Q0 D e2 h% I// Log_print0(Diags_INFO,"eoli.\n");0 f5 x, V' n/ J7 Y# \
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOLI_MASK);: ?/ n) | j8 K2 C# x
}% N% i+ l9 ^* N
& T- w) Y% k) k/ {
if (intr_status & CSL_UPP_UPISR_EOWI_MASK)//Window结束事件4 c) {! t0 g6 h: {; k( b5 R
{
7 K0 V& _9 }* S$ q8 ^ Log_print0(Diags_INFO,"eowi.\n");3 u- v& @5 x8 R6 J2 t" m
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOWI_MASK);" W7 z8 y# B! T9 `( L. i6 @
upp_interrupt_count++;! n" c$ [9 }* ?% B- Q
upp_interrupt_eowi_count++;7 n+ ^) s8 L, r0 A7 {- s
/ K, ~4 G9 X/ G+ p. U! u#if UPP_DIR_QI==0
N8 B: f) {" D4 z6 m4 J upp_dma_receivestart();
0 p9 x+ N$ E$ { ret=1;* w/ G( |1 s/ S: e" z' Y
#endif! D9 r3 i0 H; C3 U5 W
}: G1 j* f" q+ E7 a( [) t
+ |4 V6 ]! Y- Z' I; b) l# S
if (intr_status & CSL_UPP_UPISR_ERRI_MASK)//内部总线错误事件
5 F, c6 n. D4 a" B* v {2 d. Z2 C* `3 e2 W$ A- h* `
Log_print0(Diags_INFO,"erri.\n");: P, |2 C2 C* o
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_ERRI_MASK);* K, t+ u# @6 {
upp_error_count++;
* s) h) x( D1 n }
7 H( U7 k5 F" e5 w" M. w& T6 n% o k( z3 T
if (intr_status & CSL_UPP_UPISR_UORI_MASK)//欠载或溢出事件
1 F9 [/ g8 f; C5 l. |. }( ` {* u8 B v1 N! O: G( F7 R# d
Log_print0(Diags_INFO,"uori.\n");
2 h: T5 I* g) S$ }, b8 _" Q upp_reg_hdl->UPIER = (CSL_UPP_UPISR_UORI_MASK);
* i/ X8 o. @9 W1 d r upp_error_count++;- I/ v4 h% z4 @, Q! p1 F
}+ M& C# O) T/ K7 t4 W# i5 G4 s
0 n6 K/ L+ r9 A* w6 Z7 A7 I if (intr_status & CSL_UPP_UPISR_DPEI_MASK)//DMA编程错误事件! z( H" N/ `- y' L c V: Y
{( h2 A% N; F$ ] O1 ?. X7 q2 B* j
Log_print0(Diags_INFO,"dpei.\n");
9 {/ e) l* M& c5 h: h upp_reg_hdl->UPIER = (CSL_UPP_UPISR_DPEI_MASK);
/ a5 d- i3 `2 r* ]; T upp_error_count++;1 ]1 J& r( \/ R
}
# I9 N. e& x5 U! P) E6 g5 s' }3 n$ x/ p/ |& b
if (intr_status & CSL_UPP_UPISR_EOLQ_MASK)- C, _- g5 a3 r9 h: m; y9 s3 z
{1 \+ E+ b3 r9 u( [0 g6 a
// Log_print0(Diags_INFO,"eolq.\n");
: Y' n& n+ e$ X6 ^6 } upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOLQ_MASK);
3 v# V: f* ?7 d1 Y% A w# @+ b }
+ U, r& [- W5 u: B
% X. ^) s2 J: Z; H: F" [7 Q( o- d6 o if (intr_status & CSL_UPP_UPISR_EOWQ_MASK)
' c8 b3 v4 u( f8 n9 l% m {
1 M5 ]/ o3 ~0 W// Log_print0(Diags_INFO,"eowq.\n");
4 {. S, C. r u1 Y upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOWQ_MASK);
J# X L @4 g- e: s5 Z! i# {* G upp_interrupt_count++;9 o. p% |! U+ X: @ s% w8 J) `2 h
#if UPP_DIR_QI==1
, w, K$ T" N/ ~% Z5 v1 k upp_dma_receivestart();
* |2 |, N6 ^' {7 y" Z/ T( a/ ~ ret=1;
$ u" v' i/ F4 } Q' o#endif) `. _+ {/ V3 K' t6 [% }$ I5 }5 h' y5 A
}2 e4 v& o6 z6 c: K6 ]0 s* b! ^
E8 s1 r4 [( p2 \: u: w9 w6 e if (intr_status & CSL_UPP_UPISR_ERRQ_MASK)
6 c5 z! @# ~8 o) T7 M {
7 t% B g0 S" W6 x4 X& D Log_print0(Diags_INFO,"errq.\n");, p- W2 w) ~+ h7 J
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_ERRQ_MASK);3 t5 R- {0 @% Q+ D% f
upp_error_count++;
3 Z- J% ]: l M, v# Z& Q }
% |: w) W5 ]8 W* ]7 x7 l/ ]' I8 p; V- f8 R9 {
if (intr_status & CSL_UPP_UPISR_UORQ_MASK)
' L. n; R% ]! c1 [) K {
- W; ]+ c' H. q5 V Log_print0(Diags_INFO,"uorq.\n");
8 ^# X! E6 e n; W9 j1 \ upp_reg_hdl->UPIER = (CSL_UPP_UPISR_UORQ_MASK);
" `+ }; L- u* G upp_error_count++;/ }. ~: x: e* H' \' |6 c
}6 |; p8 h: V3 P) G
5 E( x& s1 h' q' }4 l: Z' t7 R
if (intr_status & CSL_UPP_UPISR_DPEQ_MASK)" k. ]8 w! p5 d: w. n
{
4 c; |# l) I- ]7 ` G9 m Log_print0(Diags_INFO,"dpeq.\n");
0 ], u: x, |( @' O' C upp_reg_hdl->UPIER = (CSL_UPP_UPISR_DPEQ_MASK);
4 a4 h* N V) r$ z: s; @& R upp_error_count++;
: l5 c( ^4 S2 s8 A% m }
& |- w% E7 ]5 V/ L: Y+ P/ A
9 l4 `& J% a- C; L. Q# K5 t$ w1 j // make sure all interrupts are handled0 s6 s# v# g! |, h) y8 Z( d8 k# C
intr_status = upp_reg_hdl->UPIER;$ @" e& X" c1 v N) U
}( \1 U( H9 ~: ~1 V0 s
! G! ?, i+ i+ s8 p7 ~* l! l) D // finally: write 0 to EOI register
" L* t! A) o7 H% Y upp_reg_hdl->UPEOI = 0;
0 }' {) q8 X- [ return ret;
& n% H* c. Y* c- _7 L}
8 @% z! h, F$ U! [/ Ddsp发送区大小为512字节,发送txsize设置为256字节。使用的是单行,win窗口是512发送方式。发送调用upp_dma_sendstartQI(I):* Z/ Y# r7 c5 s3 B
#define upp_dma_sendstartQI(x) {\& `5 R9 D5 s0 I" e
Wait_upp_SendReadyQI(x); \% C% D n$ z) `0 G: v* Y) P
upp_reg_hdl->UP##x##D0 = (u32)&g_uPPSend; \ [/ t0 f4 r' D: B
upp_reg_hdl->UP##x##D1 = ((u32)upp_line_count_s << 16) | (u32)upp_line_size_s*sizeof(s32); \
: a7 [2 M! u' E" Y, j upp_reg_hdl->UP##x##D2 = (u32)upp_line_offset_s * sizeof(s32);\
" X4 d# j+ B+ U3 [ }
: D$ e1 o9 _# D% y8 \4 K( f4 |% N5 [, U# i
$ v ]" u3 K& }7 y5 ?#define upp_dma_sendstart() upp_dma_sendstartQI(I)5 X+ [+ }% D( S% i$ E7 n8 U
1 c0 [/ x, n [) n \2 Q8 A: i7 K' {0 V: X. v
想知道uori错误是在什么情况下面出现的,好做出修改。
0 a/ E {* Z. B
5 s9 G; |& e$ t: `* Q) h) P* h7 L2 n, D2 o1 `1 ?' @
|
|