cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 6 MCU

JeHu_3414236
Contributor II

The release note says there is this change in SysPM:

SysPM callbacks

In the AFTER_TRANSITION mode the SysPM callbacks are executed in the sequence from last executed to the first registered instead of from last to the first registered.

The cy_syspm.* files are the same as 3.0.3.  Is the change from the release note in the source code somewhere?  I was given a temporary fixed cy_syspm.c for the mentioned problem for 3.0.3 and those changes are not in 3.0.4.

0 Likes
1 Solution
Anonymous
Not applicable

Sorry, this information is not a change, this is a "Design Impact" section.

This section describes what is not working well.

Related to the SysPm driver, the issue is the callbacks with AFTER_TRANSITION mode should be executed from last registered to the first registers. But in reality the callbacks with AFTER_TRANSITION mode are executed from last executed to the first registered.

Andriy

View solution in original post

0 Likes
10 Replies
ShipingW_81
Moderator
Moderator

Yes, the cy_syspm.* files are identical between the two versions even though the release note marks the difference. I will check further for this issue.

0 Likes
Anonymous
Not applicable

Sorry, this information is not a change, this is a "Design Impact" section.

This section describes what is not working well.

Related to the SysPm driver, the issue is the callbacks with AFTER_TRANSITION mode should be executed from last registered to the first registers. But in reality the callbacks with AFTER_TRANSITION mode are executed from last executed to the first registered.

Andriy

View solution in original post

0 Likes
Anonymous
Not applicable

Hi Andriy,

Could you clarify the difference between the last registered callback and the last executed callback? If callbacks are executed in the order that they are registered, shouldn't the last executed callback also be the last registered callback?

Best Regards,

Steve

0 Likes
MeenakshiR_71
Employee

Steve,

Yes the last registered callback is mostly what is executed last. But in our SysPm driver, the callbacks can be skipped for certain transitions like BLE deep sleep callback is not executed for AFTER_TRANSITION state. So the update to the PDL makes sure, it checks from last registered callback in a given transition state rather than last executed callback as some callback might have been skipped for the previous transition and hence last executed callback may have wrong data and might result skipping of some callbacks in the current transition callbacks.

Let me know if you need more clarification on this. This is a fix for an issue reported by you here - https://community.cypress.com/message/160856?et=watches.email.thread#160856 

Regards,

Meenakshi Sundaram R

Anonymous
Not applicable

Hi Meenakshi,

Modification to the cy_syspm.c file doesn't seem to fix the issue anymore for PDL 3.0.4. We've modified three lines of code: 2238, 2245, 2261 as done previously. We've attached the file that we've modified for reference. Do additional modifications need to be made for PDL 3.0.4?

Best,

Steve

0 Likes
MeenakshiR_71
Employee

Steve,

I got clarification from Andriy that the update is only to inform the user about the issue i.e. a release note update. The actual fix is planned in the next version of the PDL release.

So you will still need the change for it to work in your code.

Regards,

Meenakshi Sundaram R

0 Likes
Anonymous
Not applicable

Meenakshi,

Are the changes still the same as the previous PDL version? We noticed that cy_syspm.c had some modifications since the last PDL. But we've modified the 3 lines of code as before from the previous PDL version - could you verify our file that we've attached? The modifications were made to lines 2238, 2245, and 2256.

Best,

Steve

0 Likes
MeenakshiR_71
Employee

Steve,

I did check your file and yeah I think that should work but note that in this case both before/after deep sleep callbacks execute in the same order and the order is the order in which they were registered.

Regards,

Meenakshi Sundaram R

0 Likes
Anonymous
Not applicable

Hello Steve,

As Meenakshi mentioned some callbacks can be registered but not executed (skipped). In this case the last executed and last registered callbacks would be different. If none of callbacks are skipped than the last registered and last executed callback are the same.

About callbacks execution order:

1) The callbacks are executed in the order "from first registered to last registered" in  CY_SYSPM_CHECK_READY and CY_SYSPM_BEFORE_TRANSITION modes. These modes are executed before device enters into low-power mode.

2) The callbacks are executed in order from "from last executed to the first registered" with CY_SYSPM_CHECK_FAIL mode, to undo the changes which were done in CY_SYSPM_CHECK_READY (if any actions were done).

3) The callbacks should be executed "from last registered to the first registered" in CY_SYSPM_AFTER_TRANSITION mode to revert changes done in CY_SYSPM_CHECK_READY and CY_SYSPM_BEFORE_TRANSITION. But in PDL 3.0.4 we found bug and this behavior is not followed. The behavior is that in CY_SYSPM_AFTER_TRANSITION the callbacks are executed in " from last executed to the first registered".

Also you can find useful information about SysPm callbacks in PDL API ref manual. It can be found in doc folder of installed PDL:

c:\Program Files (x86)\Cypress\PDL\3.0.4\doc\pdl_api_reference_manual.html

Go to Cypress Peripheral Driver Library (PDL)->API Reference->System Power Management (SysPm)->SysPm Callbacks (section)

Regards,

Andriy

Anonymous
Not applicable

Thank you Meenakshi and Andriy - that cleared up a lot of things.

Best,

Steve

0 Likes
Top labels