Skip to content

Commit

Permalink
stm32/qspi: Enable sample shift and disable timeout counter.
Browse files Browse the repository at this point in the history
This makes the QSPI more robust, in particular the timeout counter should
not be used with memory mapped mode (see F7 errata).
  • Loading branch information
dpgeorge committed Mar 1, 2019
1 parent 47e551b commit f8f2724
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ports/stm32/qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ void qspi_init(void) {
#if defined(QUADSPI_CR_DFM_Pos)
| 0 << QUADSPI_CR_DFM_Pos // dual-flash mode disabled
#endif
| 0 << QUADSPI_CR_SSHIFT_Pos // no sample shift
| 1 << QUADSPI_CR_TCEN_Pos // timeout counter enabled
| 1 << QUADSPI_CR_SSHIFT_Pos // do sample shift
| 0 << QUADSPI_CR_TCEN_Pos // timeout counter disabled (see F7 errata)
| 1 << QUADSPI_CR_EN_Pos // enable the peripheral
;

Expand All @@ -71,7 +71,6 @@ void qspi_memory_map(void) {
// Enable memory-mapped mode

QUADSPI->ABR = 0; // disable continuous read mode
QUADSPI->LPTR = 100; // to tune
QUADSPI->CCR =
0 << QUADSPI_CCR_DDRM_Pos // DDR mode disabled
| 0 << QUADSPI_CCR_SIOO_Pos // send instruction every transaction
Expand Down

0 comments on commit f8f2724

Please sign in to comment.