Solved
OSPI clock signal not being generated
Title pretty much says it all. I am able to toggle the pin, PB2, on the STM32H7, when configured as GPIO output but nothing happens when configured as OSPI_SCK.
Here is the MX_OCTOSPI1_Init:
void MX_OCTOSPI1_Init(void)
{
/* USER CODE BEGIN OCTOSPI1_Init 0 */
/* USER CODE END OCTOSPI1_Init 0 */
OSPIM_CfgTypeDef sOspiManagerCfg = {0};
/* USER CODE BEGIN OCTOSPI1_Init 1 */
/* USER CODE END OCTOSPI1_Init 1 */
hospi1.Instance = OCTOSPI1;
hospi1.Init.FifoThreshold = 1;
hospi1.Init.DualQuad = HAL_OSPI_DUALQUAD_DISABLE;
hospi1.Init.MemoryType = HAL_OSPI_MEMTYPE_MICRON;
hospi1.Init.DeviceSize = 24;
hospi1.Init.ChipSelectHighTime = 3;
hospi1.Init.FreeRunningClock = HAL_OSPI_FREERUNCLK_DISABLE;
hospi1.Init.ClockMode = HAL_OSPI_CLOCK_MODE_0;
hospi1.Init.WrapSize = HAL_OSPI_WRAP_NOT_SUPPORTED;
hospi1.Init.ClockPrescaler = 1;
hospi1.Init.SampleShifting = HAL_OSPI_SAMPLE_SHIFTING_HALFCYCLE;
hospi1.Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_DISABLE;
hospi1.Init.ChipSelectBoundary = 0;
hospi1.Init.DelayBlockBypass = HAL_OSPI_DELAY_BLOCK_USED;
hospi1.Init.MaxTran = 0;
hospi1.Init.Refresh = 0;
if (HAL_OSPI_Init(&hospi1) != HAL_OK)
{
Error_Handler();
}
sOspiManagerCfg.ClkPort = 1;
sOspiManagerCfg.NCSPort = 1;
sOspiManagerCfg.IOLowPort = HAL_OSPIM_IOPORT_1_LOW;
if (HAL_OSPIM_Config(&hospi1, &sOspiManagerCfg, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN OCTOSPI1_Init 2 */
/* USER CODE END OCTOSPI1_Init 2 */
}Here is the very first OPSI related function I run after the above init:
HAL_StatusTypeDef W25Q_EnableReset(OSPI_HandleTypeDef *hospi)
{
OSPI_RegularCmdTypeDef cmd;
HAL_StatusTypeDef status;
cmd.OperationType = HAL_OSPI_OPTYPE_COMMON_CFG;
cmd.Instruction = W25Q_ENABLE_RESET;
cmd.InstructionMode = HAL_OSPI_INSTRUCTION_1_LINE;
cmd.InstructionSize = HAL_OSPI_INSTRUCTION_8_BITS;
cmd.Address = 0;
cmd.AddressMode = HAL_OSPI_ADDRESS_NONE;
cmd.AddressSize = HAL_OSPI_ADDRESS_8_BITS;
cmd.AlternateBytes = 0;
cmd.AlternateBytesMode = HAL_OSPI_ALTERNATE_BYTES_NONE;
cmd.AlternateBytesSize = HAL_OSPI_ALTERNATE_BYTES_8_BITS;
cmd.DummyCycles = 0;
cmd.NbData = 0;
cmd.DataMode = HAL_OSPI_DATA_NONE;
cmd.DataDtrMode = HAL_OSPI_DATA_DTR_DISABLE;
cmd.SIOOMode = HAL_OSPI_SIOO_INST_EVERY_CMD;
//HAL_GPIO_WritePin(QSPI_CLK_GPIO_Port, QSPI_CLK_Pin, RESET); // Not sure yet if needed
status = HAL_OSPI_Command(&hospi1, &cmd, W25Q_TIMEOUT_VALUE);
//HAL_GPIO_WritePin(QSPI_CLK_GPIO_Port, QSPI_CLK_Pin, SET);
return status;
}The HAL_OSPI_Command hits the timeout and I never see a clock signal for the entire function duration. Any guidance would be wonderful!
