|
FPGA和Omapl138的dsp核使用upp通信,总是出现uor错误中断,这时为什么?
* m- B' i1 E5 } k. P# sdsp使用i发送到fpga,fpga使用q发送数据到dsp,dsp的发送中断间隔是40us左右,经常收到uori错误,不知道是什么原因。示波器看每次upp发送时间都是很少的。upp中断服务程序如下:* s, n1 b9 M# ?4 A2 g/ B/ O
u32 UPP_Isr()8 C# e5 q* l; g2 j. }% Z9 Q+ q; _
{! Y$ R3 ?% ^; ~3 n4 X! s0 \
Uint32 intr_status = upp_reg_hdl->UPIER;4 J' ]) F0 k" V7 F. x r
upp_reg_hdl->UPIER = intr_status;//clear/ @" V3 @' K: Z+ `
// Log_print0(Diags_ENTRY | Diags_INFO, "--> UPP_Isr:");$ L0 ~/ {( T3 J ~6 S, h4 K) v5 G
u32 ret=0;
( c) s% u0 {* ~& r4 z
- b6 w7 |/ j0 z x0 I // inline functions
7 M- `$ z$ L; C0 }) \ while (intr_status != 0)
. ^: C% |* ^+ q. h3 L) Y {
3 C% A( y( b6 F1 M7 o" J9 N if (intr_status & CSL_UPP_UPISR_EOLI_MASK)//Line结束事件6 V* t0 |' p1 n
{
9 O5 B8 Q, E. P: ^// Log_print0(Diags_INFO,"eoli.\n");0 {/ h0 e$ Q5 E9 C" j% E3 D
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOLI_MASK);
7 U8 Q U ]- H9 i }
% T: R! V2 G8 R) i8 Z5 ] C( T z8 i. [2 R2 a- x6 ~* }( Z
if (intr_status & CSL_UPP_UPISR_EOWI_MASK)//Window结束事件# a- l& T9 |8 e/ S6 z9 R% _
{
, Z) P8 W/ O. c1 K% _. F5 ^ Log_print0(Diags_INFO,"eowi.\n");; Q9 o0 U# w3 a5 |
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOWI_MASK);
: N: u# f% l8 T, I/ w) j. |3 V/ S7 v upp_interrupt_count++;0 ]5 c0 G6 F3 u
upp_interrupt_eowi_count++;
8 L7 X& h8 [8 Q; Y+ r& `5 w- }+ |" Q! A: E _1 D4 e
#if UPP_DIR_QI==0
6 y) j% M; o/ {) X$ Y; V: V/ G D upp_dma_receivestart();
, I# x9 d5 E9 l7 i ret=1;
8 a& A2 \7 _! Y$ U#endif
9 _) V, n5 X0 w }
. V9 b5 |, |0 ~8 G5 w
- O4 H. T0 ?: M1 ]* K+ H/ U1 W if (intr_status & CSL_UPP_UPISR_ERRI_MASK)//内部总线错误事件9 m& G" X' I, O; z8 V) b8 u4 C
{$ t/ R/ p/ ~; i8 h, Q
Log_print0(Diags_INFO,"erri.\n");8 B1 Q% ^: a0 O" v$ _/ ^( L
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_ERRI_MASK);
& q, p& A% Z+ [) G% G4 ]2 _. N upp_error_count++;: H i7 R7 V* B+ x; w
}
* c" p9 i1 |$ Z! Z' f9 Y7 m4 y
, x9 i7 C+ S4 Q if (intr_status & CSL_UPP_UPISR_UORI_MASK)//欠载或溢出事件* C7 J8 s9 r g* I6 L: H
{$ |! g* Y+ A1 x* W! z
Log_print0(Diags_INFO,"uori.\n");
% e1 l( c. c3 B+ ? upp_reg_hdl->UPIER = (CSL_UPP_UPISR_UORI_MASK);' ^4 M. ~0 I0 s2 e1 S' _% ^
upp_error_count++;" F% t' R8 ~2 d
}
3 d% |' |6 S3 K
, i% E% K1 o$ I9 U) Z' [+ x if (intr_status & CSL_UPP_UPISR_DPEI_MASK)//DMA编程错误事件. n6 F( \- R( o. v5 t* U( O9 ~0 m' a
{# J4 h/ m0 D2 Y- W+ b
Log_print0(Diags_INFO,"dpei.\n");1 m/ E! P' l. f j9 t* k9 G
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_DPEI_MASK);
4 ^. m: g8 V& [$ z upp_error_count++;
4 \; U) h: B: w } }2 Z- x W; v0 v' z# Q1 s6 N
1 p+ c/ G, p3 ~' f( Q C5 p if (intr_status & CSL_UPP_UPISR_EOLQ_MASK)
' R9 G& ^+ U! @6 b4 _. Q' j {5 G% h/ S& q$ D, h# t
// Log_print0(Diags_INFO,"eolq.\n");, K5 I4 b+ ~, X C8 I; a
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOLQ_MASK);
* i1 b/ P6 K5 h. J$ j }
) @$ m2 l8 r9 j* _" d& L0 _9 Y: A& X9 q" Y! y0 P- d
if (intr_status & CSL_UPP_UPISR_EOWQ_MASK)" y5 S( B6 K5 T; Z
{
" i/ q4 K9 O7 g( H2 Q4 T// Log_print0(Diags_INFO,"eowq.\n");! e/ N0 C% h: y& ^" `: m3 T
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOWQ_MASK);
) k7 s. B) H! p- W1 k+ a( A x1 U upp_interrupt_count++;- h/ a V) t9 x
#if UPP_DIR_QI==1
% Y( V& `: Q; i" u/ W upp_dma_receivestart();
7 d( W2 h! `8 g o ret=1;* h1 V" V) d2 l. A4 m: Q
#endif& H! c+ X* M/ M+ W9 d" s
}
4 m2 k1 \6 }7 `' ^/ X' W
, Y/ c, a1 I1 l; X6 ~ if (intr_status & CSL_UPP_UPISR_ERRQ_MASK)
! d6 z, }; m) C0 a* b% g! W {$ x# i6 l# }; l6 J" A
Log_print0(Diags_INFO,"errq.\n");
4 Z/ i, y, L) n, v" m5 z upp_reg_hdl->UPIER = (CSL_UPP_UPISR_ERRQ_MASK);
7 Z5 c' `% m- i# T8 a- }! Z upp_error_count++;) s$ v# L/ @7 w) ~) j4 G3 a+ i5 P
}* v" s6 ~- E1 H9 F# P
9 D* e6 U& I C) ? if (intr_status & CSL_UPP_UPISR_UORQ_MASK)5 i) _' w! l$ [% a) f
{ ?' N' k% D- Z, q6 p' n* S
Log_print0(Diags_INFO,"uorq.\n");7 J, K. G# B1 y* j p3 W3 z- ?
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_UORQ_MASK);8 t6 d+ i" {9 ]$ m% q/ P
upp_error_count++;! B, _6 o( M: z+ ?- U
}! L& A9 ^3 {0 s. |8 e
/ `3 w; d D, Y6 O+ J
if (intr_status & CSL_UPP_UPISR_DPEQ_MASK)/ W! o! F# g0 t: d9 g
{
/ z% [1 h$ T$ @ Log_print0(Diags_INFO,"dpeq.\n");0 {8 y% h; L2 X7 [
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_DPEQ_MASK);7 H5 S3 R) L; N& H' n
upp_error_count++;! [4 Q/ X4 }! F d& C/ F
}, ]" j9 u1 }7 u7 C3 }% x1 L b
+ ]; A( j; D& N C' ` // make sure all interrupts are handled
& a, t8 H2 Z9 n8 B5 H intr_status = upp_reg_hdl->UPIER;
5 |3 X7 P2 U- ~/ N) x7 O }
+ i) \: ~* N1 d
' D9 A8 X8 l; b- O" w) } // finally: write 0 to EOI register
, x; @7 g) a" ^ N4 @ upp_reg_hdl->UPEOI = 0;4 u/ Z; J. u0 n# ?% p
return ret;
: j4 T$ P; f+ M4 X% t5 L+ c/ e}
8 L' i! s: O2 }/ M5 D7 o2 Idsp发送区大小为512字节,发送txsize设置为256字节。使用的是单行,win窗口是512发送方式。发送调用upp_dma_sendstartQI(I):, n- o0 M' C! f9 W; T3 r
#define upp_dma_sendstartQI(x) {\% B7 L- s0 ~" Q& T
Wait_upp_SendReadyQI(x); \
) T& ] n% i9 }# x0 f upp_reg_hdl->UP##x##D0 = (u32)&g_uPPSend; \
2 o7 r6 K! Y% P- z& y upp_reg_hdl->UP##x##D1 = ((u32)upp_line_count_s << 16) | (u32)upp_line_size_s*sizeof(s32); \8 e- g/ N- Q8 y0 c9 L4 \7 B
upp_reg_hdl->UP##x##D2 = (u32)upp_line_offset_s * sizeof(s32);\
! x7 n* m! s+ Q* j; A7 s8 d9 T }' u8 h& G; |" u
4 s0 }9 }: b4 v- L' o9 E% P$ \/ w& T% a1 Q0 R9 _* u/ |0 ?
#define upp_dma_sendstart() upp_dma_sendstartQI(I)
4 d) g4 Y3 P* r1 N$ D! Q: y
/ Q1 i3 O) @6 t! u- q2 x: _/ q7 X) _ U5 a5 @
想知道uori错误是在什么情况下面出现的,好做出修改。* Q- c6 ^/ L$ z/ p2 ~
: ]6 L j8 b. R& k$ V( h" ?8 C' @4 C
|
|