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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

4

主题

9

帖子

56

积分

注册会员

Rank: 2

积分
56
跳转到指定楼层
楼主
发表于 2017-4-7 16:58:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
[color=inherit !important] 我们这边用的你们的开发板,测试双核功能,目前遇到的问题是:
- R  |9 r. E; ~: o+ U) m[color=inherit !important]1.ARM端Linux 系统正常进入到文件系统中
8 I1 `6 S- F: C1 f  P. }[color=inherit !important]' J8 o0 {. G. s" P2 U1 _. J
! z* E: d0 o, n
[color=inherit !important]2.DSP端运行基于sysbios的工程,在工程中通过如下设置定时器2
4 H" y3 W+ U( n' K: Q- X[color=inherit !important]. P3 i4 E/ t4 s( q* @  B7 J) @

% X' [* v" O) B* K5 G  btimerParams.period = 500;: \! \( W) C' v/ N
timerParams.periodType = Timer_PeriodType_MICROSECS;
+ h/ e- F" i+ Y
Timer_create(2, Timer2Proc, &timerParams, &eb);
) f  }! Y+ u/ Z6 {5 e: T! j  e$ q1 C3 P
0 }  N* W' I2 T0 Q, D+ a6 x1 I
3.然后在定时器Timer2Proc()中断函数中进行翻转GPIO的操作,然后用示波器去看GPIO的波形,发现产生的波形周期为960us(正常应该是1000us);$ g2 r1 i  K& t6 W% I- V/ t' i
产生了定时器定时周期和我预设的周期值不一样。附件是我dsp.cfg文件(只能上传一部分)。请教一下这个问题是什么原因导致的,如何解决,谢谢。
( z4 e' T8 T5 U$ e. T
- c3 g( q+ a6 W# \* r  w
  T) p: z. E: ?# t4 q& w
9 E. k6 W% f( Z' m' h: n' L$ h
/*4 `$ V( o9 @* Z
*  ======== Dsp.cfg ========0 q7 ~1 d/ m& T" R
*# i% u1 K0 f1 O6 |, d+ f
*/
0 q4 E5 k4 ?  a0 j7 ?! {- D+ l! s9 u* G+ ^% _" W. p0 Z; f+ _- n

3 D& e$ {3 `, G* x9 B- N/* root of the configuration object model */2 ^1 U2 ]! p$ F3 v6 V4 X
var Program = xdc.useModule('xdc.cfg.Program');
, ^" m0 p6 G- d; n1 T! @1 A1 c; r, a/ _  V) `
% J/ b! u! X* _$ }
/* application uses the following modules and packages */) z1 d8 k3 U4 ^/ k  P1 }2 a
xdc.useModule('xdc.runtime.Assert');
) }7 s; T; t/ b, ~9 f2 P8 _xdc.useModule('xdc.runtime.Diags');
9 K- E, e+ z* I6 R: w, Kxdc.useModule('xdc.runtime.Error');3 R% x2 y2 K7 M6 l/ q
xdc.useModule('xdc.runtime.Log');& t1 z9 r  U2 C0 C, m  O$ i7 {
xdc.useModule('xdc.runtime.Registry');
: m9 g8 B% F4 `+ H0 r7 U/ _0 e% O2 Z# w) x3 S2 v
. V, y& t' p' Y- a$ C4 k8 E
xdc.useModule('ti.sysbios.gates.GateHwi');$ M( p) s/ a( V8 E
xdc.useModule('ti.sysbios.knl.Semaphore');
1 f9 k! M8 N* f* C! Yxdc.useModule('ti.sysbios.knl.Task');! p' [7 Y; x/ _5 z# z; J( C

6 d, z* Y: v$ V: \- m2 F4 E
, A9 y2 D% Q# m3 e, L9 j

. y: J& u/ ?4 Y2 z) f( K! f7 a4 W
  a: U( I, r/ }" U+ j  V2 Q# t3 }) u) ~! D' |# S' a
/ U: E9 q2 t" y
& _0 g7 @' h8 q' L% ^
var BIOS = xdc.useModule('ti.sysbios.BIOS');" T" }7 d9 V3 }. B# K5 e* \
BIOS.libType = BIOS.LibType_NonInstrumented;; Q/ m" k! W  B) {% U+ _$ H
7 o) l9 Y1 C: W8 b& S3 P- a

, H& y1 P- n6 C7 g# I6 w6 ^, `9 E# ?" T, W3 D0 i/ V5 E) `
xdc.useModule('ti.syslink.ipc.rtos.Syslink');
5 }/ C- X- e! v5 P) l! f
$ w0 O, [( [! {5 o* E

+ v3 \: {1 d) Z( i: C1 k" ?( L8 ~5 n# ~
var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
5 N! I5 @- `) z$ ]' o4 _) w* q2 ~# X% Yvar procNameAry = MultiProc.getDeviceProcNames();( m% [) P$ p1 v" y7 _- V; n0 V3 J
MultiProc.setConfig("DSP", procNameAry);
3 ]! T6 v" R+ l; f: v9 x2 K0 t$ m6 W4 @3 F
. u7 O  f+ @1 V- g; _0 Y
) a! M2 N' r. V5 z
var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
+ V5 a8 ^. E9 Z3 V2 y( f! q4 h
9 n' D: t! N* s- S$ P" s$ I% y

9 c( v% s" e% ]; K# l/ L$ ^' U+ q( N3 c; b5 i. ?
Ipc.sr0MemorySetup = false;5 z. U7 ~8 k( F6 z" _5 t
4 J. R% k) a: _, A% N* ^2 Z
8 y. J" H5 V' }' ?/ y* N
- B) i1 A& e/ K2 o( ^$ U
Ipc.procSync = Ipc.ProcSync_PAIR;
" C3 v0 o$ \, \$ O. K; l3 c, W- s4 g) _# E5 c4 p
# m9 e, x) P; d1 c
/* define host processor */
6 ?6 U. z5 X# `& \- J3 wIpc.hostProcId = MultiProc.getIdMeta("HOST");6 L. ?  u' \! `; l% u  G

' z# @& D1 F. Y0 p; H: {* ^! ^
$ f% @6 I+ @: k5 f" D3 \. }
/* shared region configuration */
) c* \+ k" l5 w( w1 r9 S# R2 ]+ gvar SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
! l$ L) z3 s/ c6 l' d0 G) x. P/ Y' Y2 w

2 v+ y4 Q1 }" t1 O1 B8 d/* configure SharedRegion #0 (IPC) */( z% E8 K, E! J; h0 Z  m4 p
var SR0Mem = Program.cpu.memoryMap["SR_0"];8 {# v# M) D8 v3 t$ b/ w

1 D, L# G  r0 R0 z/ _( k. R
$ h' D( J9 E8 q9 L& q$ A. M/ I
SharedRegion.setEntryMeta(0,
) O3 Y5 r; f) D# t0 M: d2 W    new SharedRegion.Entry({, c! |' d1 f( Z0 T
        name:           "SR0",
% N9 ^% k6 x8 q8 l  l+ T! A+ I        base:           SR0Mem.base,/ a. x1 L1 u9 C/ G  _4 n
        len:            SR0Mem.len,. X! S; z- d! b( [4 L  W) X
        ownerProcId:    MultiProc.getIdMeta("HOST"),
3 V5 L9 Z# P0 ?# g4 I        cacheEnable:    false,
6 y8 [% `& L/ R2 ^        isValid:        true
( E: f3 b' _5 ^( J- }    })
: T0 N; Z7 g9 q9 N: R);
; @5 t& k1 O8 p* U) E& A9 z; M+ F
5 N6 I* U- c# G5 i$ p% V

0 p* |, ]) S/ J+ D7 j6 r# w, [& z/ I0 _" h& {; Q
# s% I  y$ M! C& ?! V) T

6 |; H+ r3 A, VCache = xdc.useModule('ti.sysbios.family.c64p.Cache');
7 ~: U' Q+ G: c' \Cache.MAR192_223   = 0x00000008;  /* xxxx xxxx xxxx xxxx xxxx xxxx xxxx 10xx */
. @) l/ ?/ C0 |
6 ^3 G' t4 d' Y$ I2 g: @
0 C% r4 _. t# Y) x0 E: R2 T* ~

/ [$ o/ p% S$ ]8 k0 c9 |! b) v

5 y- g# o' A( O/*
6 z/ F' S9 c% u4 A *  ======== Operating System Configuration ========/ k8 O- L* {- v$ i$ @
*/4 i  t1 ?  N, R- V' t
) I1 P- Q: ?( P2 D% j6 \% o
1 C/ f: r8 ?. L! d
/* no rts heap */
% V& E6 F$ @& w" QProgram.heap = 0;
% S3 @8 [7 e) B3 L! QProgram.argSize = 100;  /* minimum size */
1 T! f3 S- E, P/ k* c' JProgram.stack = 0x1000;8 l3 }/ g4 s+ V. c) n5 Q" X( ]/ l
2 }8 v7 s  `9 z% W, g

; r/ Q* s7 U( _3 p3 u3 E+ d% H" N/* create a default heap */
# T+ J! q& A; z+ D5 t  A* ]2 ?var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');6 J+ L( O) T2 ^8 [9 d2 }7 g
var heapMemParams = new HeapMem.Params();+ c# `4 n. K9 z6 {( T( _. W" s
heapMemParams.size = 0x4000;9 w- o2 e& W" _+ A. Y0 P

% s1 w& g3 _3 n1 v* x' ^; @

' N" g3 N" y6 J5 u/ j7 L$ I' lvar Memory = xdc.useModule('xdc.runtime.Memory');" i4 g" s/ b+ z; \+ X) K% q4 u( L
Memory.defaultHeapInstance = HeapMem.create(heapMemParams);6 t1 h& I3 \0 j5 {0 W

& X* d+ h) p- ?% j! @6 G: Y6 F

/ a6 Q# L3 [# v. n4 B2 f$ c+ g/* configure System module */- E2 o: t/ r3 k  F! P5 r& ^
var SysMin = xdc.useModule('xdc.runtime.SysMin');
6 y7 @' G3 x! Q% ?& y4 c8 WSysMin.bufSize = 0x1000;6 P% Y5 ~) H9 L$ H
SysMin.flushAtExit = false;- s$ g9 c9 |$ J2 Q- @% L

& K4 i0 W! ]; B, ]  n

1 \, a  s) u- \' r- _( ^  x2 P& ]var System = xdc.useModule('xdc.runtime.System');3 Z# B2 h- ^, M" N& v( n
System.SupportProxy = SysMin;- {+ q" d2 V4 y* d! z

8 V* Y0 j9 _  U+ j" X& I+ b( r
: X( m# q5 z/ l2 i% d
/* configure SysBios to use the lower half of Timer 1 */
0 D$ k" l) \* m% U. z' {var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer');
/ r/ }  X- y5 _: z2 q; K, w* [var Clock = xdc.useModule('ti.sysbios.knl.Clock');
: J! ~2 C1 u/ Y) b2 k! b1 L( s% ?+ q; v' mTimer.timerSettings[1].master = true;( p  A* C9 j. p/ M
Timer.defaultHalf = Timer.Half_LOWER;
. e* g/ H( Q/ K% }+ g* e; F9 \4 OClock.timerId = 1;+ M4 E6 e- L: K( R2 `9 W8 d0 L- P9 \
  {( d4 w! v3 O+ S; R& A

$ a9 s( P# |5 q9 J6 T4 P
4 t: r: ^# s7 n$ Z9 g5 D7 Q; A) i$ @5 e
分享到:  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, 2025-12-14 16:01 , Processed in 0.040576 second(s), 23 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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