omapl138中 dsp端time_create问题 定时时间不准确 - OMAP-L138 - 嵌入式开发者社区 - 51ele.net
设为首页收藏本站
点击跳转“创龙科技服务通”

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 7534|回复: 1
打印 上一主题 下一主题

[未解决] omapl138中 dsp端time_create问题 定时时间不准确

[复制链接]

4

主题

9

帖子

56

积分

注册会员

Rank: 2

积分
56
跳转到指定楼层
楼主
发表于 2017-4-7 16:58:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
[color=inherit !important] 我们这边用的你们的开发板,测试双核功能,目前遇到的问题是:/ x4 ]1 C- o- A; A
[color=inherit !important]1.ARM端Linux 系统正常进入到文件系统中1 c' B* c2 c) U0 V
[color=inherit !important]
- L- A4 L9 O5 r

# O& q: Z9 _! M" g) E6 l[color=inherit !important]2.DSP端运行基于sysbios的工程,在工程中通过如下设置定时器2
) k7 K8 W; G" i1 Z6 k( w; x, r- n[color=inherit !important]
9 N5 z1 G3 U+ z" }% m5 |

; c( ~$ G2 M% H0 ]# K, D$ ntimerParams.period = 500;
. T$ {  Z: E# d; QtimerParams.periodType = Timer_PeriodType_MICROSECS;

' n+ {8 Q8 w; G; P3 w5 ?; DTimer_create(2, Timer2Proc, &timerParams, &eb);
. x9 j4 ?' a* N9 {9 Z' ^
. m4 B" x. F; `# r$ @

6 Z& E1 \& ]! j3 R, I+ Q7 s3.然后在定时器Timer2Proc()中断函数中进行翻转GPIO的操作,然后用示波器去看GPIO的波形,发现产生的波形周期为960us(正常应该是1000us);0 y/ d+ x3 Q5 l9 z0 Z, g8 Q2 `
产生了定时器定时周期和我预设的周期值不一样。附件是我dsp.cfg文件(只能上传一部分)。请教一下这个问题是什么原因导致的,如何解决,谢谢。
2 J  A7 t) _/ `, @6 w. `) ^- L2 o6 ?1 t4 i. X

/ R" b) ~# w/ d# f2 ^% ?8 U( D. \- V- D0 V' j% Q! B
/*/ l! a6 e) L( y" Z% L
*  ======== Dsp.cfg ========6 ]; J/ P/ M1 M. r3 D& d
*
1 Q9 t$ t( @2 R9 {) L */
/ C) U/ O8 B/ [, I9 U) b) B. n6 q# _0 D' H
, h+ z; F$ F( C9 ~2 D6 q
/* root of the configuration object model */) Y* S% y7 g/ w9 c
var Program = xdc.useModule('xdc.cfg.Program');2 ~1 S  B' d, z) C

4 K0 h* @' c/ H! R! r

: I7 [" S$ A/ g2 U/* application uses the following modules and packages */3 \& {, W+ c8 N6 y* N3 F
xdc.useModule('xdc.runtime.Assert');, I7 X( ?  J: n: |: _3 J
xdc.useModule('xdc.runtime.Diags');
* [% }: `  G7 S+ L; zxdc.useModule('xdc.runtime.Error');
% z/ R3 F3 s4 O* \' k, qxdc.useModule('xdc.runtime.Log');
/ \( n) g  h& i1 Pxdc.useModule('xdc.runtime.Registry');
  h9 b) Q/ i% W1 t/ g; H# Q
9 H" h* Q, D1 ~8 g- [0 ~

. [* Y) l  i5 N$ }0 }! `- t7 g3 qxdc.useModule('ti.sysbios.gates.GateHwi');
+ E- n9 h2 V, [' V6 @5 P3 M& @xdc.useModule('ti.sysbios.knl.Semaphore');
5 d6 b0 T2 h3 S, r) R" ^xdc.useModule('ti.sysbios.knl.Task');
/ C9 J% K- A4 o; W- j; V; V  h, G+ S8 v
/ D9 z  ]8 ]6 I8 Y4 U" T9 I0 @
9 f4 L: b+ }6 ^7 x5 R; v
' F# A2 ]. M; M6 ~! f
" b- v* v3 o/ a1 J
8 ]: o! ^- s. u) V7 l1 z8 a) a
" z0 y2 i( j' e) j

6 J9 F7 ]6 d/ Q0 |var BIOS = xdc.useModule('ti.sysbios.BIOS');
" `) C0 I6 E9 R1 lBIOS.libType = BIOS.LibType_NonInstrumented;4 {! a4 x# d9 B. W0 _
/ k" R1 D" f2 k$ ?

% p* K# g2 P. S
$ N: Q, v/ S* P6 Q  l: H7 Zxdc.useModule('ti.syslink.ipc.rtos.Syslink');
" k+ L: U6 i9 s% C* z- C$ W8 S: O, C0 ^' w% f- R+ ]* V
6 _3 f4 T% W% ?" U$ E- f
# f( ]" R0 z1 R
var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');- {$ s  z: f: ~/ T* X$ q: I' S3 n
var procNameAry = MultiProc.getDeviceProcNames();
! l9 n, x$ I- c* {7 ZMultiProc.setConfig("DSP", procNameAry);
1 T! j  l1 i; C: p) k/ j1 g
  O" G' M6 U! G; X9 _* A6 h4 k

7 I1 Z( D2 {6 N7 V
1 g/ ^# ~' C8 J8 Z9 Dvar Ipc = xdc.useModule('ti.sdo.ipc.Ipc');8 q) y* n2 _2 r. ^: p

* z. h; a6 t. o* }, }; N" R; g) w

# @1 |% T3 i8 V4 H6 D/ {- F! I# k4 q# R  r3 \8 `+ E
Ipc.sr0MemorySetup = false;# ^( W' j- z, @1 S
6 E9 @, ^2 s. o) Y" D" E/ X
- L- @0 Z& H; K9 a6 P
) o% g9 Z( N: }  P# h9 h% T* e
Ipc.procSync = Ipc.ProcSync_PAIR;. z) [" b: D, j6 s
1 g" D7 |- ?# t" v$ M4 t
. B5 Q0 \* A) [# \3 y. {7 }
/* define host processor */
( B8 }/ h$ t3 SIpc.hostProcId = MultiProc.getIdMeta("HOST");
" q8 H+ {1 u3 f
) a- T; ?" F) X+ o0 _2 D* p' N* t

& R6 {) x. \- M/* shared region configuration */7 }' f, O4 ]( F1 y- Y, q$ r  i
var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
$ D: p7 W  X0 B  N+ `- e# B! f; S1 g' ]
, _9 E8 S4 l  n6 v2 _' U, b6 u
/* configure SharedRegion #0 (IPC) */3 j& Y* B3 A4 x3 p7 g2 ^& @
var SR0Mem = Program.cpu.memoryMap["SR_0"];+ ^5 g1 j' W, c% B$ i; b

' ]- N3 h# p0 ~( z9 f4 n
) \) u7 U2 w' H
SharedRegion.setEntryMeta(0,' S. t! n. l* E0 o, S" i' e
    new SharedRegion.Entry({5 H& w( p9 {- K2 s3 {1 R1 z
        name:           "SR0",3 q/ s' U; g' ~* m3 X4 D
        base:           SR0Mem.base,  j; l3 k  u6 \
        len:            SR0Mem.len,  l9 {  _. N/ j* t- j/ y3 j& [
        ownerProcId:    MultiProc.getIdMeta("HOST"),4 F# R1 M' J5 n! j# K, W% f. D2 X
        cacheEnable:    false,
* }7 m7 {6 T( a/ q7 s        isValid:        true5 Q# b+ @+ u- Y$ A# e
    })
' J5 M& W3 i7 ~5 W1 q) Z% v$ {);" G' i7 T( c& U

7 y4 x( y3 |8 q3 E
0 `" \" E+ x) }
2 z" P9 k4 W% v1 I  A" l

0 V5 E8 H2 n& I  c6 K( P' _/ M

/ A( R# F& R7 r* t* K! J; m8 M: ]Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');
# r4 T  O4 S0 D: F& DCache.MAR192_223   = 0x00000008;  /* xxxx xxxx xxxx xxxx xxxx xxxx xxxx 10xx */
* s6 G9 {& ]7 G+ o
0 H8 @2 o8 B8 r3 M2 [
1 h. S. |/ T3 E$ h$ {' i
+ g7 D- h2 A' o7 A/ J. t3 I
1 r9 W+ f  I: I: E) h, o5 X
/*
5 t( `. n. ]0 N9 N; g *  ======== Operating System Configuration ========1 W; c: n# a& n% e( q) c
*/3 \/ p8 V; r: J4 t1 R, s1 U1 D- k: W
+ h& k- u, j  @  C3 b$ ~
; a& W( S5 t, V4 L
/* no rts heap */! R$ H* Q, K% t2 Y4 d/ X9 D% q
Program.heap = 0;
7 h! [1 C& R& y# n, j& ]) OProgram.argSize = 100;  /* minimum size */, S  n; E! A9 e' x
Program.stack = 0x1000;8 N7 G0 e+ h# p' G% q2 j

/ R+ X! e) i% P  A9 `; S

; g" ~& ^; p3 O( S. `/ H7 S/* create a default heap */6 d# R  r" \& t1 b2 v& A" l
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');+ s! ^, Y. p2 @& F+ C, ^2 g
var heapMemParams = new HeapMem.Params();. J5 ^3 g) Q% ^' _  C
heapMemParams.size = 0x4000;
* f* a: S6 U* g2 n0 Y$ `) h/ y! q7 y( S* d7 u

/ ]8 w2 G' o( e- Wvar Memory = xdc.useModule('xdc.runtime.Memory');! c$ r' x& C5 i2 [" p  f  E
Memory.defaultHeapInstance = HeapMem.create(heapMemParams);, N$ B# D# t$ S+ `2 Y" }" k4 d' \

  f  ]$ \' W* J
. i* o4 l! E4 Q9 E# x, u! @
/* configure System module */1 n" `  }5 d* x& ^
var SysMin = xdc.useModule('xdc.runtime.SysMin');, \+ }# q8 F6 N" C! f" z) d- A
SysMin.bufSize = 0x1000;% }& q7 o2 i1 _" Q
SysMin.flushAtExit = false;
7 q! p8 t. t: b+ o1 h- z" c1 O4 y0 d9 D9 {" V3 x
# [# n, N" n$ g
var System = xdc.useModule('xdc.runtime.System');
& @! j. {' U! u; l- M7 x0 bSystem.SupportProxy = SysMin;, G2 D3 Q1 p' G/ \+ i& h/ o( }

+ s9 i4 O. x8 N% B  ?9 f( o+ C5 s$ u
4 j6 l4 x' C" I: u/ v
/* configure SysBios to use the lower half of Timer 1 */5 z' J0 n) _* x1 }9 d7 P( S
var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer');$ b+ e: |4 q3 a  a. c, f2 l. L8 x- ]
var Clock = xdc.useModule('ti.sysbios.knl.Clock');( s1 v) t* ~# j- d3 b( B6 t
Timer.timerSettings[1].master = true;* e' g+ B0 n: I2 p( `
Timer.defaultHalf = Timer.Half_LOWER;
; M, }( u) |" c0 P+ x8 fClock.timerId = 1;
8 h+ C- A2 U8 z& v  a6 C: z( X

! a+ }- N, K/ t  C/ W  c
7 E4 {' a' u. I0 T0 E7 E0 d9 E0 [& p$ |
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

3

主题

852

帖子

3538

积分

创龙

Rank: 8Rank: 8

积分
3538
沙发
发表于 2017-4-10 12:01:20 | 只看该作者
ARM 端将定时器2/3 输入时钟配置为 156MHz 需要修改 DSP 端 CFG 文件配置
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

点击跳转“创龙科技服务通”

QQ|手机版|小黑屋|嵌入式开发者社区 ( 粤ICP备15055271号

GMT+8, 2026-1-31 03:32 , Processed in 0.049668 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

快速回复 返回顶部 返回列表