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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

4

主题

9

帖子

56

积分

注册会员

Rank: 2

积分
56
跳转到指定楼层
楼主
发表于 2017-4-7 16:58:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
[color=inherit !important] 我们这边用的你们的开发板,测试双核功能,目前遇到的问题是:) l7 f4 u1 y1 N
[color=inherit !important]1.ARM端Linux 系统正常进入到文件系统中
: f# L" {% x5 k6 s4 ]1 Q5 m[color=inherit !important]
' ]! z8 P5 q# {3 Z+ a

* i, s8 ^, K. \7 q[color=inherit !important]2.DSP端运行基于sysbios的工程,在工程中通过如下设置定时器2* `* U+ S5 I, q2 V3 D7 j
[color=inherit !important]
% n) [6 L  C) X* |( {2 T# b( M. ^
1 e( L8 s5 c6 S5 D& j
timerParams.period = 500;
  J# q. P3 W( [5 B% ]$ k1 J" a+ RtimerParams.periodType = Timer_PeriodType_MICROSECS;

3 g( i+ V( t. lTimer_create(2, Timer2Proc, &timerParams, &eb);2 A' _0 m) r+ h% k# k
  U2 i$ U: A( v7 C8 D9 n1 B

4 s  w5 P, i$ M% X$ m+ f3.然后在定时器Timer2Proc()中断函数中进行翻转GPIO的操作,然后用示波器去看GPIO的波形,发现产生的波形周期为960us(正常应该是1000us);
1 o# `6 y' j3 {$ S7 t0 Q- z" E产生了定时器定时周期和我预设的周期值不一样。附件是我dsp.cfg文件(只能上传一部分)。请教一下这个问题是什么原因导致的,如何解决,谢谢。
" S  a  V& s9 ]' F
" d( ?6 P- D3 w6 ]9 E
4 Q! @# B$ ]+ o  k9 r/ F4 U" N

: }/ q* q9 y2 [7 p* C/*, O3 T# x9 Y3 i, ]$ x2 e9 c0 T
*  ======== Dsp.cfg ========
  Y8 X3 {# ~" e5 | *
" ~; Y+ u: P! H$ D/ X */7 L$ W0 y' k0 U4 {8 r

1 P8 T3 y# J7 Y- x1 R
7 K/ C. D1 J  y2 n5 K. i$ C* r# b
/* root of the configuration object model */
0 c2 N: v, z0 F) g; yvar Program = xdc.useModule('xdc.cfg.Program');
6 W( D* h; B' J6 S$ N
* H# U- Q6 Y/ G/ }2 I& u; B7 e, c
; G8 z2 A  F  {7 s. L
/* application uses the following modules and packages */
$ T8 c1 ~4 S# U" P+ O. z* T  lxdc.useModule('xdc.runtime.Assert');
' B' \0 B- W5 Wxdc.useModule('xdc.runtime.Diags');
- y/ H" @! R8 F; Q0 Bxdc.useModule('xdc.runtime.Error');' s% w; u' B' V% p) Y" G
xdc.useModule('xdc.runtime.Log');
9 ^$ j$ f; Z7 h# e& Q$ d0 _xdc.useModule('xdc.runtime.Registry');
, ]/ |: T, E  @1 Z5 ?4 F( c5 g: j+ e+ G. |8 C  j8 }& m# q
  T9 C3 T  M6 O3 \( D) o
xdc.useModule('ti.sysbios.gates.GateHwi');
& c" J7 a" b+ G2 axdc.useModule('ti.sysbios.knl.Semaphore');( a9 t1 M5 S! Z
xdc.useModule('ti.sysbios.knl.Task');: i3 k9 Y8 K' Q7 K1 E, N' A4 Y

5 A" c4 Y0 v  T; V  o3 r. _
4 C6 J6 W7 t* ~8 R1 y6 H" m

3 V% [' p# O" r- ?7 ?- j2 o
' k! e! W$ G1 U9 }$ o8 V
4 u. B0 d! w& [* p0 Z4 {
2 S& r& ~/ z/ r
- `& m1 B5 B; P
var BIOS = xdc.useModule('ti.sysbios.BIOS');; R7 f; \$ f. X4 k  U
BIOS.libType = BIOS.LibType_NonInstrumented;( c, s% M- ]& S1 B( d- b

( j+ u- |$ A! V. K) e

' E$ ?) f3 x. k( w: `1 A2 J& }2 a: n4 s. k' o2 H" q1 a* O
xdc.useModule('ti.syslink.ipc.rtos.Syslink');
0 x! a; h& [. m6 a. {4 D" K& ~% V3 _/ `6 `
: S0 x  D  b" R( o
4 j% s  q% K1 J7 u2 s$ w  @5 X
var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');% s- h. e# n! g- x; @4 F. S; {
var procNameAry = MultiProc.getDeviceProcNames();/ O0 w7 y% X& u$ T; y3 k) k1 a
MultiProc.setConfig("DSP", procNameAry);
* k' c  P; H" P' ]: M* s: C- s: n; X8 b

2 j+ f) d$ c2 T5 c$ I# ]! n* Z% B. e
var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
* j9 X) ^& e, g( Q0 y5 U( ?% k# j2 M& T& w" M# r' ~; M
) k9 J# t/ }# r9 P% C
  a7 a4 H$ b0 \* ~, a5 j6 d
Ipc.sr0MemorySetup = false;
& D( N1 K3 e9 D2 l$ y* q7 {
$ A( }- X% d, M! `$ C# p' i/ m
1 o# s2 P: n+ W  ?. m) _

4 F( h3 `& P/ i& ?% ~! h2 ]Ipc.procSync = Ipc.ProcSync_PAIR;
/ @# x0 [" \" M3 {
% {* J+ ?. _7 @. l. @

, z2 o* k; t$ B; P/* define host processor */
1 g8 I9 w0 P9 |4 [8 `9 WIpc.hostProcId = MultiProc.getIdMeta("HOST");0 _" t# a4 j2 U# I
4 E/ g- \; n. A& ^. x9 C

8 a" n0 A& {, Q, D5 h* L/ n0 r/* shared region configuration */6 Q1 s: z: G3 }
var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
! S( ?  Y. U9 T- }; R% E
3 V3 O5 [7 `: L7 G! \2 Q
1 R9 _7 ^4 L9 Q. \& v: g* n/ D$ y
/* configure SharedRegion #0 (IPC) */
7 I8 R- o8 m$ l: j# t/ `var SR0Mem = Program.cpu.memoryMap["SR_0"];
: K* \; c' \; K4 C6 Q. P* g) N" Z7 P6 K8 M
' I- I, [9 U  `- x' `9 l, s. W
SharedRegion.setEntryMeta(0,* n* n9 F" i" E
    new SharedRegion.Entry({9 l6 S3 f0 a  h: U  p
        name:           "SR0",
! O0 ]3 ]0 ^1 ^/ k        base:           SR0Mem.base,- ^4 k. F7 ^+ h: \
        len:            SR0Mem.len,6 D$ S/ W5 }& I% b
        ownerProcId:    MultiProc.getIdMeta("HOST"),
( [, ~9 t* v2 ?        cacheEnable:    false,
9 s7 {% `0 U. B5 ^        isValid:        true
# d- B6 J# f: |$ z    })
% I  h. L2 I9 c; g' F);
$ `3 _  r) g+ N) G5 X( {
) O6 p8 E2 R: A5 I
! g, t" u* u' M- N& E* z
" P7 o( N0 U9 }+ B1 c5 A

# V- J& \9 Q) O) i
# o6 T" R  c, _
Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');
5 k- Q+ i9 l6 V- kCache.MAR192_223   = 0x00000008;  /* xxxx xxxx xxxx xxxx xxxx xxxx xxxx 10xx */
& n" B/ Q  v. O* Z; u" x5 i
$ S$ e, t) s# G, a

; i$ i7 y' G% M" U# D3 U2 j1 O0 O5 j7 ]9 H+ G% C: u+ k

4 U, e% Q0 {4 @/ Y/ L' B2 a/ m8 Z/*
1 j  c  ~: _  ^) L# g$ t! L *  ======== Operating System Configuration ========
$ h- a1 F* a5 _9 n- x3 q' X */
8 e# `$ b2 t% _6 y8 s- m% O. K$ L
/ {  d) k# g- c6 y
8 @* k% Z* S# @3 D
/* no rts heap */
+ b7 P+ @' r" A  xProgram.heap = 0;
$ y7 C2 {5 r1 ^, s8 h* _Program.argSize = 100;  /* minimum size */1 @# ?" F0 F9 j7 `8 B& i
Program.stack = 0x1000;! J2 k& S; z8 T/ o# y! }

) Z. u: t& X( h8 Y3 s
- _; `: |) j& ], M9 e- U
/* create a default heap */) s; o# j& @6 l' |
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');( H3 z4 Q7 Q( R7 v! t+ Y; [. D
var heapMemParams = new HeapMem.Params();
% N9 @0 t/ T# w+ K: RheapMemParams.size = 0x4000;
3 h; Y5 ]* Y8 E4 z% w8 p0 b+ x/ g; J1 Q( d0 Z- w4 T
7 T( [; n8 _) r0 R  V
var Memory = xdc.useModule('xdc.runtime.Memory');2 L* u& b8 S+ R+ m1 r. @
Memory.defaultHeapInstance = HeapMem.create(heapMemParams);
' \( [2 y3 D6 z8 _
: t7 E9 J% Y2 R( M5 p' J) Z

- J" d- X+ O) Z" T! I/* configure System module */6 m' ^: D' I4 Z: Q; u
var SysMin = xdc.useModule('xdc.runtime.SysMin');
, E3 ~& \' u6 @9 z# Z* L: rSysMin.bufSize = 0x1000;
3 i9 J: a" h, V( M2 U) Q' n% NSysMin.flushAtExit = false;
# o: b# L) c3 ~: s, F3 e/ W# ]3 O  e# j+ v7 s- l
4 I; g6 i  \  ?' H+ z/ f
var System = xdc.useModule('xdc.runtime.System');
6 s1 N7 k5 l+ Z, X* _1 u# WSystem.SupportProxy = SysMin;$ T  L3 C- g. `, w1 j7 I
" \$ q/ R  b. X+ N8 @" Q
: y- O1 P7 Y' B+ K$ `
/* configure SysBios to use the lower half of Timer 1 */
. D1 q: r  u" T3 Gvar Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer');* \9 h$ c0 [6 a$ t* @4 _
var Clock = xdc.useModule('ti.sysbios.knl.Clock');: B( s# ?+ j$ `! P
Timer.timerSettings[1].master = true;: i( ?2 P* X7 ^' v
Timer.defaultHalf = Timer.Half_LOWER;
4 ]% F) l- E" _5 [, u, y$ lClock.timerId = 1;5 A0 v  E- o& y0 r4 N8 M+ r. s
! [# v% j" y6 O- ]  n

" x4 |, Q& g* @
% N& ?' ?3 D0 ^+ \$ q9 F
# C4 B* M) q- y2 j" u! b7 Z
分享到:  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-4-30 16:59 , Processed in 0.039920 second(s), 24 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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