Skip to content

Commit ea044e0

Browse files
authored
STM32F7 QSPI flash timeouts and 4-byte addressing (#152)
* STM32F7: Unconditionally enable QSPI workarounds On the STM32769NI at least this patch is required for stable QSPI use. Enable it uncondtionally in case other boards need it too. Further discussions: ARMmbed#10049 ARMmbed#15108 STMicroelectronics/STM32CubeF7#52 STMicroelectronics/STM32CubeF7#82 * QSPIF: Attempt 4-byte addressing on Macronix chips mbed-os PR 11531 introduced 4-byte addressing in the QSPIF block device: ARMmbed#11531 During testing it was found that this code broke on the NRF52840_DK and DISCO_F769NI. The NRF52840_DK controller seems unable to handle 4-byte addressing at all and has been disabled entirely in another code section. The DISCO_F769NI breakage was attributed to the flash chip but after more research I believe this is related to the QSPI controller, not the 4-byte addressing itself. Now that the QSPI controller has a workaround, enable 4-byte addressing again and hope it works fine this time.
1 parent ed4c4f4 commit ea044e0

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

storage/blockdevice/COMPONENT_QSPIF/source/QSPIFBlockDevice.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,6 @@ int QSPIFBlockDevice::_handle_vendor_quirks()
10951095
_needs_fast_mode = true;
10961096
_num_status_registers = 3;
10971097
_read_status_reg_2_inst = QSPIF_INST_RDCR;
1098-
_attempt_4_byte_addressing = false;
10991098
break;
11001099
case 0x9d:
11011100
// ISSI devices have only one status register

targets/TARGET_STM/TARGET_STM32F7/STM32Cube_FW/STM32F7xx_HAL_Driver/stm32f7xx_hal_qspi.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -571,10 +571,8 @@ void HAL_QSPI_IRQHandler(QSPI_HandleTypeDef *hqspi)
571571
__HAL_DMA_DISABLE(hqspi->hdma);
572572
}
573573

574-
#if defined(QSPI1_V1_0)
575574
/* Clear Busy bit */
576575
HAL_QSPI_Abort_IT(hqspi);
577-
#endif
578576

579577
/* Change state of QSPI */
580578
hqspi->State = HAL_QSPI_STATE_READY;
@@ -616,10 +614,8 @@ void HAL_QSPI_IRQHandler(QSPI_HandleTypeDef *hqspi)
616614
}
617615
}
618616

619-
#if defined(QSPI1_V1_0)
620617
/* Workaround - Extra data written in the FIFO at the end of a read transfer */
621618
HAL_QSPI_Abort_IT(hqspi);
622-
#endif
623619

624620
/* Change state of QSPI */
625621
hqspi->State = HAL_QSPI_STATE_READY;
@@ -1021,10 +1017,8 @@ HAL_StatusTypeDef HAL_QSPI_Transmit(QSPI_HandleTypeDef *hqspi, uint8_t *pData, u
10211017
/* Clear Transfer Complete bit */
10221018
__HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_TC);
10231019

1024-
#if defined(QSPI1_V1_0)
10251020
/* Clear Busy bit */
10261021
status = HAL_QSPI_Abort(hqspi);
1027-
#endif
10281022
}
10291023
}
10301024

@@ -1112,10 +1106,8 @@ HAL_StatusTypeDef HAL_QSPI_Receive(QSPI_HandleTypeDef *hqspi, uint8_t *pData, ui
11121106
/* Clear Transfer Complete bit */
11131107
__HAL_QSPI_CLEAR_FLAG(hqspi, QSPI_FLAG_TC);
11141108

1115-
#if defined(QSPI1_V1_0)
11161109
/* Workaround - Extra data written in the FIFO at the end of a read transfer */
11171110
status = HAL_QSPI_Abort(hqspi);
1118-
#endif
11191111
}
11201112
}
11211113

0 commit comments

Comments
 (0)