|
FPGA和Omapl138的dsp核使用upp通信,总是出现uor错误中断,这时为什么? l. s5 v0 }% b) `7 V& m, D$ u
dsp使用i发送到fpga,fpga使用q发送数据到dsp,dsp的发送中断间隔是40us左右,经常收到uori错误,不知道是什么原因。示波器看每次upp发送时间都是很少的。upp中断服务程序如下:5 `3 G" {) R% ^0 S; E" ~9 V- q
u32 UPP_Isr()2 O- N. z. z! a
{+ O: w7 p- ?0 k) Q
Uint32 intr_status = upp_reg_hdl->UPIER;
8 a, z( L. ?0 l6 R4 n# d o( ] T# K upp_reg_hdl->UPIER = intr_status;//clear
9 `/ U( T! K4 I7 z& |// Log_print0(Diags_ENTRY | Diags_INFO, "--> UPP_Isr:");1 {. W3 y2 q! M. f' U( Y/ I, K I
u32 ret=0;5 o9 B9 s9 H; P
0 d% ]/ Q/ R: l! _ // inline functions& l0 V" T: z7 {: e# r
while (intr_status != 0)
$ B3 z0 \1 M2 w. B9 A {
' G5 O8 h6 [2 J# n; c. r# ]4 B if (intr_status & CSL_UPP_UPISR_EOLI_MASK)//Line结束事件
' R; j- P( V. h& m {
2 b5 T m+ ?5 T8 Z* L" I; t: p// Log_print0(Diags_INFO,"eoli.\n");2 A6 Z+ ?$ P- i
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOLI_MASK);. i7 U9 _7 ~) M# c% [
}
& ^0 Y# q' N+ B$ u! x6 _' H
9 z) w; V$ e4 F) ]. x% F+ d& m1 G if (intr_status & CSL_UPP_UPISR_EOWI_MASK)//Window结束事件
) c6 j7 _8 B& p& y {# ^4 P! `# n7 e* L- U
Log_print0(Diags_INFO,"eowi.\n");" M$ `8 l4 l6 C; S Q
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOWI_MASK);3 e& w5 y% \+ C
upp_interrupt_count++;
' n; d& a5 F2 N upp_interrupt_eowi_count++;
5 A9 { }5 D0 o. ~
% F( c( p0 A) b. `8 C#if UPP_DIR_QI==0
' n0 C" n! y. { upp_dma_receivestart();
" B3 j$ F/ j/ ]7 U, I ret=1;
4 o1 A" p" w9 j! g6 M5 ^8 ]1 I#endif
. y* \/ `1 y$ ~* g }" s2 E) E/ P$ e
B- R3 R3 Y# F
if (intr_status & CSL_UPP_UPISR_ERRI_MASK)//内部总线错误事件8 w8 h; X) I) P: t2 c- ], Q1 J
{
. b4 y- x% y; N& @3 E. E& \ Log_print0(Diags_INFO,"erri.\n");
2 w2 H: x# {6 G: I8 _ upp_reg_hdl->UPIER = (CSL_UPP_UPISR_ERRI_MASK);5 _# E; K& l4 o5 t
upp_error_count++;
" y2 {% N/ J a f }1 }0 o+ Y1 z% f
0 |0 P9 L, z0 P4 }& g: E& w" h( U if (intr_status & CSL_UPP_UPISR_UORI_MASK)//欠载或溢出事件8 R" O$ z# s# m. j
{; ] `/ @- b6 T0 o) a
Log_print0(Diags_INFO,"uori.\n");
& S# ^9 i- |% q6 f, c upp_reg_hdl->UPIER = (CSL_UPP_UPISR_UORI_MASK);, F; v! @' c0 x
upp_error_count++;
8 G( g3 p( b8 u% O( j9 U; Z, y }
$ X( p8 [' i: W' b* \/ D# |( Z) Q: U- k$ H# T
if (intr_status & CSL_UPP_UPISR_DPEI_MASK)//DMA编程错误事件' O1 n6 S4 `- {# t+ d" W8 \
{3 W: L' C! S! w' w9 {3 H
Log_print0(Diags_INFO,"dpei.\n");* A7 d: n3 u! V6 }
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_DPEI_MASK);# h( C2 W3 Z. i. h+ ]! R
upp_error_count++; l: G, e* q, n3 ?0 h
}
! l! M* t+ O$ q. h
' w# O0 _$ |- t/ e2 G if (intr_status & CSL_UPP_UPISR_EOLQ_MASK)6 R; g( J6 F' Q* s' e
{% z& l2 W5 y* U5 g
// Log_print0(Diags_INFO,"eolq.\n");" e; x2 q8 M; r! Y/ i( P P! _
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOLQ_MASK);
% Z! ]/ |7 d' y( J" Q' s }
?1 Z6 z) m3 O) G2 [ j' t8 M8 J% E# C& [0 T7 Y
if (intr_status & CSL_UPP_UPISR_EOWQ_MASK)5 R( i' A+ e* d( ^
{
, H4 Z7 M& |0 x% t3 S) o// Log_print0(Diags_INFO,"eowq.\n"); T: p: j- M$ i4 P9 ?" G
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOWQ_MASK);
# {# V/ v3 e+ @$ w# D upp_interrupt_count++;
$ P5 A/ V$ `! \) @8 ~. c* B#if UPP_DIR_QI==1
, n, S7 j! [8 h7 J$ a upp_dma_receivestart();$ B) ?% }+ E" P2 m# j
ret=1;
$ f- j. X+ G- M `/ P#endif9 L( u( d( J7 O3 N
}
: G$ y4 t0 o/ U$ l+ J) _/ c+ F) n# _! S: u% w, r# E& n) G, }( i0 R
if (intr_status & CSL_UPP_UPISR_ERRQ_MASK)
- o2 U" q0 a3 P* C {
' \, D7 H2 d* ^5 E9 `. `: j( U3 @. ? Log_print0(Diags_INFO,"errq.\n");
1 m! @. U F; y( F8 J upp_reg_hdl->UPIER = (CSL_UPP_UPISR_ERRQ_MASK);+ A$ P' m& h4 c: K- r9 O/ `; C' B# R
upp_error_count++;
( p8 a5 `$ v$ ?) L- V" N1 D2 X }
$ V; I4 T; @9 D5 ? J; ]7 S( D# v1 D3 J
if (intr_status & CSL_UPP_UPISR_UORQ_MASK)
, E- @- a8 ]* R {+ M, z. H# U& z$ E* N4 h B
Log_print0(Diags_INFO,"uorq.\n");/ O/ w) ^9 @/ O8 a9 N. _8 @
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_UORQ_MASK);# B; U( M5 }; H7 ~
upp_error_count++;
7 `3 s0 v0 Q# F. J0 o9 J4 V, S/ o }
: z0 O2 J1 E) v# f" U8 @
8 C# K7 ` |9 Q, S- B+ p& \) g* S if (intr_status & CSL_UPP_UPISR_DPEQ_MASK)
[9 Q: R- ?3 y {
% G2 S. |9 Z( A Log_print0(Diags_INFO,"dpeq.\n");3 M7 O! S; M; h9 V
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_DPEQ_MASK);' Y; C* ~% U+ l& X# c$ H
upp_error_count++;+ o m# {" A+ y. Q5 |! R' m9 Z
}, k t& G$ i' X( l, F0 J; h
+ p. ]8 q1 l4 {( ^4 j // make sure all interrupts are handled
, M! A' f# b. o0 o1 n. ]0 b e intr_status = upp_reg_hdl->UPIER;
" y: i, J+ f% ~. O1 n) T" [ }
# f; { ], a b9 H9 C
7 I6 N1 ~1 [. t7 v, Q4 X7 v( Z // finally: write 0 to EOI register
7 f# J2 p _2 z upp_reg_hdl->UPEOI = 0;
( `9 a! C# b, `8 \! l% @/ d8 S% `. _ return ret;: z* a& U/ q2 y) U# |6 s/ w
}
, t$ g# L6 d1 D) pdsp发送区大小为512字节,发送txsize设置为256字节。使用的是单行,win窗口是512发送方式。发送调用upp_dma_sendstartQI(I):' _& L' S* Q: h5 b$ h
#define upp_dma_sendstartQI(x) {\
( Y* Y: P8 G& `# j Wait_upp_SendReadyQI(x); \
( [ d4 K- f2 m4 H upp_reg_hdl->UP##x##D0 = (u32)&g_uPPSend; \9 [9 n% O$ g. W! G1 [( O4 Q. _
upp_reg_hdl->UP##x##D1 = ((u32)upp_line_count_s << 16) | (u32)upp_line_size_s*sizeof(s32); \) v+ S3 |. D- Z9 l/ A" ?6 f) d
upp_reg_hdl->UP##x##D2 = (u32)upp_line_offset_s * sizeof(s32);\ U) n# k, u6 i, z- H0 z
}
6 @+ X: F/ U4 f. f' `+ t, d
p) F6 c3 c% G# {2 {1 j, ~9 R) X, p
#define upp_dma_sendstart() upp_dma_sendstartQI(I)
9 L, [. A2 [) P8 ^$ G$ P1 [
O- L. M: g8 x: k/ ]! X& T
: N, b" ] p; @想知道uori错误是在什么情况下面出现的,好做出修改。( x6 j7 f+ E, @/ G2 b
3 Z6 a9 J+ N9 ~3 |- \2 U
6 O# x" E! I6 i6 d* K |
|