1. The empty macro for bus_acquire needs another parameter:
#define bus_acquire(busp, config)
2. The 'real' bus_acquire() routine calls wspiStart() when required; the empty macro does not. (config is not (void)). So wspi does not start if there's no bus arbitration.
Also, not sure that it matters, but the wspi bus_acquire() and bus_release() are declared as static; those for SPI are not.
Also, in hal_wspi_lld.c (for STM32FXX), wspi_lld_map_flash() the dummy cycle count isn't included in the command:
Code: Select all
/* Starting memory mapped mode using the passed parameters.*/
wspip->qspi->DLR = 0;
wspip->qspi->ABR = 0;
wspip->qspi->AR = 0;
wspip->qspi->CCR = cmdp->cmd | cmdp->cfg |
QUADSPI_CCR_DUMMY_CYCLES(cmdp->dummy) |
QUADSPI_CCR_FMODE_1 | QUADSPI_CCR_FMODE_0;