CommandSet Issue with STM32H7B3 + Parallel NOR Flash
Hi, I have a custom board using STM32H7B3 with the MT28EW128ABA1HJS-0SIT NOR Flash, and I'm getting an error trying to initialize the NOR Flash during HAL_NOR_Init.
/* Get the value of the command set */
...
else // 16 Bit
{
NOR_WRITE(NOR_ADDR_SHIFT(deviceaddress, uwNORMemoryDataWidth, NOR_CMD_ADDRESS_FIRST_CFI), NOR_CMD_DATA_CFI);
}
hnor->CommandSet = *(__IO uint16_t *) NOR_ADDR_SHIFT(deviceaddress, uwNORMemoryDataWidth, NOR_ADDRESS_COMMAND_SET);
status = HAL_NOR_ReturnToReadMode(hnor);
}
where hnor->CommandSet is read as 0xFFFF, which doesn't match NOR_AMD_FUJITSU_COMMAND_SET or NOR_INTEL_SHARP_EXT_COMMAND_SET so the status becomes HAL_Error and goes to error handler.
Below is the Init & Timing for the NOR Flash:
hnor1.Instance = FMC_NORSRAM_DEVICE;
hnor1.Extended = FMC_NORSRAM_EXTENDED_DEVICE;
/* hnor1.Init */
hnor1.Init.NSBank = FMC_NORSRAM_BANK1;
hnor1.Init.DataAddressMux = FMC_DATA_ADDRESS_MUX_DISABLE;
hnor1.Init.MemoryType = FMC_MEMORY_TYPE_NOR;
hnor1.Init.MemoryDataWidth = FMC_NORSRAM_MEM_BUS_WIDTH_16;
hnor1.Init.BurstAccessMode = FMC_BURST_ACCESS_MODE_DISABLE;
hnor1.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW;
hnor1.Init.WaitSignalActive = FMC_WAIT_TIMING_BEFORE_WS;
hnor1.Init.WriteOperation = FMC_WRITE_OPERATION_ENABLE;
hnor1.Init.WaitSignal = FMC_WAIT_SIGNAL_DISABLE;
hnor1.Init.ExtendedMode = FMC_EXTENDED_MODE_DISABLE;
hnor1.Init.AsynchronousWait = FMC_ASYNCHRONOUS_WAIT_DISABLE;
hnor1.Init.WriteBurst = FMC_WRITE_BURST_DISABLE;
hnor1.Init.ContinuousClock = FMC_CONTINUOUS_CLOCK_SYNC_ASYNC;
hnor1.Init.WriteFifo = FMC_WRITE_FIFO_DISABLE;
hnor1.Init.PageSize = FMC_PAGE_SIZE_NONE;
/* Timing */
Timing.AddressSetupTime = 4;
Timing.AddressHoldTime = 20;
Timing.DataSetupTime = 15;
Timing.BusTurnAroundDuration = 15;
Timing.CLKDivision = 16;
Timing.DataLatency = 17;
Timing.AccessMode = FMC_ACCESS_MODE_B;
How can I solve this problem? Any help is appreciated.
