omapl138中 dsp端time_create问题 定时时间不准确 - OMAP-L138 - 嵌入式开发者社区 - 51ele.net
设为首页收藏本站

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

4

主题

9

帖子

56

积分

注册会员

Rank: 2

积分
56
跳转到指定楼层
楼主
发表于 2017-4-7 16:58:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
[color=inherit !important] 我们这边用的你们的开发板,测试双核功能,目前遇到的问题是:2 m0 B5 c0 @4 O
[color=inherit !important]1.ARM端Linux 系统正常进入到文件系统中
( _/ \4 P8 X* a9 }: c! S3 g[color=inherit !important]9 G! Z5 `( [! ~

! }' i1 `9 ]- A[color=inherit !important]2.DSP端运行基于sysbios的工程,在工程中通过如下设置定时器22 n9 p8 ]4 s! |+ d( k
[color=inherit !important]
0 \* ^* ^1 F0 Z# E7 X1 m0 M) h0 r* z
* k! \0 t# i" |) p
timerParams.period = 500;
5 f2 T& x" h9 o' |0 HtimerParams.periodType = Timer_PeriodType_MICROSECS;
* ^/ v7 T" a4 b& i& [! ~
Timer_create(2, Timer2Proc, &timerParams, &eb);, x& |8 C8 j$ l; j2 z: g9 y

2 A0 e1 W( U1 g+ E2 x

$ d8 m4 j* w- p4 w+ J3.然后在定时器Timer2Proc()中断函数中进行翻转GPIO的操作,然后用示波器去看GPIO的波形,发现产生的波形周期为960us(正常应该是1000us);
  ?7 T! Z) q* ]3 ^3 Y& ?产生了定时器定时周期和我预设的周期值不一样。附件是我dsp.cfg文件(只能上传一部分)。请教一下这个问题是什么原因导致的,如何解决,谢谢。* r+ P8 o( i1 {" b

9 M) M! y3 {: ?9 n" G* r" y; Y

/ k3 ?5 f' E$ Z- z! ^" N$ }) I# q/ ~5 P: i- s& I- ]
/*
; d/ H# z$ F' C( Q *  ======== Dsp.cfg ========  D: u! F+ y7 O! P. t
*
& p3 U3 C2 v- s+ g0 L */( \$ j& `& `  j0 Q. u

/ z, m4 d# d5 a7 F- d) g

/ g, r2 m2 c# o; g0 d& j* V1 B/* root of the configuration object model */
% N0 ~# O2 m, n5 Yvar Program = xdc.useModule('xdc.cfg.Program');
# X5 [) Z8 y2 H) b
; _) V1 c- \/ y6 M$ W/ `

' D' ~, e, ^' A6 H! i" Z/* application uses the following modules and packages */
9 h/ f8 i% S" G8 }$ Y6 ]xdc.useModule('xdc.runtime.Assert');; T& R. o1 h6 ]. a9 c( ?) z: Q. ^1 Q* c
xdc.useModule('xdc.runtime.Diags');
3 t' H9 ]3 e  jxdc.useModule('xdc.runtime.Error');: K+ E. ]0 |" ]* {" j' ~
xdc.useModule('xdc.runtime.Log');- A: D% V% m  E9 r
xdc.useModule('xdc.runtime.Registry');2 p3 k: e" Y3 a: |, [

$ E" |9 J3 l) c8 K, _

* v! L; P; K+ m/ x( H* axdc.useModule('ti.sysbios.gates.GateHwi');- h+ ^- L" M& b3 s! }2 U% K
xdc.useModule('ti.sysbios.knl.Semaphore');7 d6 D! r0 E1 o# t  B
xdc.useModule('ti.sysbios.knl.Task');
& A& }2 A; {1 Q- [! y1 |3 x4 m7 D: b- P
, S" F- q3 {" y0 ~
' U( ~& c: ^/ f) W  D. O
/ Y) B+ E' \6 N

3 i7 P  ]3 |% [9 p8 _: r+ W  X" B# h: d& o' S0 t2 t* F

# m: L) p& h# Q. Q. X6 tvar BIOS = xdc.useModule('ti.sysbios.BIOS');$ q# E1 _* v$ N0 I* n) K
BIOS.libType = BIOS.LibType_NonInstrumented;3 Z: d, z) E% R! F& E

9 I* s% a. h0 {8 B# _4 H
# c) j/ h5 C9 Y+ G

: Y9 R% A: W( P1 _4 s1 Yxdc.useModule('ti.syslink.ipc.rtos.Syslink');
$ h! _+ }$ Z* l4 ?3 [% S
7 |5 D' Q( r2 i- c& ?7 r( X
0 S* ~( X* L% f) b1 U" x( z8 r

0 I  E; h/ n- b, q5 \3 n$ [var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
% w! ~" V' }3 f. Dvar procNameAry = MultiProc.getDeviceProcNames();
* U- P/ A( H: JMultiProc.setConfig("DSP", procNameAry);
) c/ y' Q5 R# o& K( w! b- |% v! c, l7 _  a' P% j* \$ B) h/ C9 X

1 P! r, A* H( y3 U0 l* w
$ ?$ z: a7 X7 I8 n# ovar Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
) B; t) m# m# Y  s
& x  @6 E- I3 |, S) S  m

, r& `* Z6 o$ s3 Q' D5 \4 G1 F& S9 n4 M; N/ D# e, d
Ipc.sr0MemorySetup = false;
2 U7 k9 R0 D6 O9 ]/ ]0 ?8 M( F6 q0 U4 z$ u1 ?3 }
6 T8 \9 P$ q$ \

, @5 M: H+ z+ g% G+ oIpc.procSync = Ipc.ProcSync_PAIR;6 t5 |, g4 L, ~7 m  G8 |( G

; p. h4 D( O% g; Y4 [8 ?8 o8 I

8 `1 s& r9 g+ N/* define host processor */3 a! I! G2 K. l$ C8 ^
Ipc.hostProcId = MultiProc.getIdMeta("HOST");
: d2 S( B9 x4 t7 J1 b; z" D
3 C1 `7 X# ?5 m! v5 s: T/ ?9 b
) X: t# t* c* ~& H$ M7 ]! O/ b& O7 ?
/* shared region configuration */6 z& c. H+ e7 _
var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
8 I2 A- V0 Q# a9 q5 I1 m% a6 y' h+ Y1 J0 F# M1 y4 E) j0 v; i
: K0 t  Z4 [+ ~' `9 [
/* configure SharedRegion #0 (IPC) */
# k* r+ O/ n& j/ Z3 xvar SR0Mem = Program.cpu.memoryMap["SR_0"];; |& M6 k) ^4 h: P

$ ^5 n- }: }1 D

0 y5 k; Y# O0 H- d7 n4 a- L" SSharedRegion.setEntryMeta(0,
5 t0 ~) ~4 G/ J" o  z    new SharedRegion.Entry({
# L3 a3 P8 e% w* Y, g8 t        name:           "SR0",
7 [1 C; {% c/ y  F        base:           SR0Mem.base,
% E9 B: A0 M$ A  A2 R. Y. z5 Z        len:            SR0Mem.len,3 O2 E2 N* W9 J; q- x# Y! r
        ownerProcId:    MultiProc.getIdMeta("HOST"),2 y, f( X# g3 F2 J' n9 M" G7 N
        cacheEnable:    false,
( y0 U: C- j& b8 c3 e; {) y3 t        isValid:        true. u. g% \' k& {) g% j( I; S% Y; M
    })" |6 _! R/ U2 g0 O4 }! c
);9 N0 u& ]  o( D# X
% ]0 ]2 V( w3 C# `

$ x% y! z7 c  n: L7 ^% n, p! r" ^! ~) w
/ l' |5 X& x) b  W
, w0 Z; I1 A7 r( j5 D
Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');
! t; u/ h$ k; F& tCache.MAR192_223   = 0x00000008;  /* xxxx xxxx xxxx xxxx xxxx xxxx xxxx 10xx */
9 r3 o, O- Z. L; |9 K4 G' L
) M. h6 z1 H0 j7 P0 v- _6 \6 D% X

1 p. ]; T: I% E  |; `4 D; W) E3 n, C4 x5 w- o1 o
) T" q: E+ M! v( Q7 \8 P, d
/*8 z: D' n8 E6 q2 e6 s
*  ======== Operating System Configuration ========. M0 Z/ G' a6 K' t1 }- K3 O% @& ~8 g5 y
*/
  o. X! j. @+ n* E; G2 I3 {
# u% _* o* o6 y) ]+ _! f
; {( S4 I% Z! @/ D/ C9 \
/* no rts heap */) A3 V4 ^5 W. Q8 [
Program.heap = 0;
, P4 C; w9 F0 h2 {1 [Program.argSize = 100;  /* minimum size */! j8 G+ B4 \! \! M2 f6 t% {
Program.stack = 0x1000;
& b2 E  G, B0 ^: p' r4 r1 h
2 x' s; O, ?3 C3 s( M0 D! j
9 f; ~6 z1 O: s. L8 z& }
/* create a default heap */
" F( K  g4 F0 q" r# e: m7 ]var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');: I: ~& s2 E6 ?9 t# A0 G
var heapMemParams = new HeapMem.Params();( b8 l0 x  W4 ~; R
heapMemParams.size = 0x4000;! I* ]4 E9 h0 C2 N% k% _/ K9 L

( u9 }: f& @: u0 n! ^
+ M  W% o% ]# f2 X
var Memory = xdc.useModule('xdc.runtime.Memory');& r3 V! s& T# v( ^! N; w: x
Memory.defaultHeapInstance = HeapMem.create(heapMemParams);. @* J. g: a( l5 N# p6 y' `
& u1 |% M7 {( i+ K# z2 c5 Q" P

, r" }" k  y( C% @* E/* configure System module */
9 g# w+ o1 ?$ [var SysMin = xdc.useModule('xdc.runtime.SysMin');" V( K( z3 Q9 S0 A
SysMin.bufSize = 0x1000;  o( C. z% |: c4 E, l5 `; |
SysMin.flushAtExit = false;) F) r3 I: O' ], J

6 [9 `7 n: l; r

5 n. h3 A0 Q1 Cvar System = xdc.useModule('xdc.runtime.System');
* m# p# O) }/ F) j- ^System.SupportProxy = SysMin;
# Y9 F- S# e5 x
* }  a5 X0 A# N! V9 p5 `
; N6 }' R* G$ M+ @1 S% m
/* configure SysBios to use the lower half of Timer 1 */3 A' R6 l! h/ U
var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer');
- \! U  ?, h: x5 ^% M) L  xvar Clock = xdc.useModule('ti.sysbios.knl.Clock');
6 \' L6 a" k0 [% F9 f; uTimer.timerSettings[1].master = true;
* B8 b3 X, _+ L/ j) XTimer.defaultHalf = Timer.Half_LOWER;
: Z+ H) L5 N4 IClock.timerId = 1;9 N2 I2 L: w# p& a

  W* V' ]0 _7 y* N2 i0 W3 Q3 p8 e9 |; C- N) `! T$ T
8 X7 _4 T( ], l* N; L0 x

, J: E6 @# q8 f- Y2 |0 G
分享到:  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, 2024-4-30 01:49 , Processed in 0.047991 second(s), 23 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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