|
FPGA和Omapl138的dsp核使用upp通信,总是出现uor错误中断,这时为什么?5 C' e% F0 f: @% g( |
dsp使用i发送到fpga,fpga使用q发送数据到dsp,dsp的发送中断间隔是40us左右,经常收到uori错误,不知道是什么原因。示波器看每次upp发送时间都是很少的。upp中断服务程序如下:
1 l) ~/ J3 \% s# \% T: Hu32 UPP_Isr()
, D5 ^1 e2 F; n" f/ F! V% ^{
9 L5 f7 |) N9 j: l9 g Uint32 intr_status = upp_reg_hdl->UPIER;
2 x5 v0 c% \0 Z" j; N3 e! h upp_reg_hdl->UPIER = intr_status;//clear
% h) A) f- Z1 T A) s2 n// Log_print0(Diags_ENTRY | Diags_INFO, "--> UPP_Isr:");& { }- Y/ M4 z3 @3 m
u32 ret=0;; |6 g9 R5 h# d7 C1 N! s
. P: B) r S$ k1 n) Z$ R) e
// inline functions" i6 X9 Z, W$ Q' F* x
while (intr_status != 0)2 p! a, q& F* m) y
{% Q: h% `/ W9 h0 T: w
if (intr_status & CSL_UPP_UPISR_EOLI_MASK)//Line结束事件
8 u% C/ E7 m5 \! M {
; ?) ]9 C+ B) G! Q( c# x// Log_print0(Diags_INFO,"eoli.\n");
9 w: F+ i! w" K/ t upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOLI_MASK);, e9 F' T/ d+ m3 U
}
/ e! c: k4 ]/ J9 V7 l0 R9 \# t' A$ q, r
if (intr_status & CSL_UPP_UPISR_EOWI_MASK)//Window结束事件
5 R9 p+ n8 U# R* F1 F+ f {
9 r4 Q1 F( s. S7 h* ? Log_print0(Diags_INFO,"eowi.\n");
/ E1 L/ s1 H0 K& d# b upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOWI_MASK);2 ^5 @/ l! E4 F# r
upp_interrupt_count++;
- d) U+ |0 e9 F1 O upp_interrupt_eowi_count++;
5 \9 b$ T! ~) n: U, i! x- v, {4 T# {- D ^4 K: L
#if UPP_DIR_QI==09 K# H$ G+ U+ {0 [. ?
upp_dma_receivestart();+ i! T- |$ K5 L
ret=1;/ k6 @- h, ]9 g
#endif
4 Y( d+ _* h9 {/ s }
]- O2 e" h) m* @ c& w# O* v7 b' S* y5 A/ S. U! y, b% q
if (intr_status & CSL_UPP_UPISR_ERRI_MASK)//内部总线错误事件! s8 P( v$ o9 S5 R' t' S6 Q! ^
{
+ q/ {7 h, W8 r d8 v1 {% `5 H Log_print0(Diags_INFO,"erri.\n");( \7 g, g# O6 D- C
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_ERRI_MASK);' b* ]! I; O/ {+ i' H
upp_error_count++;" e+ b* b; ]0 S" u* c9 h% y6 I9 m
}2 {6 S) Q* H0 a9 |$ A T
# ?3 C6 g0 F& v0 H2 Z! P" R if (intr_status & CSL_UPP_UPISR_UORI_MASK)//欠载或溢出事件+ R2 e! `8 x; c& s$ |; I/ b" j% K# t, G
{
) T. ~' g0 f7 @$ b Log_print0(Diags_INFO,"uori.\n");4 f# N, i1 E( X' x9 G5 o! v
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_UORI_MASK);) C Y& B6 H$ p& T
upp_error_count++;
) M6 j4 |! D; U+ P: A) Z. p4 f' o }8 h4 }. C+ c |& }% w. |
8 ?# ^% t. `5 r$ q4 ~$ ~# L
if (intr_status & CSL_UPP_UPISR_DPEI_MASK)//DMA编程错误事件- x3 `0 s0 i! i. C- _2 R# C
{6 q- X+ n: W' B" W# v$ |( a* H
Log_print0(Diags_INFO,"dpei.\n");$ I4 i" V6 k- }; E0 ]
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_DPEI_MASK); E# _$ R5 a7 L
upp_error_count++;
' {, ^" o1 [; g, o O }" _1 F% q) ~% i. J1 Y# Z5 w- `! n
N- Q3 @) t; G( F, D: K# K1 I
if (intr_status & CSL_UPP_UPISR_EOLQ_MASK)
3 Y. _6 z( X$ U0 M3 d; D# ?4 F! a {
$ [1 H+ u, B8 G2 W$ Y// Log_print0(Diags_INFO,"eolq.\n");0 c, x# K+ x2 c. Z
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOLQ_MASK);
" f% a" [* t) V% _+ S% n# C }' R' _. R/ c+ |' G q+ g A4 ]0 o3 s9 t
7 {+ v! z8 E7 c7 ], `% E8 ` if (intr_status & CSL_UPP_UPISR_EOWQ_MASK)
$ f D- ]; L6 D4 ~$ ^ {
P3 t* b. o5 C& d// Log_print0(Diags_INFO,"eowq.\n");
0 P" c p @) u( B. H1 m upp_reg_hdl->UPIER = (CSL_UPP_UPISR_EOWQ_MASK);% d+ ]. n/ G! b9 ]
upp_interrupt_count++;
. w" ?# \$ L8 T# @& G$ s#if UPP_DIR_QI==13 v7 V7 x/ M2 ?2 k' I: z
upp_dma_receivestart();
, G' O9 J+ j5 C# I ret=1;, C: o+ l5 L1 `3 c! I5 m' v
#endif5 c' `8 h A4 d5 t& O; L* b% i1 k
}
$ M; H) I( a; ^' h8 Q
" w/ y3 H* a, I; \# { if (intr_status & CSL_UPP_UPISR_ERRQ_MASK). \0 ]% }; l$ I" |2 `
{
- K" K: B* I9 G1 \- }1 W Log_print0(Diags_INFO,"errq.\n");8 `" C# j r$ j7 X+ x: i
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_ERRQ_MASK);, @! ?; P- A0 a3 Y- r% A3 P. n: K2 G
upp_error_count++;7 e, s0 J( F2 o, k# C+ L9 K
}2 K m. @; E& l: @
! S8 W- l( X1 B/ |: g5 v7 e' [
if (intr_status & CSL_UPP_UPISR_UORQ_MASK), M0 ^ U" G5 u5 I
{/ E+ q* U- |: k! @
Log_print0(Diags_INFO,"uorq.\n"); `5 n+ H( {. S* `
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_UORQ_MASK);
7 q0 a& F2 x9 S3 W4 R& F6 f upp_error_count++;' T4 }& V0 L7 ~- F+ }4 n
}# S9 A8 e7 ?% \3 B5 X4 f! l
3 U R7 N4 j& E4 K. E$ b if (intr_status & CSL_UPP_UPISR_DPEQ_MASK)- a7 t' R5 p% C0 i/ M5 b$ l! b
{5 M/ V! J9 }2 a! ?7 b/ x7 g3 P. l
Log_print0(Diags_INFO,"dpeq.\n");: Z0 P8 ~3 z0 C( ^$ l
upp_reg_hdl->UPIER = (CSL_UPP_UPISR_DPEQ_MASK);
s' C; A2 {# F; i, e8 [7 t/ l upp_error_count++;; v4 L3 G" A ~# W) r( L
}
( ^5 l* j5 q# w: ^1 H( Q# @( o: l7 c2 \5 c1 a- u( A
// make sure all interrupts are handled F# g; r2 x; N+ g) f+ k% K
intr_status = upp_reg_hdl->UPIER;5 t y l' {" I9 p. o
}8 F9 Y# U6 U# h8 p1 i; K8 S% }' G
8 ^/ j8 {% K6 u" b% q8 Z% U8 z
// finally: write 0 to EOI register! R) u! U% f" x6 i" v( Z
upp_reg_hdl->UPEOI = 0;" k: A) b8 K( l( V
return ret;
, K" t8 B, h3 j) V}. a7 _" W0 t( |4 u4 |
dsp发送区大小为512字节,发送txsize设置为256字节。使用的是单行,win窗口是512发送方式。发送调用upp_dma_sendstartQI(I):4 n; o; g$ _% N+ I5 a0 _6 a) h
#define upp_dma_sendstartQI(x) {\5 ?8 A, N: h5 f. F: `
Wait_upp_SendReadyQI(x); \: b4 V# R4 M" [* L( X* A O v7 J- m
upp_reg_hdl->UP##x##D0 = (u32)&g_uPPSend; \
% H+ y0 A6 m% g+ ?: R; W, J: w upp_reg_hdl->UP##x##D1 = ((u32)upp_line_count_s << 16) | (u32)upp_line_size_s*sizeof(s32); \
" t% P) _% H, [0 y; X upp_reg_hdl->UP##x##D2 = (u32)upp_line_offset_s * sizeof(s32);\4 J$ p r8 O5 P) t
}: B; {: J* B' @. c( v& J1 T, z
' c) o& |( F3 e. r& Z) v' q( L5 p3 `
#define upp_dma_sendstart() upp_dma_sendstartQI(I); ?6 O; F% Y7 Z5 }3 E
4 H9 q! x* Y# n+ t% d
" }: g: t) a% e3 F: F9 T7 {想知道uori错误是在什么情况下面出现的,好做出修改。
5 I. Z" f* @: B6 h d' S
) C5 E: [- \4 _9 D# A) `/ n+ T5 y8 S- a
|
|