Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing flash operations with gcc -O3 #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eboon-minebea
Copy link

By creating this pull request you agree to the terms in CONTRIBUTING.md.
https://github.com/Infineon/.github/blob/master/CONTRIBUTING.md
--- DO NOT DELETE ANYTHING ABOVE THIS LINE ---

CONTRIBUTING.md also tells you what to expect in the PR process.

Description

When compiling for PSoC4 with GCC and compile flag -O3, flash operations fail because CPUSS_SYSARG is read out too closely after CPUSS_SYSREQ has been set. Using two __NOP()s instead of one after setting CPUSS_SYSREQ is sufficient to overcome this.

Related Issue

None

Context

The problem was observed on proprietary hardware with a PSoC4 S Max and on a Rutronics RDK4 evaluation board.
The value of CPUSS_SYSARG in ProcessStatusCode() was neither SROMCODE_SUCCESS nor SROMCODE_ERROR_FLAG and thus ProcessStatusCode() returned CY_FLASH_DRV_OPERATION_STARTED, even though CY_FLASH_NON_BLOCKING_SUPPORTED was not set.
Adding the extra __NOP()s apparently gives the processor enough time to update the CPUSS_SYSARG register.

…h operations fail because CPUSS_SYSARG is read aout too closely after CPUSS_SYSREQ has been set. Using two NOP()s instead of one after setting CPUSS_SYSREQ is sufficient to overcome this.

Tested and verified on RDK4 demo-board.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant