2022-12-03 05:16 AM
1.in the manual "AN5050", What's the meaning of "memory type"? Does this mean that OCTO only supports these four types of memory chips? The flash I used is "IS25LP064A", Does the OCTOSPI support this flash?
2.How to set the "DEVSIZE"?
if the flash size is 8MByte, hospil.Init.DeviceSize=23 or 22? I don't know how to set the parameter.
Solved! Go to Solution.
2022-12-03 09:06 AM
MTYP: See RM of your MCU, in particular OCTOSPI_DCR1.
DEVSIZE: no, as indicated above, 23 would be adviseable.
Clock: Well, take OCTOSPI kernel clock (as given by the clock tree and
OCTOSPISEL bit in RCC_D1CCIPR) and calculate the required divider to yield a clock below the flash's limit (50MHz in your case). If you're unsure (there are a lot of settings involved) check the resulting clock with a scope.
2022-12-03 07:50 AM
For SPI flash the memory type (macronix vs. micron) is relevant only in Octal-DTR mode, it affects the byte order within one clock cycle.
As your chip is only SPI or Quad-SPI, the setting of type (macronix/micron) doesn't matter, i.e. MTYP should be 000 or 001.
Regarding DEVSIZE: In theory 22 would be correct as 2^(22+1) gives 8 MBytes. But due to a silicon bug (see errata sheet), it's a good idea to choose a bigger value, so 23 would be a much safer choice.
2022-12-03 07:51 AM
The IS25LP064A should be workable.
These other "Type" relate how the signalling works/sequences, and which player its most like.
Winbond, ISSI, Infineon should all work
The size can be sensed by getting a Hard Fault once you get to the end, or the content appear to wrap.
I don't think ST has been consistent in the API vs register, and some of the H7 have some known errata up within the last 32-bytes, and caching.
Yeah the table/note are unhelpful.
2**23 = 8MB, DEVSIZE at the register 22, it's a 5-bit field
Walk the code to check what the API does in a given context, or look at Peripheral View post setup.
2022-12-03 08:06 AM
ok, thanks, what's the meaning of "MTYP", and how to set it to "000" or "001"?
According to your explanation, in my source code "hospil.Init.DeviceSize" should be 22, right?
another question is how to set the frequency of OCTOSPI? what's the difference between "Max
OCTOSPI speed (MHz)" and "Indirect mode"?and according to my flash, how to set the OCTOSPI CLK correctly?
2022-12-03 08:10 AM
If I use IS25LP064A How to select in the selection list of memory type ?
2022-12-03 08:11 AM
ok, thanks, what's the meaning of "MTYP", and how to set it to "000" or "001"?
According to your explanation, in my source code "hospil.Init.DeviceSize" should be 22, right?
another question is how to set the frequency of OCTOSPI? what's the difference between "Max
OCTOSPI speed (MHz)" and "Indirect mode"?and according to my flash, how to set the OCTOSPI CLK correctly?
2022-12-03 09:06 AM
MTYP: See RM of your MCU, in particular OCTOSPI_DCR1.
DEVSIZE: no, as indicated above, 23 would be adviseable.
Clock: Well, take OCTOSPI kernel clock (as given by the clock tree and
OCTOSPISEL bit in RCC_D1CCIPR) and calculate the required divider to yield a clock below the flash's limit (50MHz in your case). If you're unsure (there are a lot of settings involved) check the resulting clock with a scope.
2022-12-03 08:55 PM
"As your chip is only SPI or Quad-SPI, the setting of type (macronix/micron) doesn't matter, i.e. MTYP should be 000 or 001.", for my flash-IS25LP064A, I think I should set MTYP to 010, do you think so?
2.For "DEVSIZE", when my flash size is 8MB, I should set this parameter to 23, right?
Do you have any actual experience with this peripheral?
3.Do you have a OCTOSPI Project demo? or Contact information, such as teams or skyper? so we can communicate with my issue.
2022-12-04 04:24 AM
2022-12-14 07:24 AM
Hello @rsun.1,
Adding to all the contributors' comments, and for the frequencies presented in the Table 2 of the AN5050:
Regards,
Chahinez.