TI中文支持网
TI专业的中文技术问题搜集分享网站

关闭GPTtimer power domain则clock不唤醒standby

应用场景:

CC2640R2_LAUNCHXL

使用GPTtimer产生脉冲,然后下降沿触发中断,关闭GPTtimer,Power_releaseConstraint,Power_releaseDependency,使用Clock_start开启定时,随后任务sleep进入standby,clock唤醒然后打开GPTtimer产生脉冲。。。。。

问题:

产生脉冲之后,clock似乎并没有唤醒并进入中断,试验发现如果不在产生完脉冲之后使用Power_releaseDependency,则可以正常工作。

1.Power_releaseDependency应该是关闭了GPTtimer的电源模块,为什么会对clock有影响?应该不是一个时钟源吧。

2.若GPTtimer后仅使用Power_releaseConstraint而不使用Power_releaseDependency是否还能进入standby?

Felix ZF:

关于Power_setConstraint,Power_releaseConstraint,Power_setDependency和Power_releaseDependency的说明,可以在

file:///C:/TI/simplelink_cc13x0_sdk_2_40_00_20/docs/tidrivers/doxygen/html/_power_8h.html#acc3b76add2f8fadd70bb747d7dd0f8e8

中找到。

从你描述的过程来看,clock第一次产生了中断,触发GPTimer产生脉冲,之后clock就不再产生中断了,是这样吗?

你的clock是怎么设置的,是设置的周期性的还是一次性的?clkParams.period设置的多少?如果是设置的一次性clock,则需要再次Clock_start,重新开启下一次定时。

§ Power_setConstraint()

int_fast16_t Power_setConstraint
(
uint_fast16_t 
constraintId
)

Declare an operational constraint.

Before taking certain actions, the Power Manager checks to see if the requested action would conflict with a client-declared constraint. If the action does conflict, Power will not proceed with the request. This is the function that allows clients to declare their constraints with Power.

Constraint identifiers are device specific, and defined in the device-specific Power include file. For example, the constraints for MSP432 are defined in PowerMSP432.h.

Only one constraint can be specified with each call to this function; to declare multiple constraints this function must be called multiple times.

Parameters

constraintId
constraint id

ReturnsCC26XX/CC13XX only: Power_SOK. To minimize code size an assert is used internally to check that the constraintId is valid; the function always returns Power_SOK.All other devices: Power_SOK on success, Power_EINVALIDINPUT if the constraintId is invalid.See alsoPower_releaseConstraint

§ Power_releaseConstraint()

int_fast16_t Power_releaseConstraint
(
uint_fast16_t 
constraintId
)

Release a previously declared constraint.

This function releases a constraint that was previously declared with Power_setConstraint(). For example, if a device driver is starting an I/O transaction and wants to prohibit activation of a sleep state during the transaction, it uses Power_setConstraint() to declare the constraint, before starting the transaction. When the transaction completes, the driver calls this function to release the constraint, to allow the Power manager to once again allow transitions to sleep.

Constraint identifiers are device specific, and defined in the device-specific Power include file. For example, the constraints for MSP432 are defined in PowerMSP432.h.

Only one constraint can be specified with each call to this function; to release multiple constraints this function must be called multiple times.

It is critical that clients call Power_releaseConstraint() when operational constraints no longer exists. Otherwise, Power may be left unnecessarily restricted from activating power savings.

Parameters

constraintId
constraint id

ReturnsCC26XX/CC13XX only: Power_SOK. To minimize code size asserts are used internally to check that the constraintId is valid,valid, and that the constraint count is not already zero; the function always returns Power_SOK.All other devices: Power_SOK on success, Power_EINVALIDINPUT if the constraintId is invalid, and Power_EFAIL if the constraint count is already zero.See alsoPower_setConstraint

§ Power_setDependency()

int_fast16_t Power_setDependency
(
uint_fast16_t 
resourceId
)

Declare a dependency upon a resource.

This function declares a dependency upon a resource. For example, if a UART driver needs a specific UART peripheral, it uses this function to declare this to the Power Manager. If the resource had been inactive, then Power will activate the peripheral during this function call.

What is needed to make a peripheral resource 'active' will vary by device family. For some devices this may be a simple enable of a clock to the specified peripheral. For others it may also require a power on of a power domain. In either case, the Power Manager will take care of these details, and will also implement reference counting for resources and their interdependencies. For example, if multiple UART peripherals reside in a shared serial power domain, the Power Manager will power up the serial domain when it is first needed, and then automatically power the domain off later, when all related dependencies for the relevant peripherals are released.

Resource identifiers are device specific, and defined in the device-specific Power include file. For example, the resources for CC32XX are defined in PowerCC32XX.h.

Parameters

resourceId
resource id

ReturnsCC26XX/CC13XX only: Power_SOK. To minimize code size an assert is used internally to check that the resourceId is valid; the function always returns Power_SOK.All other devices: Power_SOK on success, Power_EINVALIDINPUT if the reseourceId is invalid.See alsoPower_releaseDependency

§ Power_releaseDependency()

int_fast16_t Power_releaseDependency
(
uint_fast16_t 
resourceId
)

Release a previously declared dependency.

This function releases a dependency that had been previously declared upon a resource (by a call to Power_setDependency()).

Resource identifiers are device specific, and defined in the device-specific Power include file. For example, the resources for CC32XX are defined in PowerCC32XX.h.

Parameters

resourceId
resource id

ReturnsCC26XX/CC13XX only: Power_SOK. To minimize code size asserts are used internally to check that the resourceId is valid, and that the resource reference count is not already zero; the function always returns Power_SOK.All other devices: Power_SOK on success, Power_EINVALIDINPUT if the resourceId is invalid, and Power_EFAIL if the resource reference count is already zero.See alsoPower_setDependency

xin wang22:

回复 Felix ZF:

感谢提供资料。

我是两个中断交替发生的,在pwm触发的中断中会关闭pwm开启clock,在clock触发中断中关闭clock开启pwm。clock肯定是每次都打开的,因为在不进入standby的时候工作正常。

另外我还有个问题,就是如果在当前任务中进入使用sleep挂起1s进入standby,但clock设置唤醒时间小于1s是否还能唤醒standby?

Felix ZF:

回复 xin wang22:

clock会在小于1s的时间后唤醒系统。

如果你只有一个task,且这个task使用sleep(1s),那么即使clock在小于1s的时间内唤醒系统,因为这个task要在1s后才会继续执行,所以你看不出clock唤醒系统的效果。

你可以使用event_pend或semaphore_pend替代sleep来讲task挂起,然后再clock的callback中set event或semaphore。

xin wang22:

回复 Felix ZF:

那如果此任务被挂起,那在此任务中注册的中断会被响应吗?因为程序standby后没有进入到clock触发的中断

xin wang22:

回复 Felix ZF:

好的,因为想用ti的ble并且实现其他协议栈,不知道这其中有没有ble相关任务调度的讲解还是有其他资料?

赞(0)
未经允许不得转载:TI中文支持网 » 关闭GPTtimer power domain则clock不唤醒standby
分享到: 更多 (0)