Skip to content

Conversation

@rogeryou
Copy link
Contributor

@rogeryou rogeryou commented May 7, 2020

Summary of changes

Modify the operation of setting qspi frequency when calling Octo controller in qspi_api.c.
Because the value of hospi->Init.ClockPrescaler has been subtracted 1 in stm32l4xx_hal_ospi.c.

Impact of changes

N/A

Migration actions required

N/A

Documentation

N/A


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@rogeryou rogeryou force-pushed the macronix_qspi branch 2 times, most recently from f4e8fa8 to 90c1f89 Compare May 7, 2020 08:03
@rogeryou rogeryou closed this May 7, 2020
@rogeryou rogeryou reopened this May 7, 2020
@rogeryou rogeryou marked this pull request as ready for review May 7, 2020 08:16
@ciarmcom ciarmcom requested a review from a team May 7, 2020 09:00
@ciarmcom
Copy link
Member

ciarmcom commented May 7, 2020

@rogeryou, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@0xc0170 0xc0170 requested a review from a team May 8, 2020 07:23
0xc0170
0xc0170 previously requested changes May 8, 2020
Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you amend the commit - add there info why is this being modified, I dont understand the reasoning.

@rogeryou
Copy link
Contributor Author

rogeryou commented May 8, 2020

Can you amend the commit - add there info why is this being modified, I dont understand the reasoning.

div is for setting the prescaler,

捕获

If the div is 3, the value write to the controller register should be 2.
If the div is 4, the value write to the controller register should be 3.
So, we need div = div -1;
For ST QSPI controller driver , this value is set into the register directly, as the below code:

/* Configure QSPI Clock Prescaler and Sample Shift */

#if defined(QUADSPI_CR_DFM)
    MODIFY_REG(hqspi->Instance->CR, (QUADSPI_CR_PRESCALER | QUADSPI_CR_SSHIFT | QUADSPI_CR_FSEL | QUADSPI_CR_DFM),
               ((hqspi->Init.ClockPrescaler << QUADSPI_CR_PRESCALER_Pos) |
                hqspi->Init.SampleShifting  | hqspi->Init.FlashID | hqspi->Init.DualFlash));
#else
    MODIFY_REG(hqspi->Instance->CR, (QUADSPI_CR_PRESCALER | QUADSPI_CR_SSHIFT),
               ((hqspi->Init.ClockPrescaler << QUADSPI_CR_PRESCALER_Pos) |
                hqspi->Init.SampleShifting));
#endif

But for ST OSPI controller driver, before the value is set into the register , it will be subtracted 1, as the code below:
`
/* Configure clock prescaler */

     MODIFY_REG(hospi->Instance->DCR2, OCTOSPI_DCR2_PRESCALER, ((hospi->Init.ClockPrescaler - 1U) << OCTOSPI_DCR2_PRESCALER_Pos));

`

So, "div = div - 1;" should be removed.

@0xc0170
Copy link
Contributor

0xc0170 commented May 11, 2020

Part of the information should be in the commit message. @ARMmbed/team-st-mcd Please review

For ST OSPI controller driver(stm32l4xx_hal_ospi.c), the frequency it has be subtracted 1, so "div = div - 1;" should be removed.
@mergify mergify bot dismissed 0xc0170’s stale review May 25, 2020 04:16

Pull request has been modified.

@rogeryou
Copy link
Contributor Author

Part of the information should be in the commit message. @ARMmbed/team-st-mcd Please review

Hi,
I have modify the commit message about the reason.
Is there anything else I need to do ?

@jeromecoutant
Copy link
Collaborator

I have modify the commit message about the reason.
Is there anything else I need to do ?

@0xc0170

@adbridge
Copy link
Contributor

@0xc0170 are you ok with this now ?

@adbridge adbridge added needs: review release-type: patch Indentifies a PR as containing just a patch and removed needs: work labels Jun 11, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Jun 17, 2020

CI started

@mergify mergify bot added needs: CI and removed needs: review labels Jun 17, 2020
@mbed-ci
Copy link

mbed-ci commented Jun 17, 2020

Test run: SUCCESS

Summary: 6 of 6 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 merged commit 66343b0 into ARMmbed:master Jun 18, 2020
@mergify mergify bot removed the ready for merge label Jun 18, 2020
@adbridge adbridge added release-version: 6.1.0 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants