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

Add octospim support for octospi #3102

Merged
merged 17 commits into from
Oct 13, 2024
Merged

Add octospim support for octospi #3102

merged 17 commits into from
Oct 13, 2024

Conversation

HaoboGu
Copy link
Contributor

@HaoboGu HaoboGu commented Jun 21, 2024

This PR adds initial support for OCTOSPIM peripheral of octospi. Current implementation just adds OCTOSPIM to octospi, and enables corresponding pins of OCTOSPIM.

Closes #3097

@HaoboGu
Copy link
Contributor Author

HaoboGu commented Jun 23, 2024

I've tested this PR on stm32h7b0 + w25q64 qspi flash, worked well. But there are still limitations of current implementation:

  1. Current implementation supports OCTOSPI1 only. Different octospim register value should be configured for OCTOSPI1/2, but Ospi struct has no information about it.
  2. In build.rs, I also hardcoded OCTOSPI1 for pin_trait_impl.

@HaoboGu HaoboGu marked this pull request as ready for review June 23, 2024 11:47
@HaoboGu
Copy link
Contributor Author

HaoboGu commented Jun 25, 2024

Did more testing on a rm67162 qspi screen, worked too.

Demo project: https://github.com/HaoboGu/eg-demo

@ninjasource
Copy link
Contributor

Hi @HaoboGu, I managed to use your branch on an stm32h735g-dk to communicate with PSRAM through the hyperbus. However, I had to use OCTOSPI2 because of how the dev kit is wired up so I think it's worth trying to figure out how to support OCTOSPI2 as well. Are you still working on this branch?

@HaoboGu
Copy link
Contributor Author

HaoboGu commented Jul 3, 2024

@ninjasource Yeah, OCTOSPI2 is not support now. I had some problems when implementing it for both OCTOSPI1 and OCTOSPI2. For a temporary solution, you can change here and here to make it work for OCTOSPI2

@HaoboGu
Copy link
Contributor Author

HaoboGu commented Jul 4, 2024

I've pushed a commit making it possible to support both OCTOSPI1 and OCTOSPI2. But

Different octospim register value should be configured for OCTOSPI1/2, but Ospi struct has no information about it.

This problem is still there. @Dirbaio Do you have any suggestions on solving it?

@HaoboGu
Copy link
Contributor Author

HaoboGu commented Oct 12, 2024

Added a way to support both OCTOSPI1 and OCTOSPI2

@HaoboGu
Copy link
Contributor Author

HaoboGu commented Oct 12, 2024

This PR can be merged now.

Copy link
Member

@Dirbaio Dirbaio left a comment

Choose a reason for hiding this comment

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

thank you!

@Dirbaio Dirbaio added this pull request to the merge queue Oct 13, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 13, 2024
@Dirbaio Dirbaio added this pull request to the merge queue Oct 13, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 13, 2024
@Dirbaio Dirbaio merged commit 0222faa into embassy-rs:main Oct 13, 2024
6 checks passed
@ninjasource
Copy link
Contributor

Hi @HaoboGu, thanks for your work on octospim. However, I cannot find any examples I can test and your eg-demo linked above is a broken link. Do you have any examples for us to look at?

@HaoboGu
Copy link
Contributor Author

HaoboGu commented Oct 15, 2024

Hi @HaoboGu, thanks for your work on octospim. However, I cannot find any examples I can test and your eg-demo linked above is a broken link. Do you have any examples for us to look at?

Hey @ninjasource I just made the project public

@ninjasource
Copy link
Contributor

Hi @HaoboGu, thanks for your work on octospim. However, I cannot find any examples I can test and your eg-demo linked above is a broken link. Do you have any examples for us to look at?

Hey @ninjasource I just made the project public

Thanks!

I have raised an issue I encountered in your repo so as not to add noise to this closed repo.

Luctins pushed a commit to Luctins/embassy that referenced this pull request Oct 21, 2024
* feat: add octospim to ospi

Signed-off-by: Haobo Gu <[email protected]>

* feat: make octospim behind feature gate

Signed-off-by: Haobo Gu <[email protected]>

* refactor: fix fmt issue

Signed-off-by: Haobo Gu <[email protected]>

* refactor: fix ci failure

Signed-off-by: Haobo Gu <[email protected]>

* feat: add octospim reg writing code

Signed-off-by: Haobo Gu <[email protected]>

* feat(octospi): enable rcc for octospim at the initialization

Signed-off-by: Haobo Gu <[email protected]>

* fix: add octospim feature gate

Signed-off-by: Haobo Gu <[email protected]>

* fix: fix cfg flag

Signed-off-by: Haobo Gu <[email protected]>

* fix: fix rcc register on stm32l4 and stm32u5

Signed-off-by: Haobo Gu <[email protected]>

* feat(ospi): support OCTOSPI2 in build.rs

Signed-off-by: Haobo Gu <[email protected]>

* feat(ospi): add OCTOSPI2 pin impls

Signed-off-by: HaoboGu <[email protected]>

* feat(ospi): support both ospi instances in stm32 OCTOSPIM

Signed-off-by: Haobo Gu <[email protected]>

---------

Signed-off-by: Haobo Gu <[email protected]>
Signed-off-by: HaoboGu <[email protected]>
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.

Cannot create ospi instance for stm32h7b0
3 participants