|
FPGA和Omapl138的dsp核使用upp通信,总是出现uor错误中断,这时为什么?
* K- |) Z1 k, F U4 X* hdsp使用i发送到fpga,fpga使用q发送数据到dsp,dsp的发送中断间隔是40us左右,经常收到uori错误,不知道是什么原因。示波器看每次upp发送时间都是很少的。upp中断服务程序如下:
& u8 s8 k- Y; N; a2 c' u! Xu32 UPP_Isr()1 i5 Y) g) ^* c9 w
{
; O, a$ }( {7 b! L; z Uint32 intr_status = upp_reg_hdl->UPIER;
7 R6 K/ N( L) ]: I2 j* U% w upp_reg_hdl->UPIER = intr_status;//clear" K8 w9 ?1 \4 K' j" r
// Log_print0(Diags_ENTRY | Diags_INFO, "--> UPP_Isr:");
& a5 m/ j. F6 z! V: B. P u32 ret=0;
0 k9 l( H# R0 X' N! \9 c# u1 M% q) a
// inline functions
6 a5 R# j$ Z1 J6 C& c while (intr_status != 0)
+ O- s3 Q6 R L$ g+ `8 [3 t2 M {1 X8 `/ p5 h% O
if (intr_status & CSL_UPP_UPISR_EOLI_MASK)//Line结束事件
$ r: h3 V! c) \0 F {# @2 _/ d; D8 a6 \- O
// Log_print0(Diags_INFO,"eoli.\n");
# b% x& U, m9 c" \" g) S upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOLI_MASK);- f+ _6 P. u" X4 C
}
. V/ Q' K# M/ y( {( A( U1 A' e) @( `' W/ j; }
if (intr_status & CSL_UPP_UPISR_EOWI_MASK)//Window结束事件
$ F7 O6 Q- [/ e( Z* b+ [3 p7 b1 [/ } {
% S0 t* b' L$ U | D( Y Log_print0(Diags_INFO,"eowi.\n");
# M1 W: i; J- M! q; F, m6 a upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOWI_MASK);
! M) v* C- j$ M" k6 r; K6 v/ ^3 \ upp_interrupt_count++;
! q: N" ~) N! C- ?# y upp_interrupt_eowi_count++;
4 |$ S6 }. ~2 \' {) q% Z1 H4 P: Y& o" t# P# ^' i
#if UPP_DIR_QI==09 J7 k: }9 R* C9 p
upp_dma_receivestart();
1 [! `1 s* I' L+ t3 _8 x( r' T ret=1;/ S( R$ _% [; \+ c8 Z
#endif
7 Z' p s6 W. f }
; [, M6 { l% m+ [6 K" m1 {) e5 E+ L6 h' ^2 c
if (intr_status & CSL_UPP_UPISR_ERRI_MASK)//内部总线错误事件
* Q+ w0 D K: L, F% ]. u& @. v) g {
- ~% G7 y9 B' M% A1 F Log_print0(Diags_INFO,"erri.\n");! E& y+ u5 F# Z7 l$ j }
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_ERRI_MASK);! w( [9 G$ X" y2 |9 x( s3 n
upp_error_count++;
5 I% @( n- s: p5 C @* E+ V }
. v4 |' w2 F: b' b* _ ]8 k
4 t' G1 G/ p0 _+ D* j% @# F! e if (intr_status & CSL_UPP_UPISR_UORI_MASK)//欠载或溢出事件4 R- Q& N) ?9 D, w6 h# p3 U( f4 x4 t% L
{
8 b" p2 K) K2 x8 O Log_print0(Diags_INFO,"uori.\n");
5 D6 m9 _1 O' F upp_reg_hdl->UPIER = (CSL_UPP_UPISR_UORI_MASK);$ d' }5 ]$ ^/ r8 b/ |# f
upp_error_count++;! S; ?- k; p# M! {
}) I' ~0 ~# H0 N, q
5 V/ g( N5 G1 j if (intr_status & CSL_UPP_UPISR_DPEI_MASK)//DMA编程错误事件
0 M6 M J% N% ^8 w/ V. J0 A {5 Q% I- d* e% b4 A x# h3 y
Log_print0(Diags_INFO,"dpei.\n");
) M" m0 Y2 D/ T: W2 v upp_reg_hdl->UPIER = (CSL_UPP_UPISR_DPEI_MASK);
) U/ @0 { W- ~ L- I) { upp_error_count++;
L4 |0 @1 b( E( r! s2 \ }9 H0 H: }* K3 B) W' O m. v: J
( L2 K, s& M) {2 C* x3 P, [
if (intr_status & CSL_UPP_UPISR_EOLQ_MASK)8 n# p" c q# a; U3 D
{
; H/ H2 p& s9 B/ B& h3 Z// Log_print0(Diags_INFO,"eolq.\n");
; b0 ]' t# i& n# B: A upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOLQ_MASK);
0 @1 t# t2 w" Z1 k' |( E7 g8 s7 Z' W }
7 f- _5 g W+ ?3 E. g' X8 P! R( G9 Y* W5 E/ W
if (intr_status & CSL_UPP_UPISR_EOWQ_MASK)( S# T0 O2 i' h/ T& _6 h2 N
{) d7 o: s8 ]0 Y, X1 A3 C
// Log_print0(Diags_INFO,"eowq.\n");
0 h, j2 Q* l1 x( v9 K# r upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOWQ_MASK);
8 o# s' b) B/ g8 I upp_interrupt_count++;7 _. Q( _" U7 d: d. h
#if UPP_DIR_QI==1
/ g& u- U0 T9 G+ o( n; c0 k upp_dma_receivestart();
: O) a$ S$ b) u) E5 g ret=1;% c1 {6 U" [* b/ U9 b& Y
#endif' Y5 y' ?: u p# ?0 m. d1 E- O
}1 c6 c2 {, I! e6 N
% B. _! D V$ v if (intr_status & CSL_UPP_UPISR_ERRQ_MASK)1 P( G' O; g7 k/ g3 W, j5 ?" T
{% w6 B9 H5 ]0 M
Log_print0(Diags_INFO,"errq.\n");
/ s4 r$ y/ c d1 {" \1 V; }6 d upp_reg_hdl->UPIER = (CSL_UPP_UPISR_ERRQ_MASK);4 }; u- e- v: \: h0 E
upp_error_count++; n" ~/ S, q6 O7 n. y4 E
}
( l9 O) W' P {) C8 C& Z8 [* o# U! f% Q7 U
if (intr_status & CSL_UPP_UPISR_UORQ_MASK)8 d, @7 f- r6 O( I, R, _* H
{
9 H* r( B# \/ ^6 p0 S Y0 ^ Log_print0(Diags_INFO,"uorq.\n");3 X! N7 }6 i% C E2 ^. A7 M# [
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_UORQ_MASK);7 ~4 M8 G: i3 W- z& h B# E/ f( G
upp_error_count++;8 g/ O& g+ e- F$ k( ~
}" h# X: B' e) U' ^
3 |+ V# k" O8 w/ C8 G: b& q
if (intr_status & CSL_UPP_UPISR_DPEQ_MASK)1 e* T; R7 v, |6 ~5 P
{
0 s3 V# t; f: G. A. V Log_print0(Diags_INFO,"dpeq.\n");" _& x2 G% S8 V
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_DPEQ_MASK);
9 o$ k) |4 K; H# k9 k; \" m) ? upp_error_count++;& A/ ]# g* S! [4 U- C+ { x
}
, S! K( y; Y! f* g( Q' W' I. E9 B1 o( V$ T& f4 K) I6 T; A
// make sure all interrupts are handled; ]7 q* v7 n, A) Y9 {9 F- x. F- o
intr_status = upp_reg_hdl->UPIER;
; n8 X. O& P; d6 V' F# i }1 @* z2 k! s) _' @. |6 f. U* l
" t4 A/ |4 y# O& P% V3 e
// finally: write 0 to EOI register
( F' D$ t% _! _% H, b1 g upp_reg_hdl->UPEOI = 0;8 R# Z+ y+ g f( Y8 U7 |& F
return ret;. W) b L' f" s$ Q& K
}
+ D3 D6 O9 h" odsp发送区大小为512字节,发送txsize设置为256字节。使用的是单行,win窗口是512发送方式。发送调用upp_dma_sendstartQI(I):8 Z: X J7 s1 E
#define upp_dma_sendstartQI(x) {\
1 W8 F* B# ~$ n3 ] Wait_upp_SendReadyQI(x); \ C0 ~. `& m# @
upp_reg_hdl->UP##x##D0 = (u32)&g_uPPSend; \ @: G7 v& C% {; C
upp_reg_hdl->UP##x##D1 = ((u32)upp_line_count_s << 16) | (u32)upp_line_size_s*sizeof(s32); \
4 C( X0 Q9 |5 H! J) h& C, s6 B; P upp_reg_hdl->UP##x##D2 = (u32)upp_line_offset_s * sizeof(s32);\
, X1 ~8 m1 n8 g. X! b }' ]" c7 i' Z3 i: o" ~
' t% O4 k( W1 _4 d, c8 x2 ~$ |: z7 q3 t) A) k; n
#define upp_dma_sendstart() upp_dma_sendstartQI(I)4 L% ]/ X1 x N. k2 s
1 \% [$ M2 d8 I ^$ B' U
5 [" U- K1 ^. Y7 j. f想知道uori错误是在什么情况下面出现的,好做出修改。
7 t% V9 U; s# c) [. v8 X4 _& m/ ?( o# c2 s
! G; _. a& r. c: F3 u; u3 s
|
|