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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

4

主题

9

帖子

56

积分

注册会员

Rank: 2

积分
56
跳转到指定楼层
楼主
发表于 2017-4-7 16:58:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
[color=inherit !important] 我们这边用的你们的开发板,测试双核功能,目前遇到的问题是:( \3 d0 y' O9 C  U1 S
[color=inherit !important]1.ARM端Linux 系统正常进入到文件系统中
  c$ O- f$ X2 U& u. j% a! R+ H[color=inherit !important]9 R; [8 g5 V6 {) A1 X' ]# C

, ?/ L- K7 |* j7 [! e9 F[color=inherit !important]2.DSP端运行基于sysbios的工程,在工程中通过如下设置定时器2. _3 {% s! |! d, w; {" o7 X; e, K
[color=inherit !important]
$ ]3 w2 i2 S0 @+ L  K) J) N% N

/ h7 t& e1 B; }3 [6 U' stimerParams.period = 500;
$ J0 m* j" v( {7 F$ K! ~timerParams.periodType = Timer_PeriodType_MICROSECS;
" J' i0 S' G% d$ \( h
Timer_create(2, Timer2Proc, &timerParams, &eb);
( A' |3 x- \, i6 }+ Z' ~0 F
, j1 O- W0 J2 F! n5 @

# p! R, D# A6 `9 D3.然后在定时器Timer2Proc()中断函数中进行翻转GPIO的操作,然后用示波器去看GPIO的波形,发现产生的波形周期为960us(正常应该是1000us);: _2 |8 R+ R' {- ]" ?" O4 C$ q7 L
产生了定时器定时周期和我预设的周期值不一样。附件是我dsp.cfg文件(只能上传一部分)。请教一下这个问题是什么原因导致的,如何解决,谢谢。$ A2 D8 a8 U- e
5 Y: d. Z/ f& m- O5 B. P
- D, ?* ^$ g  D# s

! k; j& T% v  h/*
! G4 K, }! A: M  c4 Z/ _' T% ^ *  ======== Dsp.cfg ========
3 n: O. Z7 a& [) V) d *) m. U# i; z7 M9 v+ z' P6 ?* M
*/
- B. S  w) [: J' V& N! V( I/ h; b& _
; F* J) l8 I6 Y4 f% O4 I+ J
/* root of the configuration object model */0 Z1 k# y% {1 y$ n3 [
var Program = xdc.useModule('xdc.cfg.Program');
! x1 A! Z& [5 p0 Q% R- e1 r8 r6 i0 j9 P/ b9 \5 }8 g5 n3 |
! u6 Z* ]: x/ g" y
/* application uses the following modules and packages */7 m0 i8 ]+ a0 `
xdc.useModule('xdc.runtime.Assert');, C, O; T. K/ v" P  x
xdc.useModule('xdc.runtime.Diags');- G" B) a. |2 Q. `
xdc.useModule('xdc.runtime.Error');9 B. {: N2 ]  |$ J
xdc.useModule('xdc.runtime.Log');/ @/ |# u/ d2 m# g; w( V
xdc.useModule('xdc.runtime.Registry');
  x4 }8 k( U6 v; m+ g& ?& m! u- }% [3 m: Q; E0 T$ V5 ?$ ^

9 A! T3 @! E$ A7 V5 gxdc.useModule('ti.sysbios.gates.GateHwi');
8 w7 d7 W' [3 X/ I" cxdc.useModule('ti.sysbios.knl.Semaphore');
5 ?. W( s/ y+ v# \xdc.useModule('ti.sysbios.knl.Task');
+ r$ n1 o9 j9 Z8 F' H
, l: ]2 r; D4 ?8 D) k

+ ~5 P; G) T; U: h% U+ k! z: y  ~: w
. t/ \4 ~( @8 ]6 x1 x7 |7 _! C. {/ `
1 t5 w5 s; ^, C1 Y! R+ y: T' a
( c, P; c, B) N3 u* w/ a7 O5 l, D' `# D9 f% m  t* ?. J/ N

+ Y& K3 C0 ]0 }0 O1 F2 P1 wvar BIOS = xdc.useModule('ti.sysbios.BIOS');" y; j' s- w/ x" v- S
BIOS.libType = BIOS.LibType_NonInstrumented;4 X0 U0 |2 C/ ^& h& J) e
+ v4 r2 @( N6 _: F4 k7 e6 }7 e
/ F1 x1 i1 u" Q6 g! t  ^" D% t
8 z" Q1 y4 i+ J; Z- `
xdc.useModule('ti.syslink.ipc.rtos.Syslink');4 X" N7 ?5 c2 M* S8 [+ \! I
/ D2 F( W( {, s6 a" L) o4 |
5 @( ~: c  }) d& t" H

& u6 c+ N$ }* ?/ T) e' S; nvar MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');, D1 U$ o2 @* W( P+ ^
var procNameAry = MultiProc.getDeviceProcNames();8 ?. ?7 h2 [- s, {2 N- {+ {2 s
MultiProc.setConfig("DSP", procNameAry);" ]+ q4 _  _1 j# Z4 G/ q( R. v

2 e% K) ^( x. b, [3 ?4 R4 |1 {
6 V+ _& W& h5 H

. V/ u* f- U  {7 H- y$ Zvar Ipc = xdc.useModule('ti.sdo.ipc.Ipc');% W6 k) ^& E- G+ ~( k' X8 a7 y3 ^# D
  ?) {" |6 }7 j3 `# S8 w2 x
9 @% r/ J" E0 ~' X' ?+ B# ?' z

" L/ O7 v  D+ F0 C2 \3 |. w+ aIpc.sr0MemorySetup = false;
- [) s' w& U. L' F& J
& S. ?$ y* N) C( r9 o$ }

' u; f6 @+ L- y/ Z
, m8 \( z6 e2 n8 j& i, ]Ipc.procSync = Ipc.ProcSync_PAIR;
. E) e; S, J& W$ h8 G: r9 ]
  i  [; H" I9 d4 d" a0 @& Y! B

% h1 A5 ^' j9 ?6 V! @) x/* define host processor */. j  Q9 g1 F" v
Ipc.hostProcId = MultiProc.getIdMeta("HOST");
9 @; f! D* r) I1 j, Y. l( p: H+ w9 N; j+ M# F% r4 ~$ T! F
$ X& l; n2 E5 r  K! x
/* shared region configuration */
$ E2 e7 @' ^9 _; U4 \, M1 gvar SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
. H+ ]  w# K; t, ]% W+ \2 k+ _/ i3 |) k0 p0 @
3 f; ?+ d: T% V7 k6 F) T( K5 A% I$ I
/* configure SharedRegion #0 (IPC) */# R/ a  u, ~" \9 I( r  I
var SR0Mem = Program.cpu.memoryMap["SR_0"];
  y5 W( Z' ]: B8 V1 u  }% q% o5 v1 i, I% g  w
; W; \6 Z$ r: O. _* p- V
SharedRegion.setEntryMeta(0,
. {/ L7 T( Y* C) E. O+ U( Y* G    new SharedRegion.Entry({
# {/ o" m6 Q4 G1 S, T1 p' a        name:           "SR0",3 C: p6 k; n2 @; S* G" M
        base:           SR0Mem.base,
0 v: C# ^+ x) s! J        len:            SR0Mem.len,
7 C" I8 e6 ^' d0 b        ownerProcId:    MultiProc.getIdMeta("HOST"),  r1 ]( ^, m6 J' b: n( _
        cacheEnable:    false,+ e0 v: m) h* _8 @- T% c0 a( r/ L( Y
        isValid:        true! P0 ]! q6 ~, Q& f# N& Z4 u. J: _
    })) v" {; R3 V, B7 U" @0 ~6 Y  y
);7 t# y& l' W5 l8 M5 F0 K6 v* g- Z

  }$ m* h* ^3 _/ s0 f$ U

0 y. S1 |  b0 d5 j# t$ q- l3 a' k6 m

6 Y! ?/ a8 H" K7 c- V

% j" [" t1 i. u$ }0 qCache = xdc.useModule('ti.sysbios.family.c64p.Cache');, T: q) I/ U9 t) @5 P
Cache.MAR192_223   = 0x00000008;  /* xxxx xxxx xxxx xxxx xxxx xxxx xxxx 10xx */
9 }6 ~; a' m9 S4 Y' {8 a+ m& x
( N* {/ a% ?# }* U
) K: D! C# I/ D$ q$ n
7 q3 n) O0 }  I5 w
' `5 X- P1 u( h" u+ P# q
/*& a; D$ J: {& V% {1 R' Y
*  ======== Operating System Configuration ========0 s: C4 b+ D8 C  f7 q3 A4 S
*/8 o  E8 \' `. Q" z# V" n
0 o- E# n1 u! n6 u
- K/ ]/ E0 T; B, T& ^* d
/* no rts heap */
$ l% ?% N3 O' o/ r- d3 @Program.heap = 0;- D& V+ {- @, n! b9 m
Program.argSize = 100;  /* minimum size */
* k9 w) O- S" ?. w7 ]4 i! W7 [9 o; xProgram.stack = 0x1000;
. B. |# I2 V% [% Y* k, ]
8 M- H" U3 `  k5 S! A3 ]
3 z! M) k* j; m& B$ \0 Y1 E+ v' G
/* create a default heap */
3 Q: f; n: \: bvar HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');% q$ O( P2 t- n' B+ ~7 o) V
var heapMemParams = new HeapMem.Params();4 M* e  v7 S* V: F
heapMemParams.size = 0x4000;3 }$ V! E# Z7 K* s) \  u

8 _4 z: ^# t9 g. }, z) ^/ K, q
2 C& p+ O" P7 x
var Memory = xdc.useModule('xdc.runtime.Memory');+ h8 X( E+ d% F3 ~0 l+ \  U
Memory.defaultHeapInstance = HeapMem.create(heapMemParams);; _- D3 O# h5 a! C! p9 _

( \1 d- l! L8 V3 N; t
7 M) _) v( c: Y5 k! Q
/* configure System module */
- o4 U/ }% \4 N0 p( mvar SysMin = xdc.useModule('xdc.runtime.SysMin');
+ d; B! w5 Y2 P( ^5 XSysMin.bufSize = 0x1000;6 j( m6 a6 |5 ^
SysMin.flushAtExit = false;
: ~2 i9 l" v1 ?' B( s" y% B$ y0 {! f. q

; b( U. s) R$ `  D, i, W$ \( t8 Svar System = xdc.useModule('xdc.runtime.System');  i4 m2 ]1 D2 M4 B, ~, p5 n
System.SupportProxy = SysMin;1 f$ G- f# P8 L% O  ?( [9 I* u
  n7 _3 ^3 x" j

  y7 i0 L: g2 f5 X- v% T/* configure SysBios to use the lower half of Timer 1 */" d/ I, N+ v8 F$ R/ a8 @$ q* c
var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer');, h4 i6 ~4 s9 [% y$ t
var Clock = xdc.useModule('ti.sysbios.knl.Clock');- t( q# G5 S6 A, G# Z
Timer.timerSettings[1].master = true;
: Y$ ^8 ?. M; ]Timer.defaultHalf = Timer.Half_LOWER;
- e3 n* D1 P: M1 ~4 Z+ hClock.timerId = 1;1 _) N9 c4 Q0 b9 r" J' ^& Q

# J" b8 y8 p  _. R* G2 B
) w* [$ ?) D. {0 U8 h$ F6 }4 c, v$ I8 p$ Q/ a& \6 Z
, a4 f/ s6 N1 l; P9 I
分享到:  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-11-5 05:11 , Processed in 0.040279 second(s), 24 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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