cancel
Showing results for 
Search instead for 
Did you mean: 

octospi configuration cubemx

JJuli.1
Associate II

I have octospi hyperram memory to use on stm32h7b0 with nor flash I usually use stm32cubemx because it make the life easier but it's my first time configuring memories with it..can anyone help me with that ?

1 ACCEPTED SOLUTION

Accepted Solutions
ChahinezC
Lead

Hello @JJuli.1​,

The parameters you cited are memory related ones which means they are specific to the memory used:

  • The memory type should be set based on the memory you are using, you can check the different types mentioned in the reference manual at the MTYP bits of the OCTOSPI device configuration register. The OCTOSPI interface on the STM32 devices do support as well other memories that follow the same protocols as the mentioned types. 
  • For the Chip select high time (CSHT), it defines the chip-select minimum high time in number of clock cycles, configured an you can set it based on the memory datasheet.
  • For the refresh rate, the chip select must go high each (REFRECH x OCTOSPI clock cycles), configured depending on the memory datasheet as well. 

Please mark my answer as best by clicking on the "Select as Best" button if it fully answered your question. This will help other users find this solution faster.

Thank you.

Chahinez

View solution in original post

10 REPLIES 10
ChahinezC
Lead

Hello @JJuli.1​,

You can use STM32CubeMX to configure both of the OCTOSPI interfaces present on the STM32H7B0.

There are some parameters to set that are related to the memory you are using and to the use case.

Regards,

Chahinez.

Ghofrane GSOURI
ST Employee

Hello @JJuli.1 

First let me thank you for posting.

Please check this LINK you will find information that could help you understand how to configure the OCTOSPI.

Thanks,

Ghofrane

JJuli.1
Associate II

thank you for your responses, I am currently using cubemx for my project. are there any examples to help me on how to set the following parameters:

memory type, chip select high time, refresh rate ?

ChahinezC
Lead

Hello @JJuli.1​,

The parameters you cited are memory related ones which means they are specific to the memory used:

  • The memory type should be set based on the memory you are using, you can check the different types mentioned in the reference manual at the MTYP bits of the OCTOSPI device configuration register. The OCTOSPI interface on the STM32 devices do support as well other memories that follow the same protocols as the mentioned types. 
  • For the Chip select high time (CSHT), it defines the chip-select minimum high time in number of clock cycles, configured an you can set it based on the memory datasheet.
  • For the refresh rate, the chip select must go high each (REFRECH x OCTOSPI clock cycles), configured depending on the memory datasheet as well. 

Please mark my answer as best by clicking on the "Select as Best" button if it fully answered your question. This will help other users find this solution faster.

Thank you.

Chahinez

ChahinezC
Lead

I recommend you checking the Table 7. STM32CubeMX - Configuration of OCTOSPI parameters of the "6.2.4 OCTOSPI configuration and parameter settings" section of the AN5050. It will certainly help you understand the parameters configuration and how to set them.

Regards,

Chahinez.

JJuli.1
Associate II

thank you for your help i will check the table

I have one more question, when to use the hyperbus instead of the regular one?

ChahinezC
Lead

Hello @JJuli.1​,

The OctoSPI interface can operate in two different low-level protocols: Regular-command and HyperBus. 

When in Regular-command protocol, the OCTOSPI communicates with the external device using commands. Each command can include the following phases:

  • Instruction phase
  • Address phase
  • Alternate-byte phase
  • Dummy-cycle phase
  • Data phase

The HyperBus protocol enables the communication with HyperRAM and HyperFlash memories and the frame is composed of the following phases:

  • Command/address phase
  • Data phase

For any further inquires, I suggest you open another thread. It will help us and the other users of the community assist you with your issue.

It will also be helpful for others to find the answer faster if they have a similar issue/question.

Thank you.

Chahinez.

About the refresh rate. My octospi clock is 104Mhz, i use as external ram memory APMemory APS6408L-3OBMx, could someone help me calculate the refresh rate?

I have found the answer to my question myself. 
1/104MHZ = 9.62ns = octospi clock cycle

Refresh = Refresh rate/ octospi clock cycle   = 4µs/9.62ns = 4µs/(1/(104MHZ)) = 416
Choose as refresh value 417 or 418, don't ask me why.


The value of refresh rate, we can find it in datasheet, for APMemory it is the parameter tCEM(CE# low pulse width), for my memory it has the value 4µs. --> See picture below.

FLuba1_0-1700177536063.png

Refresh rate for the Hyperbus Cypress memory(infineon): look at the parameter "HyperRAM Chip Select Maximum Low Time - Industrial Temperature" = tCSM = 4.00 µs --> see picture below

FLuba1_1-1700177788641.png