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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

4

主题

9

帖子

56

积分

注册会员

Rank: 2

积分
56
跳转到指定楼层
楼主
发表于 2017-4-7 16:58:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
[color=inherit !important] 我们这边用的你们的开发板,测试双核功能,目前遇到的问题是:
$ I' `& `. q9 J$ Z/ m( v1 I7 k3 z0 R[color=inherit !important]1.ARM端Linux 系统正常进入到文件系统中1 s0 ?1 y' l, X# }
[color=inherit !important]
& }7 ~6 P  s8 n6 h) B$ c9 K
3 F+ C' u0 q% Z0 @# f7 L
[color=inherit !important]2.DSP端运行基于sysbios的工程,在工程中通过如下设置定时器2, N$ [, {3 }  t9 e
[color=inherit !important]
! N. j7 ?. Z/ |( Y8 f5 m4 w
7 G9 ?; W( h- J( w
timerParams.period = 500;
& @( y1 P9 v2 a6 \# X- W4 btimerParams.periodType = Timer_PeriodType_MICROSECS;
& H+ M8 K0 Q/ h( r5 Y9 |
Timer_create(2, Timer2Proc, &timerParams, &eb);
! D6 w# i; q1 D9 C* p
: s5 {7 M( R9 U( U, K

, T0 {# `. Z; i& |% w8 p1 w3.然后在定时器Timer2Proc()中断函数中进行翻转GPIO的操作,然后用示波器去看GPIO的波形,发现产生的波形周期为960us(正常应该是1000us);# F4 r* S* X8 i( ?' W0 w$ N1 K  z
产生了定时器定时周期和我预设的周期值不一样。附件是我dsp.cfg文件(只能上传一部分)。请教一下这个问题是什么原因导致的,如何解决,谢谢。0 O- W- N2 _9 g4 X4 d, `! V

1 i1 o, _+ k- n5 k

# ^+ a* W4 K( [8 O# K
* s% q8 r: Z& H0 y) |9 A, v/ ]$ n/*
3 d% m7 e+ p; X! p *  ======== Dsp.cfg ========2 K" e( o$ a+ E; r  U
*  u( L$ o5 V1 J0 J
*/
* s2 y' e. a( ^' ~9 d' E) S1 O
1 |2 k$ w) z) ]3 l+ W% c2 p) U
7 a  U( r, s" p
/* root of the configuration object model */8 c$ N4 P! ^  d7 S
var Program = xdc.useModule('xdc.cfg.Program');$ O' H6 `% g  P; Z" L" ~
1 W$ ^2 F$ l2 k% ~% T% U, c* g

. r- M* r+ o3 @  `: X* r5 `1 K7 N/* application uses the following modules and packages */
, E) U, ]% [' x8 G: j# T% L" T, wxdc.useModule('xdc.runtime.Assert');) h; i" v8 F: ?6 n5 J  I9 x
xdc.useModule('xdc.runtime.Diags');3 Z( C/ t# k1 K
xdc.useModule('xdc.runtime.Error');$ m- ~% D$ N8 X1 Y  j5 T
xdc.useModule('xdc.runtime.Log');! K* _: i. k; \# @# m5 ~+ L; q
xdc.useModule('xdc.runtime.Registry');7 }6 ~# I0 }- f% s/ h* u

0 N9 Q7 w; e; w9 K. Y$ q( M7 A* U
0 K0 j) j* M/ C, I5 p9 P" e
xdc.useModule('ti.sysbios.gates.GateHwi');$ I5 E8 W* ~. m  B& a2 i0 F
xdc.useModule('ti.sysbios.knl.Semaphore');* V8 R  O/ w4 D' G3 e+ C- y
xdc.useModule('ti.sysbios.knl.Task');
( }( f, w- y/ A' q8 u2 h. E9 T' L
  h4 l; @$ q  D( y- y- V" m
! R; j- ~. p, F
. R, n# N+ g) |0 x5 m
; O. Z+ w8 D2 L: A; g8 L$ i: l
0 ?) z* K' F/ h9 `4 `0 k$ P

) m3 D) A* o. J: s  ?

0 J" D& E; k6 Z  \/ B9 hvar BIOS = xdc.useModule('ti.sysbios.BIOS');& l" {4 ^0 s& q5 L
BIOS.libType = BIOS.LibType_NonInstrumented;
, U$ I: x( H. Z% H2 _. L$ q- M9 F# w/ W7 C
  W$ W6 [1 u- M  p8 n: @6 U

. Y$ V& ]3 }! I6 Q8 ^! N7 Hxdc.useModule('ti.syslink.ipc.rtos.Syslink');; g6 _" s8 k) y4 L+ L

: \4 C: ]/ B4 a
% G5 `& `* I& Z1 Z) Q. k

$ O) \2 E( M  y( ^, K2 c- hvar MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
: b: R( q, r- {! T$ K# ?3 R: Xvar procNameAry = MultiProc.getDeviceProcNames();
4 e4 V9 W% w: s3 UMultiProc.setConfig("DSP", procNameAry);, s. ~/ v5 d& l. H

: S- u' Q( D) l6 S1 L

! ]6 [) B+ r, I1 u& V' _
4 R8 k+ p; t% q  _3 W/ k. K8 Evar Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
/ R2 ~0 V  P6 ^( k4 o. x2 b8 E: e$ C& w  l
: ^( g0 _' w* }$ X9 }
8 ^, U* B& ?0 L/ ?/ j+ ?
Ipc.sr0MemorySetup = false;
3 S1 g  H$ X/ e5 U: B" N0 G/ [3 R; O- c, p& \3 f

! H7 t0 l( E8 R' R9 e- t' Z3 q# z. ^! w
Ipc.procSync = Ipc.ProcSync_PAIR;" D6 B) S3 T7 t' Q( ]

  m  D1 {4 `1 p- h* O" N

+ ]5 Z; M5 s3 N* h/* define host processor */6 r) j' ~5 z$ \" I. i3 \; n
Ipc.hostProcId = MultiProc.getIdMeta("HOST");( A1 d, F5 v9 d. ^$ o. ?' L5 ^% \
4 y/ s* ~" a8 B6 F5 b( q( F5 I( O) ^

3 B! N# W; `$ U0 H/* shared region configuration */
3 G& v* k; J2 ^5 D5 Avar SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');; n! A. J  P4 K5 o
3 h8 k2 b* K2 W0 o  `0 L( U

  D5 x  C" C$ H# O# G8 c( n/* configure SharedRegion #0 (IPC) */9 u* p/ s3 L# H+ B
var SR0Mem = Program.cpu.memoryMap["SR_0"];- u: F& y$ C' G

4 K6 T! J6 Q5 l

- w- d8 L4 I8 `# G, MSharedRegion.setEntryMeta(0,& _8 E% E( W" A/ r. B
    new SharedRegion.Entry({0 J: X! y8 N& p. i; _7 L, k
        name:           "SR0",+ K( g8 k! }- f- v0 M8 A& q
        base:           SR0Mem.base,1 t& G- S0 ^2 o' B1 H" x) f* B5 W
        len:            SR0Mem.len,6 \3 C4 Q5 a3 l0 Z
        ownerProcId:    MultiProc.getIdMeta("HOST"),: R! a# ~, n1 X: b2 N
        cacheEnable:    false,
8 l: J4 S1 [3 M/ U! F" H, |( C        isValid:        true
, v8 L2 h7 {: p2 k. k' J# A( s    })
  b6 z) U/ s# ~% r);) N  B. j% p( j6 T' l. `; F
0 O: F2 q2 `( o
, B# X9 Q; `, Y9 V+ [/ W! o' S

* q; O% g6 f7 G) d' B! {2 ^
7 f& b9 D' s/ p

! W0 A) R/ C, ?Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');, a% Q0 D* k: H, h# q
Cache.MAR192_223   = 0x00000008;  /* xxxx xxxx xxxx xxxx xxxx xxxx xxxx 10xx */
1 k7 ]# y, z  Q. z) o" U0 f& Q8 l& ^1 T8 Z$ H3 R3 z3 f
2 ~1 {6 b" t  ?1 h$ s5 A
% d) r; e) o- ~) N4 n

4 p/ ~2 h8 |/ I/ @# B" |/*
+ [% R+ ~0 A3 y8 j& o1 y *  ======== Operating System Configuration ========* s7 G1 p% w+ e4 v
*/
$ X1 d3 H- p: k
0 A: W4 Y& |( z

. f. ~' T' x8 [/* no rts heap */7 Y( w, _9 U" a* O& I% _9 {
Program.heap = 0;' s) Y) ~* {# p  c8 e- b+ ^# w" V$ L
Program.argSize = 100;  /* minimum size */; r* ~3 b1 `, u8 O2 `9 P( @9 Z
Program.stack = 0x1000;
+ m8 b8 T, G& Q' g! n- k$ s7 V! [+ T6 H& E/ l6 G7 h9 i/ V( j
0 }' q0 E4 o% {4 n1 x& g
/* create a default heap */
+ a* d! W+ a$ _8 \var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
1 }. g1 J) D0 s$ K, R  v0 s* Vvar heapMemParams = new HeapMem.Params();9 Z6 i3 D2 X+ d( b# L
heapMemParams.size = 0x4000;# a& v2 d: S6 w$ y: f* L! a6 K9 Y0 K8 b

* y8 I$ Y5 K3 Q, j' z

% a0 F1 f8 A2 D, x3 F  n! G. bvar Memory = xdc.useModule('xdc.runtime.Memory');) M$ W: |5 I$ B) A, x9 ?
Memory.defaultHeapInstance = HeapMem.create(heapMemParams);
& {  E: {2 C+ [5 O8 \$ m( l3 r5 m6 A. K  z
( W+ r5 R( D2 U
/* configure System module *// b# \8 y4 P, Q4 c, P$ q
var SysMin = xdc.useModule('xdc.runtime.SysMin');- j7 [: W/ ]# ^) {3 @1 U7 v3 w
SysMin.bufSize = 0x1000;
# C2 P6 W+ _* d2 O: \* a+ oSysMin.flushAtExit = false;
" f6 Y6 k1 b3 j/ g5 u' z$ u9 Q2 [% }9 p- ^6 N
% G, B8 }5 E2 C; T
var System = xdc.useModule('xdc.runtime.System');
- f7 r0 s( L9 p3 M- g! @# ESystem.SupportProxy = SysMin;
' `2 U: d* n# W8 K6 E/ h
1 l1 V' Q; n% j% Z3 i& K

* m1 I9 x# I3 d, r/* configure SysBios to use the lower half of Timer 1 */* ^" m/ b* y1 W. L; t
var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer');
9 {, E6 \, ]3 p% l+ o7 Bvar Clock = xdc.useModule('ti.sysbios.knl.Clock');
& K# A+ y  ~8 K- s, FTimer.timerSettings[1].master = true;( S& y+ N: r' P( f5 [
Timer.defaultHalf = Timer.Half_LOWER;
4 \6 H: w& o3 g1 O" hClock.timerId = 1;
8 F. S8 C' |) R
2 c' s( g7 h' l4 m. ^! y
6 c# ?- C+ H+ p' b' S6 ~. I, d5 q1 F7 J7 U, a# \) _$ E7 ?! W

5 \) w1 }0 {9 Z+ S  G3 D' n
分享到:  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-9-19 07:37 , Processed in 0.040959 second(s), 24 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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