<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Zdravim, jsem z toho uz trosku jelen, normalne v CubeMX
nakonfiguruju rozhrani a parametry (tady jeste trosku tapu)
vygeneruju kod a prelozim. Pripojena je SPI FLASH 26F064 kterou
bych chtel provozovat jako QSPI<br>
</p>
<p>Problem je ve vygenerovane inicializaci, ktera vypada takto:</p>
<p>/* OCTOSPI1 init function */<br>
void MX_OCTOSPI1_Init(void)<br>
{<br>
OSPIM_CfgTypeDef OSPIM_Cfg_Struct;<br>
OSPI_AutoPollingTypeDef cfg;<br>
<br>
hospi1.Instance = OCTOSPI1;<br>
hospi1.Init.FifoThreshold = 1;<br>
hospi1.Init.DualQuad = HAL_OSPI_DUALQUAD_DISABLE;<br>
hospi1.Init.MemoryType = HAL_OSPI_MEMTYPE_MICRON;<br>
hospi1.Init.DeviceSize = 22;<br>
hospi1.Init.ChipSelectHighTime = 1;<br>
hospi1.Init.FreeRunningClock = HAL_OSPI_FREERUNCLK_DISABLE;<br>
hospi1.Init.ClockMode = HAL_OSPI_CLOCK_MODE_0;<br>
hospi1.Init.WrapSize = HAL_OSPI_WRAP_NOT_SUPPORTED;<br>
hospi1.Init.ClockPrescaler = 3;<br>
hospi1.Init.SampleShifting = HAL_OSPI_SAMPLE_SHIFTING_NONE;<br>
hospi1.Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_DISABLE;<br>
hospi1.Init.ChipSelectBoundary = 0;<br>
if (HAL_OSPI_Init(&hospi1) != HAL_OK)<br>
{<br>
_Error_Handler(__FILE__, __LINE__);<br>
}<br>
<br>
OSPIM_Cfg_Struct.ClkPort = 1;<br>
OSPIM_Cfg_Struct.NCSPort = 1;<br>
OSPIM_Cfg_Struct.IOLowPort = HAL_OSPIM_IOPORT_1_LOW;<br>
if (HAL_OSPIM_Config(&hospi1, &OSPIM_Cfg_Struct,
HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)<br>
{<br>
_Error_Handler(__FILE__, __LINE__);<br>
}<br>
<br>
cfg.Match = 0;<br>
cfg.Mask = 1;<br>
cfg.MatchMode = HAL_OSPI_MATCH_MODE_AND;<br>
cfg.AutomaticStop = HAL_OSPI_AUTOMATIC_STOP_ENABLE;<br>
cfg.Interval = 0;<br>
<font color="#ff0000">if (HAL_OSPI_AutoPolling(&hospi1,
&cfg, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)</font><br>
{<br>
_Error_Handler(__FILE__, __LINE__);<br>
}<br>
<br>
if (HAL_OSPI_AutoPolling_IT(&hospi1, &cfg) != HAL_OK)<br>
{<br>
_Error_Handler(__FILE__, __LINE__);<br>
}<br>
<br>
}</p>
<p>Funkce if (HAL_OSPI_AutoPolling(&hospi1, &cfg,
HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) vrati
HAL_OSPI_ERROR_INVALID_SEQUENCE protoze hospi->State ==
HAL_OSPI_STATE_CMD_CFG neni splneno a state je
HAL_OSPI_STATE_READY, coz je logicke, protoze nebyl spusten zadny
command...</p>
<p>Je to BUG a nezbyde, nez v CubeMX periferii zakazat a
nakonfigurovat komplet sam, nebo delam neco spatne? IMHO to takhle
proste nemuze fungovat, inicializaci jsem docela dukladne
prokrokoval a neni tam nic, co by state zmenilo na
HAL_OSPI_STATE_CMD_CFG...</p>
<p>Bohuzel tohle rozhrani ma v konfiguratoru jen volbu HAL, zadne LL
a konfiguracni dialog mi prijde taky sity nejak horkou jehlou,
chybi tam spousta nastaveni co by dle DS sla, hlavne treba rezim,
aby to krome inicializace nic automaticky nedelalo...<br>
</p>
<p><br>
</p>
<p><br>
</p>
</body>
</html>